@koobiq/tokens-builder 3.12.1 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.js
CHANGED
|
@@ -9,6 +9,7 @@ require('./transforms/attribute/prefix')(StyleDictionary);
|
|
|
9
9
|
require('./transforms/attribute/font')(StyleDictionary);
|
|
10
10
|
require('./transforms/attribute/theme')(StyleDictionary);
|
|
11
11
|
require('./transforms/attribute/scss-value')(StyleDictionary);
|
|
12
|
+
require('./transforms/attribute/deprecation-comment')(StyleDictionary);
|
|
12
13
|
|
|
13
14
|
// ==== Include custom filters ====
|
|
14
15
|
require('./filters/palette')(StyleDictionary);
|
package/formats/variables.js
CHANGED
|
@@ -5,8 +5,7 @@ module.exports = (StyleDictionary) => {
|
|
|
5
5
|
StyleDictionary.registerFormat({
|
|
6
6
|
name: 'kbq-css/variables',
|
|
7
7
|
formatter: function ({ dictionary, options = {}, file }) {
|
|
8
|
-
const selector =
|
|
9
|
-
const { outputReferences } = options;
|
|
8
|
+
const { outputReferences, selector = ':root' } = options;
|
|
10
9
|
|
|
11
10
|
// apply custom transformations for tokens
|
|
12
11
|
dictionary.allProperties = dictionary.allTokens = dictionary.allTokens.flatMap((token) => {
|
package/package.json
CHANGED
package/transformGroups/css.js
CHANGED
package/transformGroups/scss.js
CHANGED
package/transformGroups/ts.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
module.exports = (StyleDictionary) => {
|
|
2
2
|
StyleDictionary.registerTransformGroup({
|
|
3
3
|
name: 'kbq/ts',
|
|
4
|
-
transforms: [
|
|
4
|
+
transforms: [
|
|
5
|
+
'attribute/cti',
|
|
6
|
+
'name/cti/pascal',
|
|
7
|
+
'kbq-attribute/palette',
|
|
8
|
+
'size/px',
|
|
9
|
+
'color/hex',
|
|
10
|
+
'kbq-attribute/comment'
|
|
11
|
+
]
|
|
5
12
|
});
|
|
6
13
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = (StyleDictionary) => {
|
|
2
|
+
StyleDictionary.registerTransform({
|
|
3
|
+
name: 'kbq-attribute/comment',
|
|
4
|
+
type: 'attribute',
|
|
5
|
+
transformer: (token) => {
|
|
6
|
+
if (token.deprecated && token.deprecated_comment) {
|
|
7
|
+
const notice = `DEPRECATED: ${token.deprecated_comment}`;
|
|
8
|
+
token.comment = token.comment ? `${notice} | ${token.comment}` : notice;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
};
|