Foundation not loading (styles)
See original GitHub issueWhat did you do?
Installed react-foundation step-by-step;
- npm install -g create-react-app
- create-react-app test
- cd test
- npm install react-foundation
- 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;
- 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:
- Created 7 years ago
- Reactions:9
- Comments:12 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to install foundation-sites npm and then add the
import 'foundation-sites/dist/css/foundation.min.css';
in index.jsThis 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.