Smelte


Demo
Smelte is a UI framework built on top of Svelte and Tailwind CSS using Material Design spec (hence the name).
It comes with many components and utility functions making it easy to build beautiful responsive layouts while keeping
bundle size and performance at check all thanks to Svelte.
Installation
To get you started you need to add Smelte to your dependencies with your favorite package manager
$ npm install smelte or yarn add smelte
Then you need to add Smelte Rollup plugin (Webpack is on its way).
const smelte = require("smelte/rollup-plugin-smelte");
plugins = [
...your plugins,
smelte({
purge: production,
output: "public/global.css",
postcss: [],
whitelist: [],
whitelistPatterns: [],
tailwind: {
theme: {
extend: {
spacing: {
72: "18rem",
84: "21rem",
96: "24rem"
}
}
},
colors: {
primary: "#b027b0",
secondary: "#009688",
error: "#f44336",
success: "#4caf50",
alert: "#ff9800",
blue: "#2196f3",
dark: "#212121"
},
darkMode: true,
},
}),
]
Then you should add Tailwind utilites CSS in your app component.
import "smelte/src/tailwind.css";
You might also need to include material icons in your template's if you use any:
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
Or ship them along with Roboto if you would like to use default material font
<link
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500|Material+Icons&display=swap"
rel="stylesheet"
/>
And you're good to go and have all the Tailwind CSS power all to yourself!
For treeshaking to work it is recommended to import each component on its own like this:
import Button from "smelte/src/components/Button";
import Treeview from "smelte/src/components/Treeview";
Components
Features