react-toolbox icon indicating copy to clipboard operation
react-toolbox copied to clipboard

Styles not getting applied.

Open ginshade opened this issue 10 years ago • 5 comments

I am trying to use react-toolbox with react-redux-starter-kit (https://github.com/davezuko/react-redux-starter-kit)

When I try to render a button, the button gets rendered, but, there are no styles applied to it. My webpack config has the following in it.

I use an almost identical webpack config to the one shown here, https://github.com/davezuko/react-redux-starter-kit/blob/master/build/webpack/_base.js

the following are the differences.

resolve : {
        extensions : ['', '.js', '.jsx','.scss'],
        alias      : config.get('utils_aliases')
},

AND

{                                                                                        
        test: /(\.scss|\.css)$/,                                       
        loaders : ['style-loader','css-loader', 'postcss-loader','sass-loader']
},                                                                                       

Right now the button looks like this.

screenshot from 2015-12-07 04 58 34

ginshade avatar Dec 07 '15 00:12 ginshade

Maybe you're excluding node_modules? Please take this as an example to figure out what's wrong with your configuration. Thanks!

javivelasco avatar Dec 07 '15 10:12 javivelasco

It took me a while to get my webpack config squared away; but I might have learned something; share the repo you are having a problem with?

ai10 avatar Dec 08 '15 22:12 ai10

Apparently there are common problems to configure webpack. Since this is an issue almost sure related to configuration I'm closing it to reduce noise.

javivelasco avatar Dec 11 '15 18:12 javivelasco

Hi I agree this is a config problem and not a defect, but it would be nice to know @ginshade if you find your problem/workaround, I am having the same problem here...

ziso avatar Dec 22 '15 14:12 ziso

Hey, in react-redux-starter-kit, you can specify to load react-toolkit as a cssmodule.

Go to build/webpack.config.js and find (around line 161):

// Add any packge names here whose styles need to be treated as CSS modules.
// These paths will be combined into a single regex.
const PATHS_TO_TREAT_AS_CSS_MODULES = [
  // 'react-toolbox', (example)
]

'react-toolbox' is written as a example comment.

Change it to:

const PATHS_TO_TREAT_AS_CSS_MODULES = [
  'react-toolbox',
]

Is it working?

vseehausen avatar May 23 '16 11:05 vseehausen