Skip to content

Commit c8755d4

Browse files
committed
feat: remove styled endpoints and update readme and installation docs
BREAKING CHANGE: No more styled endpoints, so the advanced styling method now requires that you import the Sass yourself.
1 parent 3619881 commit c8755d4

File tree

63 files changed

+67
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+67
-484
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ cd packages/site
3030
npm run dev
3131
```
3232

33-
Once that starts, you should be able to see the site at http://localhost:3000/ and the site will refresh automatically when you make a change.
33+
Once that starts, you should be able to see the site at http://localhost:3000/ and the site will refresh automatically when you make a change. You will have to go into whichever package you're working on and run `npm run build` before you'll see the change.
3434

3535
## Commiting Changes
3636

INSTALL.md

+4-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Installation
22

3-
To get started, you'll need the [Svelte Preprocess](https://github.com/sveltejs/svelte-preprocess) package installed and working, then install the SMUI packages.
3+
To get started, install the SMUI packages you need.
44

55
```sh
66
npm install --save-dev @smui/button
@@ -16,24 +16,12 @@ You can also [use SMUI in the Svelte REPL](/REPL.md).
1616

1717
You will always import Svelte components from the individual packages.
1818

19-
This method will only include the JavaScript. Use this for the Default Theme or the [Easy Styling Method](/SASS.md#easy-styling-method).
20-
2119
```svelte
2220
<script>
2321
import Button from '@smui/button';
2422
</script>
2523
```
2624

27-
This method will include Sass files as well. Use this for the [Advanced Styling Method](/SASS.md#advanced-styling-method).
28-
29-
```svelte
30-
<script>
31-
import Button from '@smui/button/styled';
32-
</script>
33-
```
34-
35-
Notice that adding "/styled" to your import path means Sass files will be imported.
36-
3725
## Material Fonts
3826

3927
If you want the Material Icon, Roboto, and Roboto Mono fonts, be sure to include these stylesheets (or include them from a package).
@@ -68,20 +56,20 @@ npm install --save svelte-material-ui
6856
<link rel="stylesheet" href="node_modules/svelte-material-ui/bare.css" />
6957
```
7058

71-
If that's not working (probably because your dependencies aren't copied to your build folder), you can also use a CDN. Just be sure you update the version here when you update to a new version of SMUI. (This is already an outdated version, so update it now too.)
59+
If that's not working (probably because your dependencies aren't copied to your build folder), you can also use a CDN. Just be sure you update the version here when you update to a new version of SMUI. (This may already be an outdated version, so update it now too.)
7260

7361
```html
7462
<link
7563
rel="stylesheet"
76-
href="https://cdn.jsdelivr.net/npm/svelte-material-ui@4.0.0/bare.min.css"
64+
href="https://cdn.jsdelivr.net/npm/svelte-material-ui@6.0.0/bare.min.css"
7765
/>
7866
```
7967

8068
You can also use the "bare.css" files from the individual packages if you don't use many components and want smaller file sizes.
8169

8270
## Using a Custom Theme
8371

84-
Check out the [Sass instructions](/SASS.md) for setting up a custom theme.
72+
Check out the [theming instructions](/THEMING.md) for setting up a custom theme.
8573

8674
## SvelteKit
8775

MIGRATING.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ https://github.com/material-components/material-components-web/blob/master/CHANG
1111

1212
- For `@smui/common`, `@smui/textfield`, `@smui/select`, and `@smui/snackbar`, if you ever import something like `@smui/snackbar/kitchen/index` or `@smui/textfield/helper-text/index`, you need to remove the `/index` from the end of that import. (This does not apply to Sass imports.)
1313
- Here's a regex you can use in VS Code to search for these: @smui/(common|textfield|select|snackbar)/[\w-]+/index
14+
- The '/styled' import endpoints have been removed. You will need to import the '/index' endpoint from Sass yourself if you were using the Advanced Styling Method.
1415

1516
## Changes
1617

README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Here are some features you should know about:
1616
- You can add arbitrary attributes to all of the components and many of the elements within them.
1717
- You can add actions to the components with `use={[Action1, [Action2, action2Props], Action3]}`.
1818
- You can add props to lower components and elements with "$" props, like `input$maxlength="15"`.
19-
- **All** events are forwarded. This includes DOM events, MDC events, and custom events.
19+
- **All** events are forwarded. This includes DOM events, SMUI events, MDC events, and custom events.
2020
- You can add event modifiers with the `on:click$preventDefault$capture={handler}` syntax.
2121
- If you use Svelte's native `on:click|preventDefault={handler}` syntax, it will not compile. You have to use "$" instead of "|". (The extra S inside the | stands for SMUI.)
2222
- Supported modifiers are:
@@ -31,26 +31,24 @@ Here are some features you should know about:
3131

3232
# Installation
3333

34-
To get started, check out the [installation docs](INSTALL.md) or the [SvelteKit docs](SVELTEKIT.md). You'll also need to install the [Svelte preprocessor](https://github.com/sveltejs/svelte-preprocess).
34+
To get started, check out the [installation docs](INSTALL.md) or the [SvelteKit docs](SVELTEKIT.md).
3535

3636
# Migration
3737

3838
Upgrading from an old version? Be sure to read the [migration doc](MIGRATING.md).
3939

40-
Upgrading from v2? There are **lots** of changes listed in the [upgrade instructions](MIGRATING.md#smui-2---smui-3).
40+
Upgrading from v5? If you're still using the advanced styling method, it's really time to switch to the easy styling method. '/styled' endpoints are no longer provided. Check out the [upgrade instructions](MIGRATING.md#smui-5---smui-6).
41+
42+
Upgrading from v4? SMUI v5 requires the [TypeScript preprocessor](https://github.com/sveltejs/svelte-preprocess). SMUI v6 does not though, so if you upgrade straight to v6, don't worry. Check out the [upgrade instructions](MIGRATING.md#smui-4---smui-5).
4143

4244
Upgrading from v3? SMUI's styling method has been simplified. Check out the [upgrade instructions](MIGRATING.md#smui-3---smui-4).
4345

44-
Upgrading from v4? SMUI now requires the [TypeScript preprocessor](https://github.com/sveltejs/svelte-preprocess). Check out the [upgrade instructions](MIGRATING.md#smui-4---smui-5).
46+
Upgrading from v2? There are **lots** of changes listed in the [upgrade instructions](MIGRATING.md#smui-2---smui-3).
4547

4648
# Need Help?
4749

4850
If you need help using SMUI, join the new [Discord server](https://discord.gg/aFzmkrmg9P).
4951

50-
# Get Typed!
51-
52-
I'm super typed to announce, SMUI 5 introduces TypeScript support! All the benefits of TypeScript, all the beauty of SMUI!
53-
5452
# Components
5553

5654
Click a component/package below to go to the documentation. (Note that this documentation is a work in progress. The demo code should be your main source of truth for how something works.)

REPL.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Using SMUI in the Svelte REPL
22

3-
Note: The latest version of SMUI doesn't work in the REPL, because the REPL doesn't support TypeScript.
4-
53
Check out an [example REPL](https://svelte.dev/repl/aa857c3bb5eb478cbe6b1fd6c6da522a?version=3.37.0).
64

75
SMUI components provide "bare.css" 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:
@@ -21,7 +19,7 @@ SMUI components provide "bare.css" files to use in the REPL. In a `<svelte:head>
2119
<!-- Material Typography -->
2220
<link
2321
rel="stylesheet"
24-
href="https://unpkg.com/@material/typography@11.0.0/dist/mdc.typography.css"
22+
href="https://unpkg.com/@material/typography@13.0.0/dist/mdc.typography.css"
2523
/>
2624
2725
<!-- SMUI -->

SAPPER.md

-157
This file was deleted.

0 commit comments

Comments
 (0)