-
Notifications
You must be signed in to change notification settings - Fork 268
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
material design css not working #147
Comments
I formatted your rules to better understand it and I see a subtle typo
You're missing an extra slash in The other thing I would ask you to verify is that you're importing your custom css (the one that has material design overrides) somehwere in your code. Nothing else pops out. If you still have issues, I'd suggest to create a sample repo that reproduces your issue and I can look further. |
hi, if i add some other rules like below than this material design work proper but other css mashup. please see below css file body { /* fallback, until codesandbox/codesandbox-client#174 is resolved */ .material-icons { /* multiselect is a custom classname to increases the specificity of our styles. It can be anything.
.multiselect .dropdown-trigger > span:after { .multiselect .toggle { .multiselect .toggle.collapsed::after { .multiselect .toggle.expanded::after { /* checkbox styles */ .multiselect .checkbox-item:before { .multiselect .checkbox-item:checked:before { JS File const Multiselect = ( props ) => { Now i want also apply "multiselect" css in tree select but for that i have to add rule in webpack and that i dont know my default webpack is below 'use strict'; const autoprefixer = require('autoprefixer'); // Webpack uses
},
}, |
Try importing your css after the dropdown’s css. Or increase the “specificity” of your css selectors. |
hi, // test: /.css$/, than default css not work proper and if i add plugins: [ |
Can you create a github repo with all the files/code? |
hi, 1)Multiselect.JS
if add below rule in webpack than default react dropdown tree select css working ok.
|
Took the liberty of formatting the code blocks in your post. Your code looks fine. I don't know what's not working. Simply stating "it's not working" is not very helpful. That's a very vague thing. Take a look at this branch: https://github.com/dowjones/react-dropdown-tree-select/tree/b7fe7bc77e1a7734bebb36b8de9b8e7aa443f1cc/docs/examples/material And in your 2nd webpack rule, try excluding
|
Hi, test: /.css$/, that also included in webpack. { now i want custom css, in that case add one css file and import that file to js file |
If you don't want to eject, you can still import the default css - but in that case, you need to import it within a JS file (like App.js or component.js). If you eject the app, you have more flexibility as you can setup various css loaders that will allow the import from within css files. It's a matter of coding style. Both approaches are fine. To keep things simple, try And instead of |
I believe this question has been answered. Happy to reopen this if you find any issues. |
hi,
i m new in react, actually i follow your steps and install react dropdown tree select in my project.
even i also added webpack rule which mentioned.
But if i try with custom css like material or bootstrap than its not working.
if i remove rule from webpack than default css also not working
so can any one tell me which rule or configuration i have to add in webpack?
i{
test: /.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader'
}
]
}),
include: /node_modules[/\]react-dropdown-tree-select/
},
{
test: /.css$/,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
modules:true,
localIdentName:'[Name][local][has:base64:5]'
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
require('postcss-flexbugs-fixes'),
autoprefixer({
browsers: [
'>1%',
'last 4 versions',
'Firefox ESR',
'not ie < 9', // React doesn't support IE8 anyway
],
flexbox: 'no-2009',
}),
],
},
},
],
},
The text was updated successfully, but these errors were encountered: