@import-normalize does not work
See original GitHub issueDescribe the bug
According to the documentation adding @import-normalize in index.css should reset the browser styles but apparently it does not work and gives error as:
Unknown at rule @import-normalizecss(unknownAtRules) Here is the image with @import-normalize
Did you try recovering your dependencies?
npm version - 6.14.4
Which terms did you search for in User Guide?
normalize css and reset css
Environment
System: OS: macOS 10.15.6 Binaries: Node: 12.18.0 - /usr/local/opt/node@12/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.8 - ~/dev/cph-trips/node_modules/.bin/npm Browsers: Chrome: 85.0.4183.121 Firefox: 76.0.1 Safari: 14.0 npmPackages: react: ^16.13.1 => 16.13.1 react-dom: ^16.13.1 => 16.13.1 react-scripts: 3.4.3 => 3.4.3
Steps to reproduce
- Download create react app using npx create-react-app
- Add @import-normalize in index.css
Expected behavior
Adding @import-normalize should reset the browser style and not show the unknown error
Issue Analytics
- State:
- Created 3 years ago
- Reactions:26
- Comments:25
Top Results From Across the Web
stylelint on create-react-app @import-normalize throw error
I tried this method with CRA (create-react-app). It did not work. – Omkar Rajam. Nov 1, 2020 at 12:34.
Read more >@import-normalize doesn't work with CRA - CodeSandbox
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >What is a Normalize CSS File & How Do You Use It?
Normalize aims to fix that problem by targeting the default rules from different browsers. The Normalize file sets default values for these ...
Read more >sklearn.preprocessing.Normalizer
normalize. Equivalent function without the estimator API. Notes. This estimator is stateless (besides constructor parameters), the fit method does nothing ...
Read more >Provide support for postcss @import-normalize (React)
... problem? Create a new react project using npx create-react-app appname --template typescript , then open index.css file and paste: @import-normalize :
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
repro: https://codesandbox.io/s/import-normalize-doesnt-work-with-cra-p52f9
Workaround for posterity:
yarn add normalize.css
import 'normalize.css'
before other css imports inindex.js
Seeing as
@import-normalize
is part ofcsstools/postcss-normalize
, I’d recommend their version ofnormalize.css
instead, because it isn’t opinionated and is still supported (unlike thenecolas/normalize.css
fork):yarn add @csstools/normalize.css
import '@csstools/normalize.css'
before other css imports inindex.js