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
{{ message }}
This repository was archived by the owner on Sep 26, 2022. It is now read-only.
If want a fast and basic setupthen only installing `svelte-materialify` should be fine.
25
+
If you want a fast and basic setup, without custom SCSS/SASS, then only installing `svelte-materialify` should be fine:
26
26
27
27
```shell
28
28
$ npm i svelte-materialify
29
29
```
30
30
31
-
And then in your svelte files, import the compiled module for sveltematerialify
31
+
In your svelte files, import the _compiled_ module `from 'svelte-materialify'`:
32
32
33
33
```html
34
34
<script>
35
-
// In a svelte file
36
35
// Import Everything
37
36
import*asSfrom'svelte-materialify';
38
-
// OR
39
-
import { Button } from'svelte-materialify';
37
+
// or...
40
38
// Import a single component
39
+
import { Button } from'svelte-materialify';
41
40
</script>
42
41
```
43
42
44
-
## Advanced Install
43
+
## Install with Custom Styles
45
44
46
-
If you want finer control over Svelte Materialify and installation you want to install all its peer dependencies.
45
+
If you want finer control over Svelte Materialify, install all its peer dependencies:
47
46
48
47
```shell
49
48
$ npm i -D svelte-materialify svelte-preprocess sass postcss
50
49
```
51
50
51
+
In your svelte files, import the _uncompiled_ module `from 'svelte-materialify/src'`:
52
+
52
53
```html
53
54
<script>
54
-
// In a svelte file
55
-
// Import Everything from svelte-materialify/src
55
+
// Import Everything
56
56
import*asSfrom'svelte-materialify/src';
57
-
// OR
58
-
import { Button } from'svelte-materialify/src';
57
+
// or...
59
58
// Import a single component
59
+
import { Button } from'svelte-materialify/src';
60
60
</script>
61
61
```
62
62
63
-
<Components.Alert type='info'>
63
+
Now create a **\_material-theme.scss** file. Let's put it in a folder called **theme**.
64
+
Include the folder path in the `sveltePreprocess` function in your **rollup.config.js**:
64
65
65
-
Now _you_ can also use SCSS and SASS styles in your own components. Learn more about [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess/blob/master/docs/usage.md).
66
-
67
-
</Components.Alert>
68
-
69
-
Then create a **\_material-theme.scss** file and place it in any folder, lets put it in a folder called **theme**. Then include the path in the preprocess function in your **rollup.config.js** (likewise follow the same in webpack but for svelte-loader).
66
+
```js
67
+
svelte({
68
+
preprocess:sveltePreprocess({
69
+
scss: {
70
+
includePaths: ['theme'],
71
+
},
72
+
}),
73
+
...
74
+
```
70
75
71
-
Now add a **svelte.config.js**to add to the root of the project to provide better intellisense.
76
+
For better intellisense, you can instead create a **svelte.config.js** and add it to the root of the project:
0 commit comments