mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
docs: update README, links (#1509)
* docs: add note on using `optimizeImports` with `svelte-preprocess` (Closes #1500) * docs: point link to SASS guide to v10 (#1489) * docs: remove note on minimum Svelte version as it's been almost half a year since 3.48 was released
This commit is contained in:
parent
affeb2e2f4
commit
59c02c9a92
2 changed files with 17 additions and 12 deletions
19
README.md
19
README.md
|
@ -31,8 +31,6 @@ Other forms of documentation are auto-generated:
|
||||||
|
|
||||||
Install `carbon-components-svelte` as a development dependency.
|
Install `carbon-components-svelte` as a development dependency.
|
||||||
|
|
||||||
A minimum Svelte version of 3.48.0 is required to use this library.
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Yarn
|
# Yarn
|
||||||
yarn add -D carbon-components-svelte
|
yarn add -D carbon-components-svelte
|
||||||
|
@ -200,7 +198,7 @@ The preprocessor optimizes imports from the following packages:
|
||||||
- [carbon-icons-svelte](https://github.com/carbon-design-system/carbon-icons-svelte)
|
- [carbon-icons-svelte](https://github.com/carbon-design-system/carbon-icons-svelte)
|
||||||
- [carbon-pictograms-svelte](https://github.com/carbon-design-system/carbon-pictograms-svelte)
|
- [carbon-pictograms-svelte](https://github.com/carbon-design-system/carbon-pictograms-svelte)
|
||||||
|
|
||||||
**Example**
|
**Before & After**
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
- import { Button } from "carbon-components-svelte";
|
- import { Button } from "carbon-components-svelte";
|
||||||
|
@ -222,6 +220,21 @@ export default {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`svelte-preprocess` should be invoked before any preprocessor from `carbon-preprocess-svelte`.
|
||||||
|
|
||||||
|
```diff
|
||||||
|
// svelte.config.js
|
||||||
|
+ import sveltePreprocess from "svelte-preprocess";
|
||||||
|
import { optimizeImports } from "carbon-preprocess-svelte";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
preprocess: [
|
||||||
|
+ sveltePreprocess(),
|
||||||
|
optimizeImports()
|
||||||
|
],
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- [examples/rollup](examples/rollup/)
|
- [examples/rollup](examples/rollup/)
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
OutboundLink,
|
OutboundLink,
|
||||||
RadioButtonGroup,
|
RadioButtonGroup,
|
||||||
RadioButton,
|
RadioButton,
|
||||||
InlineNotification,
|
|
||||||
} from "carbon-components-svelte";
|
} from "carbon-components-svelte";
|
||||||
import TileCard from "../components/TileCard.svelte";
|
import TileCard from "../components/TileCard.svelte";
|
||||||
import { theme } from "../store";
|
import { theme } from "../store";
|
||||||
|
@ -92,13 +91,6 @@
|
||||||
<Row style="margin-bottom: var(--cds-layout-02)">
|
<Row style="margin-bottom: var(--cds-layout-02)">
|
||||||
<Column max="{10}" xlg="{10}">
|
<Column max="{10}" xlg="{10}">
|
||||||
<h2 style="margin-top: var(--cds-layout-02)">Installation</h2>
|
<h2 style="margin-top: var(--cds-layout-02)">Installation</h2>
|
||||||
<InlineNotification
|
|
||||||
style="max-width: calc(48rem - 1rem);"
|
|
||||||
kind="info"
|
|
||||||
subtitle="A minimum Svelte version of 3.48.0 is required to use this library."
|
|
||||||
lowContrast
|
|
||||||
hideCloseButton
|
|
||||||
/>
|
|
||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
<Row style="margin-bottom: var(--cds-layout-02)">
|
<Row style="margin-bottom: var(--cds-layout-02)">
|
||||||
|
@ -208,7 +200,7 @@
|
||||||
<OutboundLink
|
<OutboundLink
|
||||||
inline
|
inline
|
||||||
size="lg"
|
size="lg"
|
||||||
href="https://github.com/carbon-design-system/carbon/blob/main/docs/guides/sass.md"
|
href="https://github.com/carbon-design-system/carbon/blob/v10/docs/guides/sass.md"
|
||||||
>
|
>
|
||||||
official Carbon guide on SASS
|
official Carbon guide on SASS
|
||||||
</OutboundLink>
|
</OutboundLink>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue