Use react-md in gatsby js
我正在尝试在我的Gatsby JS项目中使用React Material Design(
这是我安装
在我的
1 2 3 | plugins: [ 'gatsby-plugin-sass' ] |
然后,在
1 | @import '~react-md/src/scss/react-md'; |
然后将其导入到
1 | import './index.scss' |
渲染
添加到布局文件夹中的
1 2 3 4 5 | @import url('https://fonts.googleapis.com/cssfamily=Roboto:400,500,700|Material+Icons'); //optional @import '~react-md/src/scss/react-md'; // Required $md-primary-color: $md-teal-500; //optional colors $md-secondary-color: $md-purple-a-400; //optional colors @include react-md-everything; // Required |
注意:使用
如果要最小化CSS,请根据以下格式为每个相应的react-md-component使用
例如 在要导入的react组件的scss文件中使用
文档:最小化捆绑-react-md docs