Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about when to import bootstrap CSS. #1618

Merged
merged 2 commits into from
Feb 24, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ Import Bootstrap CSS and optionally Bootstrap theme CSS in the ```src/index.js``
import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap/dist/css/bootstrap-theme.css';
```
Ensure the bootstrap css is imported before the rest of your app (i.e. before `import Routes from './routes';`) so that your styles are loaded afterwards.
Copy link
Contributor

@Timer Timer Feb 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Bootstrap CSS

I'm not sure if I'm super-crazy about this wording, but I can't think of anything immediately better. I wonder if we should explain in more technical detail how overriding CSS works. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I'm not that keen either, but as you say without explaining how styles work I'm not sure how better to do it. We could alternatively just put the entire contents of the (default) index.js in there, and remove the note?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can try to explain it simply. Something like:

Be mindful that the order of CSS matters. Typically, the last imported rule overrides previous rule(s).
If you would like to override some Bootstrap styles, make sure you import the Bootstrap CSS before the rest of your application.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like that't a bit too verbose though, maybe @gaearon can help.


Import required React Bootstrap components within ```src/App.js``` file or your custom component files:

Expand Down