- Install svelte-preprocess
npm install -D svelte-preprocess
- Install any Svelte Material UI comonent:
npm install --save-dev @smui/button
Note: you need to install at least one component otherwise you cannot compile the theme css. - Install smui-theme and create a template at src/theme
npm install -D smui-theme npx smui-theme template src/theme
- Add following script to scripts section of package.json
"prepare": "smui-theme compile public/build/smui.css -i src/theme"
- Compile the css from smui-theme template:
npm run prepare
It should create public/build/smui.css - Add the compiled css to public/index.html file:
<link rel='stylesheet' href='/build/smui.css'>
- Add Material Fonts to public/index.html
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>
<!-- Roboto -->
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700"
/>
<!-- Roboto Mono -->
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto+Mono"
/>
Search This Blog
Setup Svelte Material UI
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment