-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
how to require CSS file ? #423
Comments
|
Can I do like this: ? |
@zhaolihang with the default settings, you can't do
The default css loader changes class names so you can have per-component stylesheets.
That allows you to create a stylesheet for each component, and for example have a If you want your components to share css classes, you have a few options.
This loader will preserve the class names of .css files only, and generate unique .scss file names.
If you take this approach, the following will work
|
But how can i override bootstrap class name issue #431 . |
If you use the following for a css loader, your stylesheets will behave just like you would expect them to if you had
Just apply the bootstrap css file to your app container and then in
to override the bootstrap styles. |
@b-gran I am trying to get bootstrap styling to be isomorphic as well in order to avoid the FOUC that comes with importing the bootstrap styling in
I am new to react and webpack, so it might be something obvious that I don't quite understand. |
- Allows to import external css from node_modules (ref kriasoft#510, kriasoft#824) - Allows to properly process `url()` statements (ref kriasoft#825) - Allows to import css without css-modules prefixing (close kriasoft#771) ```css /* Example: MyTextEditorComponent.css */ :global { @import 'draft-js/dist/Draft.css'; /* external style without prefixing */ } .button { color: red; } /* keep the prefixes for your own style */ ``` Also closes kriasoft#375 and kriasoft#423
- Allows to import external css from node_modules (ref #510, #824) - Allows to properly process `url()` statements (ref #825) - Allows to import css without css-modules prefixing (close #771) ```css /* Example: MyTextEditorComponent.css */ :global { @import 'draft-js/dist/Draft.css'; /* external style without prefixing */ } .button { color: red; } /* keep the prefixes for your own style */ ``` Also closes #375 and #423
Should be solved by #920. Please reopen if needed. |
require('./index.css');
when build ,I got a error .
then another error happend when I add "css-loader" in webpack.config.js :
{
test: /.css$/,
loader: 'css-loader',
},
how to do it ?
thanks!
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: