You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found an example repo here that shows how to integrate React Toolbox with a global theme (by way of using react-toolbox-themr.
But unfortunately, it seems that it does not show how I can customize the theme (not style) of a specific component. It also does not seem to be a use-case supported by react-toolbox-themr, or at least I have not found a way to do it.
Lack of CSS Modules
Normally, this is done with CSS Modules, but since the example does not use CSS Modules, I am not sure how I can fulfill the required API.
Since we don't have CSS Modules, adding theme={btnTheme} with the import btnTheme from "./btnTheme.css" will Next.JS to not know how to import a CSS file. I should also note that the main README.md cautioned against using the custom Webpack configuration to add loaders (like a CSS loader in this instance), because only the client code gets bundled with Webpack.
Warning: Adding loaders to support new file types (css, less, svg, etc.) is not recommended because only the client code gets bundled via webpack and thus it won't work on the initial server rendering.
Since we support postcss in styled-jsx now using styled-jsx plugins. You could add postcss-import and <style jsx>{@import 'some-module/file.css'}</style>. Haven't tested it yet. cc @albinekb
I found an example repo here that shows how to integrate React Toolbox with a global theme (by way of using react-toolbox-themr.
But unfortunately, it seems that it does not show how I can customize the theme (not style) of a specific component. It also does not seem to be a use-case supported by react-toolbox-themr, or at least I have not found a way to do it.
Lack of CSS Modules
Normally, this is done with CSS Modules, but since the example does not use CSS Modules, I am not sure how I can fulfill the required API.
So, although this works:
This does not work:
Since we don't have CSS Modules, adding
theme={btnTheme}
with theimport btnTheme from "./btnTheme.css"
will Next.JS to not know how to import a CSS file. I should also note that the main README.md cautioned against using the custom Webpack configuration to add loaders (like a CSS loader in this instance), because only the client code gets bundled with Webpack.Source: https://github.com/zeit/next.js#customizing-webpack-config
What is the best course of action here?
The text was updated successfully, but these errors were encountered: