Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

Commit 15a9636

Browse files
docs: better installation advice
Signed-off-by: Florian-Schoenherr <[email protected]>
1 parent b3d7d64 commit 15a9636

File tree

1 file changed

+45
-24
lines changed

1 file changed

+45
-24
lines changed

packages/docs/src/routes/getting-started/installation.md

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,65 +10,70 @@ related:
1010

1111
# Installation
1212

13-
Get Started with Svelte Materialify, the best material UI component library for Svelte
13+
Get Started with Svelte Materialify, the best material UI component library for Svelte.
1414

15-
If you want to try out svelte materialify and tinker with it, visit the [repl playground](https://svelte.dev/repl/2c55788d8ffd4458bfe9bcb5f58956db).
15+
If you want to try out svelte materialify and tinker with it, visit the [REPL playground](https://svelte.dev/repl/2c55788d8ffd4458bfe9bcb5f58956db).
1616

17-
We can also **optionally** add [focus-visible](https://github.com/WICG/focus-visible), if you want keyboard focused styles.
17+
You can also **optionally** add [focus-visible](https://github.com/WICG/focus-visible), if you want keyboard focused styles.
1818

1919
```html
2020
<script src="https://unpkg.com/focus-visible@latest/dist/focus-visible.min.js"></script>
2121
```
2222

23-
## Minimal Install
23+
## Install with Default Styles
2424

25-
If want a fast and basic setup then 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:
2626

2727
```shell
2828
$ npm i svelte-materialify
2929
```
3030

31-
And then in your svelte files, import the compiled module for svelte materialify
31+
In your svelte files, import the _compiled_ module `from 'svelte-materialify'`:
3232

3333
```html
3434
<script>
35-
// In a svelte file
3635
// Import Everything
3736
import * as S from 'svelte-materialify';
38-
// OR
39-
import { Button } from 'svelte-materialify';
37+
// or...
4038
// Import a single component
39+
import { Button } from 'svelte-materialify';
4140
</script>
4241
```
4342

44-
## Advanced Install
43+
## Install with Custom Styles
4544

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:
4746

4847
```shell
4948
$ npm i -D svelte-materialify svelte-preprocess sass postcss
5049
```
5150

51+
In your svelte files, import the _uncompiled_ module `from 'svelte-materialify/src'`:
52+
5253
```html
5354
<script>
54-
// In a svelte file
55-
// Import Everything from svelte-materialify/src
55+
// Import Everything
5656
import * as S from 'svelte-materialify/src';
57-
// OR
58-
import { Button } from 'svelte-materialify/src';
57+
// or...
5958
// Import a single component
59+
import { Button } from 'svelte-materialify/src';
6060
</script>
6161
```
6262

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**:
6465

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+
```
7075
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:
7277
7378
```js
7479
const sveltePreprocess = require('svelte-preprocess');
@@ -81,7 +86,7 @@ module.exports = {
8186
}),
8287
};
8388
```
84-
89+
Now you can import this file from your main config file, like shown below:
8590
### Rollup
8691
8792
```js
@@ -126,7 +131,7 @@ Learn how to integrate svelte materialify with existing frameworks.
126131
127132
#### Sapper
128133
129-
Add preprocessor for both client and server bundles.
134+
Add the preprocessor for both client and server bundles:
130135
131136
```js
132137
const { preprocess } = require('./svelte.config');
@@ -150,4 +155,20 @@ export default {
150155
};
151156
```
152157
158+
#### Sveltekit
159+
160+
See: https://github.com/TheComputerM/sveltekit-materialify
153161
## Templates
162+
163+
Basic setup done for you:
164+
165+
### Sveltekit
166+
167+
```
168+
npx degit TheComputerM/sveltekit-materialify my-sveltematerialify-project
169+
170+
cd my-svelte-project
171+
172+
npm install
173+
npm run dev
174+
```

0 commit comments

Comments
 (0)