Having issues using CSS
See original GitHub issueI’ve read the other issues submitted here, but I can’t get CSS to load.
In an component, I do something like:
import s from 'rc-dropdown/assets/index.css';
...
export default withStyles(Dropdown, s);
However I get the error: SyntaxError: Unexpected token ILLEGAL
I’ve tried modifying the webpack config to both:
{
test: /\.css$/,
loaders: [
'isomorphic-style-loader',
`css-loader?${DEBUG ? 'sourceMap&' : 'minimize&'}modules&localIdentName=` +
`${DEBUG ? '[name]_[local]_[hash:base64:3]' : '[hash:base64:4]'}`
]
},
and
{
test: /\.scss$|.css$/,
loaders: [
'isomorphic-style-loader',
`css-loader?${JSON.stringify({
sourceMap: DEBUG,
// CSS Modules https://github.com/css-modules/css-modules
modules: true,
localIdentName: DEBUG ? '[name]_[local]_[hash:base64:3]' : '[hash:base64:4]',
// CSS Nano http://cssnano.co/options/
minimize: !DEBUG,
})}`,
'postcss-loader?parser=postcss-scss',
'sass-loader?sourceMap',
],
},
Still getting the same error - what am I supposed to do?
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Handling common HTML and CSS problems - MDN Web Docs
Some problems can be solved by just taking advantage of the natural way in which HTML/CSS work. Unrecognized HTML elements are treated by...
Read more >Common CSS Issues For Front-End Projects
Common CSS Issues For Front-End Projects · 1. Reset The Backgrounds Of button And input Elements · 2. Overflow: scroll vs. · 3....
Read more >How to Troubleshoot CSS Not Working - WPForms
Have you added custom CSS for your forms, but not been able to see it come through? Here's how to troubleshoot when your...
Read more >Solving problems with CSS - Hidde's blog
CSS problems are often solved with clever combinations of CSS properties. Putting these in a black box can make complex things look simple,...
Read more >Problems of CSS at Scale - byby.dev
Lacking of built-in namespaces - Any programming languages lacking built-in namespaces will have problems at scale and CSS is obviously one of ......
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
Okay cheers - not too keen on that approach since I’ve got quite a few external components. Will stick with the inline approach, thanks!
Not work for me too