Reputation: 876
I am going to be using Material Design For Web in a PHP application with a custom theme. I am looking for instructions on how to precompile the JS and CSS with my custom theme variables so that I can just pull in the js and css like you would if using the CDN. It appears the CDN does offer some custom themed color options, but none look like what I am looking for which is why I am looking to create my own precompiled css and js files
What are the steps to precompile with the custom theme variables so that I can just have a dist css and js file?
Upvotes: 0
Views: 360
Reputation: 921
Although this question is kind of too generic, I do understand why it appeared. material-components-web is not very easy to start with. Docs and examples are scarce and sometimes it is hard to understand how to do even basic things.
To be able to compile it with your own custom theme variables you need:
@use '@material/theme' with (
$primary: #212121,
$on-primary: #ffffff,
$secondary: #ffc629,
$background: #33333D,
$surface: #ffffff,
$on-surface: #000000
);
@use 'material-components-web/material-components-web'
You can use basic-material-starter-kit as an example.
Upvotes: 2