简体   繁体   中英

How to use individual materialize css components

I've installed materialize-css using npm .
https://materializecss.com/
How can I import individual components (like button, navbar) instead of the full build?
I'm using webpack as well.
I see files such as buttons.js , but I can't import them. Also obviously I want to set up minification for the components that I use.

The easiest way to get whatever component you want to include is to setup your build using SASS/SCSS. That way choosing which component you want is as simple as including an @import statement like:

@import "components/buttons";
@import "components/grid";
@import "components/datepicker";

But if you dont want to learn SCSS syntax, try this: http://materialize.khophi.co

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM