Skip to content

Commit

Permalink
feat: refactor color token structure with tier 3 tokens #82
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 authored and jason-capsule42 committed Jul 8, 2024
1 parent 7361d80 commit 70e73b1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 5 deletions.
19 changes: 18 additions & 1 deletion demo/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,21 @@ The `componentData` attribute is used to provide the table TD content for the ta

The `nowrap` attribute, when applied, will prevent table content from word wrapping, i.e. all text content will be on a single line.

</auro-accordion>
</auro-accordion>

## Theme Support

The component may be restyled using the following code sample and changing the values of the following token(s).

<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../../src/tokens.scss) -->
<!-- The below code snippet is automatically added from ./../../src/tokens.scss -->

```scss
@import "./../node_modules/@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables";

:host {
--ds-auro-table-alt-row-container-color: var(--ds-color-container-secondary-default, #{$ds-color-container-secondary-default});
--ds-auro-table-border-color: var(--ds-color-border-divider-default, #{$ds-color-border-divider-default});
}
```
<!-- AURO-GENERATED-CONTENT:END -->
7 changes: 7 additions & 0 deletions docs/partials/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ The `componentData` attribute is used to provide the table TD content for the ta
The `nowrap` attribute, when applied, will prevent table content from word wrapping, i.e. all text content will be on a single line.

</auro-accordion>

## Theme Support

The component may be restyled using the following code sample and changing the values of the following token(s).

<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../../src/tokens.scss) -->
<!-- AURO-GENERATED-CONTENT:END -->
7 changes: 5 additions & 2 deletions src/auro-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import { LitElement, html } from "lit-element";
import { classMap } from 'lit/directives/class-map.js';

// Import touch detection lib
import styleCss from "./style-css.js";
import tokensCss from "./tokens-css.js";

// build the component class
export class AuroTable extends LitElement {
Expand All @@ -28,7 +28,10 @@ export class AuroTable extends LitElement {
}

static get styles() {
return [styleCss];
return [
styleCss,
tokensCss
];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ table {
}

thead {
border-bottom: 1px solid var(--ds-color-brand-gray-200, $ds-color-brand-gray-200);
border-bottom: 1px solid var(--ds-auro-table-border-color);
border-collapse: collapse;
}

tr {
&:nth-child(even) {
background-color: var(--ds-color-brand-gray-100, $ds-color-brand-gray-100);
background-color: var(--ds-auro-table-alt-row-container-color);
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/tokens.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import "./../node_modules/@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables";

:host {
--ds-auro-table-alt-row-container-color: var(--ds-color-container-secondary-default, #{$ds-color-container-secondary-default});
--ds-auro-table-border-color: var(--ds-color-border-divider-default, #{$ds-color-border-divider-default});
}

0 comments on commit 70e73b1

Please sign in to comment.