question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Foundation not loading (styles)

See original GitHub issue

What did you do?

Installed react-foundation step-by-step;

  1. npm install -g create-react-app
  2. create-react-app test
  3. cd test
  4. npm install react-foundation
  5. I replaced the code in App.js to the following;
import React, { Component } from 'react';
import { Column, Row } from 'react-foundation';
import logo from './logo.svg';
import './App.css';

class App extends Component {
  render() {
    return (
      <div className="App">
        <div className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h2>Welcome to React</h2>
        </div>
        <p className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>
        <div className="gridgrid">
          <Row>
            <Column small={3}>
              <div>1</div>
            </Column>
            <Column small={3}>
              <div>2</div>
            </Column>
            <Column small={3}>
              <div>3</div>
            </Column>
            <Column small={3}>
              <div>4</div>
            </Column>
          </Row>
        </div>
      </div>
    );
  }
}

export default App;

  1. npm start

What did you expect to happen?

I expected to see a grid system with 1 row and 4 columns (as in the examle on https://react.foundation/).

What actually happened?

When I look at the Foundation component’s CSS in the browser, no CSS is applied. It looks like there’s no foundation.css available. Al elements (columns) are placed under each other.

What version of this module are you using?

0.7.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:9
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
horaciocoronelcommented, Mar 6, 2018

You need to install foundation-sites npm and then add the import 'foundation-sites/dist/css/foundation.min.css'; in index.js

6reactions
gpspakecommented, Jun 27, 2017

This library simply provides react components that generate foundation markup so you can type <Row> instead of <div className="row"></div> It expects you to include the css yourself so including styles would be outside of the scope of this project. You just need to make sure to include the foundation css separately just like you would if you weren’t using this package.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Foundation-Rails not loading CSS - Stack Overflow
I'm trying to use Foundation in a pre-existing Rails 5 project, but none of the Foundation styling is actually loading.
Read more >
Foundation css not loading correctly - rubyonrails-talk
Thank you for your response. the problem is that foundation cannot load some styles while it loads some styles. I couldn't find a...
Read more >
Getting Started With Foundation CSS
After downloading the css files, follow these simple steps to get started: ... We recommend you use this because some Foundation styles are...
Read more >
Sass: @use
The simplest @use rule is written @use "<url>" , which loads the module at the given URL. Any styles loaded this way will...
Read more >
Zero to Website Guide Part 2: Digging into the Foundation ...
Learn what comes with the Foundation CSS download, how to add CSS and ... Best Practice: JS is not in head because it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found