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

Update to w3c standard #230

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@ This format is based on the current spec draft of the [Design Tokens W3C Communi
It is much simpler and makes it easier to define custom transformers for amazon style dictionary.

Every token follows this structure ([learn more](https://github.com/lukasoppermann/design-tokens/blob/main/types/standardToken.d.ts)):
```js
type StandardTokenInterface = {
name: string,
$description?: string,
$value: StandardTokenValueType | StandardCompositeTokenValueType,
$type: StandardTokenTypes,
$extensions?: StandardTokenExtensionsInterface
}
```

#### Standard deprecated (previous W3C draft)
The standard format has been updated. To make migration easier, the old version was moved into standard deprecated.
This version will be removed in the future, we highly encourage to update to the `standard` version.

The only difference between this and the updated standard version is that the property keys of `value`, `type`,`description` and `extension` haven beend prefixed with a `$` in the new version.

```js
type StandardTokenInterface = {
name: string,
Expand Down
3,608 changes: 3,607 additions & 1 deletion dist/plugin.js

Large diffs are not rendered by default.

50,516 changes: 49,935 additions & 581 deletions dist/ui.html

Large diffs are not rendered by default.

50,515 changes: 49,934 additions & 581 deletions dist/ui.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions examples/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const buildPath = basePath + 'build/'
const StyleDictionaryExtended = StyleDictionary.extend({
// adding imported configs
...deepMerge.all([androidConfig, iosConfig, webConfig]),
// custom parser for new standard token josn
parsers: [require('./libs/w3cParser.js')],
source: [basePath + 'input/*.json'],
platforms: {
css: {
Expand Down
22 changes: 3 additions & 19 deletions examples/build/android/font/font_family.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,9 @@
<font
android:fontStyle="normal"
android:fontWeight="300"
android:font="@font/RTLUnitedText-Light" />
<font
android:fontStyle="italic"
android:fontWeight="300"
android:font="@font/RTLUnitedText-LightItalic" />
<font
android:fontStyle="normal"
android:fontWeight="400"
android:font="@font/RTLUnitedText-Regular" />
<font
android:fontStyle="italic"
android:fontWeight="400"
android:font="@font/RTLUnitedText-RegularItalic" />
android:font="@font/AkzidenzGroteskPro-Regular" />
<font
android:fontStyle="normal"
android:fontWeight="700"
android:font="@font/RTLUnitedText-Bold" />
<font
android:fontStyle="italic"
android:fontWeight="700"
android:font="@font/RTLUnitedText-BoldItalic" />
android:fontWeight="600"
android:font="@font/AkzidenzGroteskPro-Bold" />
</font-family>
2 changes: 1 addition & 1 deletion examples/build/android/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
Do not edit directly
Generated on Mon, 20 Sep 2021 14:18:44 GMT
Generated on Sun, 25 Sep 2022 20:57:56 GMT
-->
<resources>
<dimen name="sizes32">32.72dp</dimen>
Expand Down
2 changes: 1 addition & 1 deletion examples/build/android/values/font_styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Do not edit directly
Generated on Mon, 20 Sep 2021 14:18:44 GMT
Generated on Sun, 25 Sep 2022 20:57:56 GMT
-->
<resources>
<style name="fontBodyH3">
Expand Down
2 changes: 1 addition & 1 deletion examples/build/css/variables.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Mon Sep 20 2021 16:18:44 GMT+0200 (Central European Summer Time)
* Generated on Sun Sep 25 2022 22:57:56 GMT+0200 (Central European Summer Time)
*/

:root {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,6 @@
"version": 1
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "srgb",
"components": {
"red": "1.000",
"green": "1.000",
"blue": "1.000",
"alpha": "1.000"
}
}
},
{
"idiom": "universal",
"color": {
"color-space": "srgb",
"components": {
"red": "0.000",
"green": "0.000",
"blue": "0.000",
"alpha": "1.000"
}
}
},
{
"idiom": "universal",
"color": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@
"version": 1
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "srgb",
"components": {
"red": "0.250",
"green": "1.000",
"blue": "0.730",
"alpha": "1.000"
}
}
},
{
"idiom": "universal",
"color": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@
"version": 1
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "srgb",
"components": {
"red": "0.000",
"green": "0.000",
"blue": "0.000",
"alpha": "0.102"
}
}
},
{
"idiom": "universal",
"color": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@
"version": 1
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "srgb",
"components": {
"red": "0.020",
"green": "0.290",
"blue": "1.000",
"alpha": "1.000"
}
}
},
{
"idiom": "universal",
"color": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@
"version": 1
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "srgb",
"components": {
"red": "0.250",
"green": "0.870",
"blue": "0.310",
"alpha": "1.000"
}
}
},
{
"idiom": "universal",
"color": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@
"version": 1
},
"colors": [
{
"idiom": "universal",
"color": {
"color-space": "srgb",
"components": {
"red": "0.200",
"green": "0.340",
"blue": "0.690",
"alpha": "1.000"
}
}
},
{
"idiom": "universal",
"color": {
Expand Down
2 changes: 1 addition & 1 deletion examples/build/ios/Size.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//

// Do not edit directly
// Generated on Mon, 20 Sep 2021 14:18:44 GMT
// Generated on Sun, 25 Sep 2022 20:57:56 GMT


import UIKit
Expand Down
2 changes: 1 addition & 1 deletion examples/build/ios/StyleDictionary+Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// StyleDictionary+Generated.swift
//
// Created by Design Token Generator on 20.09.2021.
// Created by Design Token Generator on 25.09.2022.
//

import UIKit
Expand Down
2 changes: 1 addition & 1 deletion examples/build/scss/variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Mon, 20 Sep 2021 14:18:44 GMT
// Generated on Sun, 25 Sep 2022 20:57:56 GMT

$sizes-32: 32.72px;
$sizes-40: 40px;
Expand Down
Loading