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.

@import-normalize does not work

See original GitHub issue

Describe 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

Screen Shot 2020-09-27 at 9 21 24 PM

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

  1. Download create react app using npx create-react-app
  2. 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:open
  • Created 3 years ago
  • Reactions:26
  • Comments:25

github_iconTop GitHub Comments

8reactions
corysimmonscommented, Dec 31, 2020

repro: https://codesandbox.io/s/import-normalize-doesnt-work-with-cra-p52f9

Workaround for posterity:

  • yarn add normalize.css
  • put import 'normalize.css' before other css imports in index.js
4reactions
derekschinkecommented, May 19, 2021

Seeing as @import-normalize is part of csstools/postcss-normalize, I’d recommend their version of normalize.css instead, because it isn’t opinionated and is still supported (unlike the necolas/normalize.css fork):

  • yarn add @csstools/normalize.css
  • put import '@csstools/normalize.css' before other css imports in index.js
Read more comments on GitHub >

github_iconTop 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 >

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