react-toolbox / react-toolbox-themr

A tool to statically extract and generate custom themes for React Toolbox
MIT License
240 stars 24 forks source link

ERROR when trying the layout example from the react-toolbox website #28

Open kavaro opened 7 years ago

kavaro commented 7 years ago

When trying the "http://react-toolbox.com/#/components/layout" example in create-react-app application I get the following error:

ERROR in ./~/css-loader?importLoaders=1!./~/postcss-loader!./~/react-toolbox/lib/button/theme.css
Module build failed: Error: composition is only allowed when selector is single :local class name not in ".raised", ".raised" is weird
    at /Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss-modules-scope/lib/index.js:26:13
    at Array.map (native)
    at getSingleLocalNamesForComposes (/Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss-modules-scope/lib/index.js:20:26)
    at /Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss-modules-scope/lib/index.js:106:26
    at /Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss/lib/container.js:198:28
    at /Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss/lib/container.js:148:26
    at Rule.each (/Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss/lib/container.js:114:22)
    at Rule.walk (/Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss/lib/container.js:147:21)
    at Rule.walkDecls (/Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss/lib/container.js:196:25)
    at /Users/karl/Documents/apps/modules/react-select-input/node_modules/postcss-modules-scope/lib/index.js:105:12
 @ ./~/react-toolbox/lib/button/theme.css 4:14-120 13:2-17:4 14:20-126
lc1983 commented 7 years ago

It seems to me the issue is because how you import the module with the create-react-app. For example, to import Button: Instead, import { Button } from 'react-toolbox'; Try, import Button from 'react-toolbox/lib/button/Button';

kavaro commented 7 years ago

Yes!!, this indeed solves the issue.

Many thanks, ....