Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8709 task: design tokens used to output styles and documentation (colours) #2

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
# Build/output files
.dist/
*.sass-cache*
/build
dist
/ssr
coverage
Expand Down
34 changes: 34 additions & 0 deletions .storybook/styles/_storybook-swatches.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.sb-table {
border-collapse: collapse;
width: 100%;

td,
th {
padding: var(--space-md);
text-align: left;
}

tbody tr:nth-child(odd) {
background-color: var(--colour-grey-05);
}
}

.sb-swatch {
align-items: center;
display: flex;
margin: 0;
}

.sb-swatch__colour {
border: 1px solid var(--colour-grey-20);
flex-shrink: 0;
height: calc(6 * var(--space-unit));
width: calc(6 * var(--space-unit));
}

.sb-swatch__name {
color: var(--colour-grey-60);
display: block;
font-size: var(--font-size-body-xs);
margin-left: var(--space-lg)
}
2 changes: 2 additions & 0 deletions .storybook/styles/storybook-app.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@import 'styles/core';
@import 'styles/theme';
@import 'styles/common';

@import './storybook-global';
@import './storybook-icons';
@import './storybook-swatches';
50 changes: 50 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"source": ["src/tokens/**/*.json"],
"platforms": {
"js": {
"transformGroup": "js",
"buildPath": "src/build/js/",
"files": [
{
"destination": "colours.js",
"format": "javascript/module-flat",
"options": {
"outputReferences": true
},
"filter": {
"attributes": {
"category": "colour"
}
}
},
{
"destination": "colours.d.ts",
"format": "typescript/es6-declarations",
"filter": {
"attributes": {
"category": "colour"
}
}
}
]
},
"css": {
"transformGroup": "css",
"buildPath": "src/build/css/",
"files": [
{
"destination": "colours.css",
"format": "css/variables",
"options": {
"outputReferences": true
},
"filter": {
"attributes": {
"category": "colour"
}
}
}
]
}
}
}
Loading