-
-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Does create-react-app includes a reset css? #2273
Comments
Not currently but I think we should. I just don't know what's the best practice these days. |
I'd suggest Normalize.css or Bootstrap's more opinionated Reboot. |
I'm cool with whatever most people would be cool with. |
In align with our philosophy, I'd run with normalize. I don't think it's a topic that really needs discussed, its purpose is to fix browsers and normalize them all according to the official spec. I also believe Reboot requires newer browsers, and we support IE 9+, so... |
Okay, thanks! I think i'm gonna go with https://github.com/necolas/normalize.css So, a simple install & import should work fine.
|
This sounds good. I would probably also tweak our default index.css to do just a few more opinionated things like |
We're pretty much approaching what Reboot does that that point, so it may be more sensible if we add some tweaks (like pixel fallback) and IE9 stuff back from normalize.css. |
Mmm. Reboot looks too opinionated to me. Honestly, Normalize + |
Nope, we can go with it 😄 sorry for my extended rambling. Do we want to put Normalize into |
I would explicitly put it as a default dependency and an explicit import because people might want to replace it with some other reset and it's okay. Not sure if it's best to import in JS or CSS. |
I think sanitize.css is also good. |
@mlspinylobster Thanks! Going to try it |
sanitize.css seems a nice improvement (a bit more opinionated) over normalize.css |
Will this override a CSS Framework's own reboot.css? |
Are there any plans to implement this in create-react-app? If not, could I suggest adding something to the user guide (perhaps some simple steps to install normalize.css or sanitize.css manually)? |
As this is CSS stuff it seems more natural to import in the CSS. The only missing feature of CRA is to allow CSS import from the |
You can import css from node_modules, is something not working for you? Please file an issue! |
Ho I should be drunk last time. Now I succeed to import /* in index.css */
@import '../node_modules/normalize.css/normalize.css'; So as this works, it seems the most important move is to do this import it the base template. I could try a PR if you want |
You can also use this in your import 'normalize.css/normalize.css'; But sure, a PR would be appreciated! |
Besides reseting BS, you can even mixed up with your own "reset". It works and React respects the order of loading.
|
@gaearon I don't think a react boilerplate should include CSS reboot/reset. From what I see a lot of frameworks provide reboot(example Material UI v1, Bootstrap). If I'd be using material UI, then I would like to use the included reboot component and not have to deal with removing/overriding the reboot provided by a boilerplate. TLDR: I believe CSS reset should be provided(as done by some) by the UI components library or by some external library that the user will add. If anything such introduced into create-react-app, it should be optional. |
Also worth mentioning is postcss-normalize. The biggest selling factors are:
and
|
@Timer is this still going to be added in CRA 2.x? |
More than happy to accept a contribution using something like postcss-normalize. |
I'd like to help but I may need a few pointers. Specifically, is this something that is masked by a flag/option or enabled by default? And if there are any dos and donts that I should be aware of, that'd be helpful as well. |
This looks a nice feature to have. So I'd say it's enabled by default, one of the core ideas of CRA is that we avoid flags whenever possible. Most important dos and don'ts can be found in the contribution guidelines. So @mrchief let me know if you plan to grab this one or not, I've contributed to the SASS loader for CRA2 so this looks straightforward to me and I'd be happy to grab in case you're busy. :) |
Thanks @Fabianopb for the pointers. Let me take a shot at this if you haven't started already. |
No I haven't, please go on! |
On it! |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
I wonder if this tool includes a reset.css (injected dynamically somehow?) (basically to make all websitesbahve the same, regardless of the browser). I'm just curious. If it doesn't, what would you recommend?
Thanks.
The text was updated successfully, but these errors were encountered: