You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(From here there are [different instructions](INSTALL.md#integration-for-sapper) for Sapper.)
17
+
You can also [use SMUI in the Svelte REPL](REPL.md).
18
18
19
-
You also need [Dart Sass](https://www.npmjs.com/package/sass). (`node-sass` is deprecated, and SMUI uses features that it doesn't support.)
19
+
## Importing Components
20
+
21
+
You will always import Svelte components from the individual packages.
22
+
23
+
This method will include Sass files as well. Use this for the Advanced Styling Method.
24
+
25
+
```svelte
26
+
<script>
27
+
import Button from '@smui/button';
28
+
</script>
29
+
```
30
+
31
+
And this method will only include the components. Use this for the Easy Styling Method.
32
+
33
+
```svelte
34
+
<script>
35
+
import Button from '@smui/button/bare';
36
+
</script>
37
+
```
38
+
39
+
Notice that adding "/bare" to your import path means no Sass files will be imported. Use this method if you use the Easy Styling Method or the Default Theme with "bare.css".
40
+
41
+
## Material Fonts
42
+
43
+
If you want the Material Icon, Roboto, and Roboto Mono fonts, be sure to include these stylesheets (or include them from a package).
If you don't care about theming, you can use the prebuilt "bare.css" file from the "svelte-material-ui" package. You can also use the "bare.css" files from the individual packages if you don't use many components and want smaller file sizes.
Remember to import components with the "/bare" endpoint. If you want to theme SMUI, follow the next section instead.
76
+
77
+
# Using a Custom Theme
78
+
79
+
You will need [Dart Sass](https://www.npmjs.com/package/sass). (`node-sass` is deprecated, and SMUI uses features that it doesn't support.)
20
80
21
81
```sh
22
82
npm install --save-dev sass
23
83
```
24
84
85
+
You must have a `_smui-theme.scss` file in one of your Sass include paths to compile the Sass. That is where you [set the theme variables](THEMING.md). You can create a "theme" directory in your source directory, and create the file there.
86
+
87
+
```sh
88
+
mkdir src/theme
89
+
touch src/theme/_smui-theme.scss
90
+
```
91
+
92
+
## Easy Styling Method
93
+
94
+
The Easy Styling Method builds styles for all of the SMUI components with your theme into CSS that you can include on your page easily.
95
+
96
+
Be sure to install the `svelte-material-ui` package.
97
+
98
+
```sh
99
+
npm install --save-dev svelte-material-ui
100
+
```
101
+
102
+
In your package.json file, add this script in the "scripts" section, adjusting the destination file as desired.
If you're not using a bunbler, you can import components from the `bare.js` files, which don't include any styling. Then you can use the `bare.css` files which are precompiled (with the default theme) and packaged with components. Then you can skip the next step, but your [theming options](THEMING.md#theming-the-bare-css) are limited.
38
148
39
-
## Setting up Sass
40
-
41
-
You must have a `_smui-theme.scss` file in one of your Sass include paths to compile the Sass. That is where you [set the theme variables](THEMING.md). If it's empty, it will use the default theme values from MDC-Web. You can create a "theme" directory in your source directory, and create the file there.
42
-
43
-
```sh
44
-
mkdir src/theme
45
-
touch src/theme/_smui-theme.scss
46
-
```
149
+
### Setting up Sass
47
150
48
151
In your bundler's config, you'll need to tell your bundler to compile Sass files.
49
152
@@ -111,183 +214,3 @@ module.exports = {
111
214
},
112
215
};
113
216
```
114
-
115
-
## Material Fonts
116
-
117
-
If you want the Material Icon, Roboto, and Roboto Mono fonts, be sure to include these stylesheets (or include them from a package).
You can also [set up a dark mode](THEMING.md#dark-mode) in your Sapper app.
247
-
248
-
# Using SMUI in the Svelte REPL
249
-
250
-
Check out an [example REPL](https://svelte.dev/repl/aa857c3bb5eb478cbe6b1fd6c6da522a?version=3.37.0).
251
-
252
-
SMUI components provide "bare.css" and "bare.js" files to use in the REPL. In a `<svelte:head>` section, load from a CDN like UNPKG the CSS files for the fonts, for Material typography, and for each SMUI component you are using:
Check out an [example REPL](https://svelte.dev/repl/aa857c3bb5eb478cbe6b1fd6c6da522a?version=3.37.0).
4
+
5
+
SMUI components provide "bare.css" and "bare.js" files to use in the REPL. In a `<svelte:head>` section, load from a CDN like UNPKG the CSS files for the fonts, for Material typography, and for SMUI:
0 commit comments