Skip to content

Commit

Permalink
feat: table tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Aug 21, 2021
1 parent 7de328c commit cfa36d4
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
6 changes: 6 additions & 0 deletions components/table/bem.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

.utrecht-table {
border-collapse: collapse;
border-color: var(--utrecht-table-border-color, 0);
border-style: solid;
border-width: var(--utrecht-table-border-width, 0);
font-family: var(--utrecht-table-font-family, var(--utrecht-document-font-family));
font-size: var(--utrecht-table-font-size, inherit);
width: 100%;
}
.utrecht-table--distanced {
Expand Down Expand Up @@ -41,6 +46,7 @@

.utrecht-table__heading {
color: var(--utrecht-table-heading-color);
font-size: var(--utrecht-table-heading-font-size);
font-weight: var(--utrecht-table-heading-font-weight);
text-transform: var(--utrecht-table-heading-text-transform);
}
Expand Down
24 changes: 24 additions & 0 deletions components/table/block.style-dictionary.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
{
"utrecht": {
"table": {
"border-color": {
"css": {
"syntax": "<color>",
"inherits": true
}
},
"border-width": {
"css": {
"syntax": "<length>",
"inherits": true
}
},
"font-family": {
"css": {
"syntax": "*",
"inherits": true
}
},
"font-size": {
"css": {
"syntax": "<length>",
"inherits": true
}
},
"margin-block-end": {
"css": {
"syntax": "<length>",
Expand Down
6 changes: 6 additions & 0 deletions components/table/element.style-dictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
}
},
"heading": {
"font-size": {
"css": {
"syntax": "<length>",
"inherits": true
}
},
"font-weight": {
"css": {
"syntax": "<number>",
Expand Down
13 changes: 12 additions & 1 deletion components/table/html.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { Meta, Story, Canvas, ArgsTable } from "@storybook/addon-docs";
import clsx from "clsx";
import "./html.scss";

export const defaultArgs = {
alternateRowColor: false,
};

<!--
Source of table:
https://www.utrecht.nl/wonen-en-leven/parkeren/ervaart-u-parkeeroverlast/spinozaplantsoen-invoeren-betaald-parkeren/
Expand Down Expand Up @@ -66,7 +70,14 @@ export const ExampleTable = ({ alternateRowColor = false }) =>
# Table

<Canvas>
<Story name="Table">{ExampleTable.bind({})}</Story>
<Story
name="Table"
args={{
...defaultArgs,
}}
>
{ExampleTable.bind({})}
</Story>
</Canvas>

<ArgsTable story="Table" />

0 comments on commit cfa36d4

Please sign in to comment.