Skip to content

Commit

Permalink
Document styles
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenTeaCake committed Apr 10, 2024
1 parent 7088574 commit d168346
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/components/switch/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ Here is the basic usage example for `gtc-switch`:
| ----------- | ------------------------------------------------------------------------------------------------------------- | ---------------------- |
| `gtcChange` | Is called when the value has changed. Event name is prefixed not to be confused/conflict with the native one. | `CustomEvent<boolean>` |

## CSS Custom Properties

| Name | Description |
| ----------------------------- | -------------------------------- |
| `--background-color-checked` | The background color if checked |
| `--background-color-default` | The background color by default |
| `--background-color-disabled` | The background color if disabled |
| `--highlight-color-default` | The highlight color by default |
| `--marker-color-default` | The marker color by default |
| `--marker-color-disabled` | The marker color if disabled |

---

_Built with [StencilJS](https://stenciljs.com/)_
20 changes: 18 additions & 2 deletions src/components/switch/switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,29 @@ $marker-size: 16px;
$spacing: calc(($switch-height - $marker-size) / 2);

:host {
/**
* @prop --background-color-default: The background color by default
*/
--background-color-default: #c7c7c7;
/**
* @prop --background-color-checked: The background color if checked
*/
--background-color-checked: #398368;
/**
* @prop --background-color-disabled: The background color if disabled
*/
--background-color-disabled: #e3e3e3;

/**
* @prop --highlight-color-default: The highlight color by default
*/
--highlight-color-default: #112c9f;

/**
* @prop --marker-color-default: The marker color by default
*/
--marker-color-default: #ffffff;
/**
* @prop --marker-color-disabled: The marker color if disabled
*/
--marker-color-disabled: #c7c7c7;

display: inline-block;
Expand Down

0 comments on commit d168346

Please sign in to comment.