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

design tokens #304

Merged
merged 35 commits into from
May 22, 2022
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
18477c1
design tokens
romainmenke Mar 14, 2022
83bf59b
wip
romainmenke Mar 15, 2022
38cc5dc
Merge remote-tracking branch 'origin/main' into design-tokens--affect…
romainmenke Mar 20, 2022
a355c8f
Merge remote-tracking branch 'origin/main' into design-tokens--try-sp…
romainmenke Mar 26, 2022
522c2a6
wip
romainmenke Mar 27, 2022
8488665
wip
romainmenke Mar 27, 2022
7fdc4e5
wip
romainmenke Mar 27, 2022
51f193b
wip
romainmenke Mar 27, 2022
f8bfa50
wip
romainmenke Mar 27, 2022
797b01d
wip
romainmenke Mar 27, 2022
8161941
feedback
romainmenke Mar 27, 2022
ffafaad
gather tokens first
romainmenke Mar 27, 2022
b2abffc
feedback
romainmenke Mar 27, 2022
c5a3f77
wip
romainmenke Mar 31, 2022
2ff810f
implement dereferencing
romainmenke Apr 3, 2022
e1daac4
error handling
romainmenke Apr 3, 2022
cb2b08f
typo
romainmenke Apr 21, 2022
732f60f
Merge remote-tracking branch 'origin/main' into design-tokens--affect…
romainmenke May 21, 2022
93e6e6a
design tokens : unit conversion (#388)
romainmenke May 21, 2022
42e317f
update docs
romainmenke May 21, 2022
6e00a6b
add syntax docs
romainmenke May 21, 2022
da16cd6
update docs
romainmenke May 21, 2022
93af0a3
better docs gen
romainmenke May 21, 2022
4c16724
cleanup
romainmenke May 21, 2022
962fa08
more docs
romainmenke May 21, 2022
f89199e
more docs
romainmenke May 21, 2022
ead7d8c
cleanup
romainmenke May 21, 2022
368ce4a
improve the typing
romainmenke May 22, 2022
d13fe38
more examples
romainmenke May 22, 2022
5581e0b
stricter value and plugin option handling
romainmenke May 22, 2022
786cd9b
more docs
romainmenke May 22, 2022
ee6e138
fix
romainmenke May 22, 2022
bd714e5
document VSCode extension
romainmenke May 22, 2022
bfa3d99
clarify multiple when
romainmenke May 22, 2022
215b945
cleanup
romainmenke May 22, 2022
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
18 changes: 13 additions & 5 deletions .github/bin/generate-docs/readme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ installDoc = installDoc.replace(`<!-- Available Variables: -->
// Insert "Header" section
installDoc = installDoc.replace('<header>', `# <humanReadableName> [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]

[<img alt="npm version" src="https://img.shields.io/npm/v/<packageName>.svg" height="20">][npm-url]
[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/<cssdbId>.svg" height="20">][css-url]
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]`);
` + `[<img alt="npm version" src="https://img.shields.io/npm/v/<packageName>.svg" height="20">][npm-url] ` +
`${
packageJSONInfo.csstools?.cssdbId ?
`[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/<cssdbId>.svg" height="20">][css-url] ` :
''
}` +
`[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] ` +
`[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]`);

// Insert "Usage" section
installDoc = installDoc.replace('<usage>', `## Usage
Expand Down Expand Up @@ -62,7 +66,11 @@ instructions for:

// Insert "Link List" section
installDoc = installDoc.replace('<link-list>', `[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[css-url]: https://cssdb.org/#<cssdbId>
${
packageJSONInfo.csstools?.cssdbId ?
`[css-url]: https://cssdb.org/#<cssdbId>` :
''
}
[discord]: https://discord.gg/bUadyRwkJS
[npm-url]: https://www.npmjs.com/package/<packageName>

Expand Down
46 changes: 46 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions plugins/postcss-base-plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# PostCSS Base Plugin [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]

[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-base-plugin.svg" height="20">][npm-url]
[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/TODO.svg" height="20">][css-url]
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-base-plugin.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/TODO.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]

[PostCSS Base Plugin] lets easily create new plugins following some [CSS Specification].
[PostCSS Base Plugin] lets you easily create new plugins following some [CSS Specification].

```pcss
.foo {
Expand Down
2 changes: 1 addition & 1 deletion plugins/postcss-base-plugin/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<header>

[<humanReadableName>] lets easily create new plugins following some [CSS Specification].
[<humanReadableName>] lets you easily create new plugins following some [CSS Specification].

```pcss
<example.css>
Expand Down
5 changes: 1 addition & 4 deletions plugins/postcss-cascade-layers/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# PostCSS Cascade Layers [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]

[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-cascade-layers.svg" height="20">][npm-url]
[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/cascade-layers.svg" height="20">][css-url]
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-cascade-layers.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/cascade-layers.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]

[PostCSS Cascade Layers] lets you use `@layer` following the [Cascade Layers Specification]. For more information on layers, checkout [A Complete Guide to CSS Cascade Layers] by Miriam Suzanne.

Expand Down
5 changes: 1 addition & 4 deletions plugins/postcss-color-function/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# PostCSS Color Function [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]

[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-color-function.svg" height="20">][npm-url]
[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/color-function.svg" height="20">][css-url]
[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-color-function.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/color-function.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]

[PostCSS Color Function] lets you use the `color` function in
CSS, following the [CSS Color] specification.
Expand Down
6 changes: 6 additions & 0 deletions plugins/postcss-design-tokens/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
package-lock.json
yarn.lock
*.result.css
*.result.css.map
dist/*
1 change: 1 addition & 0 deletions plugins/postcss-design-tokens/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.13.1
104 changes: 104 additions & 0 deletions plugins/postcss-design-tokens/.tape.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import postcssTape from '../../packages/postcss-tape/dist/index.mjs';
import plugin from '@csstools/postcss-design-tokens';
import postcssImport from 'postcss-import';

postcssTape(plugin)({
basic: {
message: "supports basic usage",
plugins: [
postcssImport(),
plugin()
]
},
'basic:rootFontSize-20': {
message: "supports basic usage with { unitsAndValues { rootFontSize: 20 } }",
plugins: [
postcssImport(),
plugin({
unitsAndValues: {
rootFontSize: 20
}
})
]
},
'basic:rootFontSize-NaN': {
message: "supports basic usage with { unitsAndValues { rootFontSize: NaN } }",
plugins: [
postcssImport(),
plugin({
unitsAndValues: {
rootFontSize: NaN
}
})
]
},
'basic:rootFontSize-invalid': {
message: "supports basic usage with { unitsAndValues { rootFontSize: invalid } }",
plugins: [
postcssImport(),
plugin({
unitsAndValues: {
rootFontSize: 'invalid'
}
})
]
},
'errors': {
message: "handles issues correctly",
options: {},
warnings: 4
},
'is': {
message: "supports basic usage with { is ['dark', 'tablet', 'branded-green'] }",
options: {
is: ['dark', 'tablet', 'branded-green']
}
},
'value-parsing-a': {
message: "supports value parsing (A)",
},
'value-parsing-b': {
message: "supports value parsing (B)",
},
'value-parsing-c': {
message: "supports value parsing (C)",
warnings: 2
},
'value-parsing-d': {
message: "supports value parsing (D)",
warnings: 2
},
'value-parsing-e': {
message: "supports value parsing (E)",
warnings: 2
},
'value-parsing-f': {
message: "supports value parsing (F)",
},
'value-parsing-g': {
message: "supports value parsing (G)",
warnings: 2
},
'examples/example': {
message: 'minimal example',
options: {},
},
'examples/example-conditional': {
message: 'minimal example with conditional imports : default',
options: {},
},
'examples/example-conditional:dark': {
message: 'minimal example with conditional imports : dark',
options: {
is: ['dark']
},
},
'examples/example:rootFontSize-20': {
message: "minimal example with { unitsAndValues { rootFontSize: 20 } }",
options: {
unitsAndValues: {
rootFontSize: 20
}
}
},
});
5 changes: 5 additions & 0 deletions plugins/postcss-design-tokens/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changes to PostCSS Design Tokens

### 1.0.0 (Unreleased)

- Initial version
Loading