-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(style): theming and foundation styles
- Loading branch information
Showing
7 changed files
with
133 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Foundation | ||
|
||
The library also provides styles for SGDS foundation to help users style your application wholistically with SGDS. | ||
The styles help to override the default browser's native styles with SGDS. | ||
|
||
These files are distributed as CSS files and are optional to import. These styles do not affect the web components and are not required in the web component. | ||
However, do note that the CSS styles the light dom and may causes clash of styles if there are other styling libraries (for example, tailwind, bootstrap, sgds v1 and v2 css, etc.) used in your app. | ||
|
||
Foundation aspects of SGDS includes: | ||
- typography, | ||
- body `<body>` | ||
- paragraphs `<p>` | ||
- labels `<label>` | ||
- anchor `<a>` | ||
- captions `<caption>` | ||
- headers `<h1>, <h2>, <h3>, <h4>, <h5>, <h6>` | ||
- list `<ol>, <ul>, <li>` | ||
- grid system <sgds-badge show>work in progress</sgds-badge> | ||
|
||
## Import | ||
|
||
The CSS styles are dependent on the css variable tokens. Import the `themes/day.css` file first before importing the css files. If you required night mode, import `themes/night.css` as well. | ||
The colors assigned to elements and class selectors will switch depending on day or night mode. | ||
|
||
<strong>JS imports</strong> | ||
|
||
```js | ||
import "@govtechsg/sgds-web-component/themes/day.css" | ||
//optional: if you are doing night mode | ||
import "@govtechsg/sgds-web-component/themes/night.css" | ||
import "@govtechsg/sgds-web-component/css/sgds.css" | ||
|
||
``` | ||
|
||
<strong>CSS imports</strong> | ||
|
||
```css | ||
@import "@govtechsg/sgds-web-component/themes/day.css"; | ||
/** optional: if you are doing night mode */ | ||
@import "@govtechsg/sgds-web-component/themes/night.css"; | ||
@import "@govtechsg/sgds-web-component/css/sgds.css"; | ||
``` | ||
|
||
### Cherry pick the styles | ||
|
||
`css/sgds.css` contains all the stylings found in the folder `css`. You can also choose to cherry pick the styles you required. For example, `label.css` | ||
|
||
<strong>JS imports</strong> | ||
|
||
```js | ||
import "@govtechsg/sgds-web-component/themes/day.css" | ||
//optional: if you are doing night mode | ||
import "@govtechsg/sgds-web-component/themes/night.css" | ||
import "@govtechsg/sgds-web-component/css/label.css" | ||
|
||
``` | ||
|
||
<strong>CSS imports</strong> | ||
|
||
```css | ||
@import "@govtechsg/sgds-web-component/themes/day.css"; | ||
/** optional: if you are doing night mode */ | ||
@import "@govtechsg/sgds-web-component/themes/night.css"; | ||
@import "@govtechsg/sgds-web-component/css/label.css"; | ||
``` | ||
|
||
## Source files | ||
|
||
<iframe | ||
src='https://gist.github.com/clukhei/a31bfc0ea0c2b87d950b125f92835a76.pibb' | ||
style="width: 100%; height: 1000px; border: 0;" | ||
> | ||
</iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Meta, Markdown } from "@storybook/blocks"; | ||
import FoundationalStyles from '../../../docs/FoundationalStyles.md?raw'; | ||
|
||
<Meta title="Style/Foundation" /> | ||
|
||
<Markdown>{FoundationalStyles}</Markdown> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Meta, Markdown } from "@storybook/blocks"; | ||
import Theming from '../../../docs/Theming.md?raw'; | ||
|
||
<Meta title="Style/Theming" /> | ||
|
||
<Markdown>{Theming}</Markdown> |
This file was deleted.
Oops, something went wrong.