From 93562c12410f024230da84602b7f0ec56076c7d9 Mon Sep 17 00:00:00 2001 From: Eric Y Liu Date: Fri, 16 Jul 2021 08:28:44 -0700 Subject: [PATCH] docs: add styling instructions --- README.md | 2 +- docs/src/pages/index.svelte | 94 ++++++++++++++++++++++++++++++++++--- 2 files changed, 89 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 278dfde9..72fba78e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The Carbon Svelte portfolio also includes: - **[Carbon Icons Svelte](https://github.com/IBM/carbon-icons-svelte)**: 6000+ Carbon icons as Svelte components - **[Carbon Pictograms Svelte](https://github.com/IBM/carbon-pictograms-svelte)**: 700+ Carbon pictograms as Svelte components -- **[Carbon Charts Svelte](https://github.com/carbon-design-system/carbon-charts/tree/master/packages/svelte)**: 20 chart types, powered by d3 +- **[Carbon Charts Svelte](https://github.com/carbon-design-system/carbon-charts/tree/master/packages/svelte)**: 20+ charts, powered by d3 ## [Documentation](http://ibm.biz/carbon-svelte) diff --git a/docs/src/pages/index.svelte b/docs/src/pages/index.svelte index 31365bbe..c2648c82 100644 --- a/docs/src/pages/index.svelte +++ b/docs/src/pages/index.svelte @@ -6,8 +6,15 @@ Column, CodeSnippet, Link, + Tabs, + Tab, + TabContent, + OutboundLink, + RadioButtonGroup, + RadioButton, } from "carbon-components-svelte"; import TileCard from "../components/TileCard.svelte"; + import { theme } from "../store"; import { metatags } from "@sveltech/routify"; metatags.title = "Carbon Components Svelte"; @@ -16,6 +23,13 @@ const installYarn = "yarn add -D carbon-components-svelte"; const installNpm = "npm i -D carbon-components-svelte"; + const themes = { + white: "White", + g10: "Gray 10", + g80: "Gray 80", + g90: "Gray 90", + g100: "Gray 100", + }; @@ -50,23 +64,85 @@ -

Install

-

Installing with yarn:

+

Installation

+

+ Install carbon-components-svelte as a development dependency + in your project. +

+

Using Yarn:

-

Using npm:

+

Using NPM:

+ + +

Styling

+

+ Before importing components, you will need to first apply Carbon + component styles. The Carbon Design System supports five themes (2 + light, 3 dark). +

+ + {#each ["white", "g10", "g80", "g90", "g100"] as value} + + {/each} + +
+
+ + + + + + + +
+ +

+ This library ships with six pre-compiled CSS StyleSheets built + from + + carbon-components + . +

+
+ +

+ An alternative to loading styles is to link an external + StyleSheet from a Content Delivery Networks (CDN) like + + unpkg.com + . +

+

+ This is best suited for rapid prototyping or if your set-up does + not use a CSS loader. +

+
+ Content 3 +
+
+
+
+

Portfolio

- The broader Carbon Svelte effort includes libraries for icons, - pictograms, and data visualization. + The Carbon Svelte portfolio includes packages for icons, pictograms, + and data visualization.

@@ -106,7 +182,7 @@ @@ -124,3 +200,9 @@
+ +