@atlaskit/tokens 0.1.1 → 0.4.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/CHANGELOG.md +39 -0
- package/README.md +28 -0
- package/babel-plugin/package.json +7 -0
- package/css/atlassian-dark.css +89 -88
- package/css/atlassian-light.css +89 -88
- package/dist/cjs/artifacts/rename-mapping.js +23 -0
- package/dist/cjs/artifacts/token-default-values.js +105 -0
- package/dist/cjs/artifacts/token-names.js +101 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-dark.js +1786 -0
- package/dist/cjs/artifacts/tokens-raw/atlassian-light.js +1766 -0
- package/dist/cjs/artifacts/types.js +5 -0
- package/dist/cjs/babel-plugin/index.js +15 -0
- package/dist/cjs/babel-plugin/plugin.js +176 -0
- package/dist/cjs/entry-points/rename-mapping.js +1 -1
- package/dist/cjs/entry-points/token-names.js +1 -1
- package/dist/cjs/figma/synchronize-figma-tokens.js +43 -41
- package/dist/cjs/get-token.js +1 -1
- package/dist/cjs/tokens/atlassian-dark/utility/utility.js +3 -0
- package/dist/cjs/tokens/atlassian-light/utility/utility.js +3 -0
- package/dist/cjs/tokens/default/color/accent.js +26 -13
- package/dist/cjs/tokens/default/color/background.js +98 -49
- package/dist/cjs/tokens/default/color/border.js +4 -2
- package/dist/cjs/tokens/default/color/icon-border.js +10 -5
- package/dist/cjs/tokens/default/color/overlay.js +4 -2
- package/dist/cjs/tokens/default/color/text.js +28 -14
- package/dist/cjs/tokens/default/shadow/shadow.js +4 -2
- package/dist/cjs/tokens/default/utility/utility.js +10 -2
- package/dist/cjs/tokens/palette.js +145 -260
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/artifacts/rename-mapping.js +16 -0
- package/dist/es2019/artifacts/token-default-values.js +98 -0
- package/dist/es2019/artifacts/token-names.js +94 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-dark.js +1779 -0
- package/dist/es2019/artifacts/tokens-raw/atlassian-light.js +1759 -0
- package/dist/es2019/artifacts/types.js +1 -0
- package/dist/es2019/babel-plugin/index.js +1 -0
- package/dist/es2019/babel-plugin/plugin.js +151 -0
- package/dist/es2019/entry-points/rename-mapping.js +1 -1
- package/dist/es2019/entry-points/token-names.js +1 -1
- package/dist/es2019/figma/synchronize-figma-tokens.js +43 -41
- package/dist/es2019/get-token.js +1 -1
- package/dist/es2019/tokens/atlassian-dark/utility/utility.js +3 -0
- package/dist/es2019/tokens/atlassian-light/utility/utility.js +3 -0
- package/dist/es2019/tokens/default/color/accent.js +26 -13
- package/dist/es2019/tokens/default/color/background.js +103 -49
- package/dist/es2019/tokens/default/color/border.js +4 -2
- package/dist/es2019/tokens/default/color/icon-border.js +28 -5
- package/dist/es2019/tokens/default/color/overlay.js +4 -2
- package/dist/es2019/tokens/default/color/text.js +35 -14
- package/dist/es2019/tokens/default/shadow/shadow.js +12 -2
- package/dist/es2019/tokens/default/utility/utility.js +10 -2
- package/dist/es2019/tokens/palette.js +145 -260
- package/dist/es2019/version.json +1 -1
- package/dist/esm/artifacts/rename-mapping.js +16 -0
- package/dist/esm/artifacts/token-default-values.js +98 -0
- package/dist/esm/artifacts/token-names.js +94 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-dark.js +1779 -0
- package/dist/esm/artifacts/tokens-raw/atlassian-light.js +1759 -0
- package/dist/esm/artifacts/types.js +1 -0
- package/dist/esm/babel-plugin/index.js +1 -0
- package/dist/esm/babel-plugin/plugin.js +158 -0
- package/dist/esm/entry-points/rename-mapping.js +1 -1
- package/dist/esm/entry-points/token-names.js +1 -1
- package/dist/esm/figma/synchronize-figma-tokens.js +43 -41
- package/dist/esm/get-token.js +1 -1
- package/dist/esm/tokens/atlassian-dark/utility/utility.js +3 -0
- package/dist/esm/tokens/atlassian-light/utility/utility.js +3 -0
- package/dist/esm/tokens/default/color/accent.js +26 -13
- package/dist/esm/tokens/default/color/background.js +98 -49
- package/dist/esm/tokens/default/color/border.js +4 -2
- package/dist/esm/tokens/default/color/icon-border.js +10 -5
- package/dist/esm/tokens/default/color/overlay.js +4 -2
- package/dist/esm/tokens/default/color/text.js +28 -14
- package/dist/esm/tokens/default/shadow/shadow.js +4 -2
- package/dist/esm/tokens/default/utility/utility.js +10 -2
- package/dist/esm/tokens/palette.js +145 -260
- package/dist/esm/version.json +1 -1
- package/dist/types/artifacts/rename-mapping.d.ts +17 -0
- package/dist/types/artifacts/token-default-values.d.ts +95 -0
- package/dist/types/artifacts/token-names.d.ts +184 -0
- package/dist/types/artifacts/tokens-raw/atlassian-dark.d.ts +80 -0
- package/dist/types/artifacts/tokens-raw/atlassian-light.d.ts +56 -0
- package/dist/types/artifacts/types.d.ts +4 -0
- package/dist/types/babel-plugin/index.d.ts +1 -0
- package/dist/types/babel-plugin/plugin.d.ts +14 -0
- package/dist/types/entry-points/babel-plugin.d.ts +1 -0
- package/dist/types/entry-points/rename-mapping.d.ts +1 -1
- package/dist/types/entry-points/token-names.d.ts +2 -2
- package/dist/types/get-token.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/tokens/atlassian-dark/utility/utility.d.ts +10 -2
- package/dist/types/tokens/atlassian-light/utility/utility.d.ts +10 -2
- package/dist/types/tokens/default/utility/utility.d.ts +138 -2
- package/dist/types/types.d.ts +49 -14
- package/package.json +17 -5
- package/tokens-browser-extension/README.md +28 -0
- package/tokens-browser-extension/atlassian-theme.css +375 -0
- package/tokens-browser-extension/background.js +75 -0
- package/tokens-browser-extension/content-script.js +75 -0
- package/tokens-browser-extension/devtools.html +1 -0
- package/tokens-browser-extension/devtools.js +14 -0
- package/tokens-browser-extension/manifest.json +36 -0
- package/tokens-browser-extension/messageback-script.js +10 -0
- package/tokens-browser-extension/messaging.js +36 -0
- package/tokens-browser-extension/panel.html +25 -0
- package/tokens-browser-extension/panel.js +46 -0
- package/tokens-browser-extension/toast.png +0 -0
- package/dist/cjs/tokens/rename-mapping.js +0 -29
- package/dist/cjs/tokens/token-names.js +0 -100
- package/dist/es2019/tokens/rename-mapping.js +0 -21
- package/dist/es2019/tokens/token-names.js +0 -93
- package/dist/esm/tokens/rename-mapping.js +0 -21
- package/dist/esm/tokens/token-names.js +0 -93
- package/dist/types/tokens/rename-mapping.d.ts +0 -24
- package/dist/types/tokens/token-names.d.ts +0 -182
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _plugin.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _plugin = _interopRequireDefault(require("./plugin"));
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = plugin;
|
|
11
|
+
|
|
12
|
+
var t = _interopRequireWildcard(require("@babel/types"));
|
|
13
|
+
|
|
14
|
+
var _tokenDefaultValues = _interopRequireDefault(require("../artifacts/token-default-values"));
|
|
15
|
+
|
|
16
|
+
var _tokenNames = _interopRequireDefault(require("../artifacts/token-names"));
|
|
17
|
+
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
|
|
22
|
+
function plugin() {
|
|
23
|
+
return {
|
|
24
|
+
visitor: {
|
|
25
|
+
CallExpression: function (_CallExpression) {
|
|
26
|
+
function CallExpression(_x, _x2) {
|
|
27
|
+
return _CallExpression.apply(this, arguments);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
CallExpression.toString = function () {
|
|
31
|
+
return _CallExpression.toString();
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return CallExpression;
|
|
35
|
+
}(function (path, state) {
|
|
36
|
+
var tokenImportScope = getTokenImportScope(path);
|
|
37
|
+
|
|
38
|
+
if (!tokenImportScope) {
|
|
39
|
+
return;
|
|
40
|
+
} // Check arguments have correct format
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
if (!path.node.arguments[0]) {
|
|
44
|
+
throw new Error("token() requires at least one argument");
|
|
45
|
+
} else if (!t.isStringLiteral(path.node.arguments[0])) {
|
|
46
|
+
throw new Error("token() must have a string as the first argument");
|
|
47
|
+
} else if (path.node.arguments.length > 2) {
|
|
48
|
+
throw new Error("token() does not accept ".concat(path.node.arguments.length, " arguments"));
|
|
49
|
+
} // Check the token exists
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
var tokenName = path.node.arguments[0].value;
|
|
53
|
+
var cssTokenValue = _tokenNames.default[tokenName];
|
|
54
|
+
|
|
55
|
+
if (!cssTokenValue) {
|
|
56
|
+
throw new Error("token '".concat(tokenName, "' does not exist"));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var replacementNode; // if no fallback is set, optionally find one from the default theme
|
|
60
|
+
|
|
61
|
+
if (path.node.arguments.length < 2) {
|
|
62
|
+
if (state.opts.shouldUseAutoFallback) {
|
|
63
|
+
replacementNode = t.stringLiteral("var(".concat(cssTokenValue, ", ").concat(getDefaultFallback(tokenName), ")"));
|
|
64
|
+
} else {
|
|
65
|
+
replacementNode = t.stringLiteral("var(".concat(cssTokenValue, ")"));
|
|
66
|
+
}
|
|
67
|
+
} // Handle fallbacks
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
var fallback = path.node.arguments[1];
|
|
71
|
+
|
|
72
|
+
if (t.isStringLiteral(fallback)) {
|
|
73
|
+
// String literals can be concatenated into css variable call
|
|
74
|
+
// Empty string fallbacks are ignored. For now, as the user did specify a fallback, no default is inserted
|
|
75
|
+
replacementNode = t.stringLiteral(fallback.value ? "var(".concat(cssTokenValue, ", ").concat(fallback.value, ")") : "var(".concat(cssTokenValue, ")"));
|
|
76
|
+
} else if (t.isExpression(fallback)) {
|
|
77
|
+
// Expressions should be placed in a template string/literal
|
|
78
|
+
replacementNode = t.templateLiteral([t.templateElement({
|
|
79
|
+
cooked: "var(".concat(cssTokenValue, ", "),
|
|
80
|
+
// Currently we create a "raw" value by inserting escape characters via regex (https://github.com/babel/babel/issues/9242)
|
|
81
|
+
raw: "var(".concat(cssTokenValue.replace(/\\|`|\${/g, '\\$&'), ", ")
|
|
82
|
+
}, false), t.templateElement({
|
|
83
|
+
raw: ')',
|
|
84
|
+
cooked: ')'
|
|
85
|
+
}, true)], [fallback]);
|
|
86
|
+
} // Replace path and call scope.crawl() to refresh the scope bindings + references
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
replacementNode && path.replaceWith(replacementNode); // @ts-ignore crawl is a valid property
|
|
90
|
+
|
|
91
|
+
tokenImportScope.crawl();
|
|
92
|
+
}),
|
|
93
|
+
Program: {
|
|
94
|
+
exit: function exit(path) {
|
|
95
|
+
path.traverse({
|
|
96
|
+
ImportDeclaration: function ImportDeclaration(path) {
|
|
97
|
+
// remove import of 'token'
|
|
98
|
+
if (path.node.source.value !== '@atlaskit/tokens') {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
path.get('specifiers').forEach(function (specifier) {
|
|
103
|
+
if (!specifier.isImportSpecifier()) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (getNonAliasedImportName(specifier.node) !== 'token') {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
var binding = path.scope.bindings[getAliasedImportName(specifier.node)]; // if no longer used, remove
|
|
112
|
+
|
|
113
|
+
if (!binding.referenced) {
|
|
114
|
+
specifier.remove();
|
|
115
|
+
}
|
|
116
|
+
}); // remove '@atlaskit/tokens' import if it is no longer needed
|
|
117
|
+
|
|
118
|
+
if (path.get('specifiers').length === 0) {
|
|
119
|
+
path.remove();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function getDefaultFallback(tokenName) {
|
|
130
|
+
return _tokenDefaultValues.default[tokenName];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getNonAliasedImportName(node) {
|
|
134
|
+
if (t.isIdentifier(node.imported)) {
|
|
135
|
+
return node.imported.name;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return node.imported.value;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function getAliasedImportName(node) {
|
|
142
|
+
return node.local.name;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Determine if the current call is to a token function, and
|
|
146
|
+
* return the relevant scope
|
|
147
|
+
*/
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
function getTokenImportScope(path) {
|
|
151
|
+
var callee = path.node.callee;
|
|
152
|
+
|
|
153
|
+
if (!t.isIdentifier(callee)) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
var binding = getTokenBinding(path.scope, callee.name);
|
|
158
|
+
|
|
159
|
+
if (!binding || !t.isImportSpecifier(binding.path.node)) {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return getNonAliasedImportName(binding.path.node) === 'token' ? binding.scope : undefined;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function getTokenBinding(scope, name) {
|
|
167
|
+
if (!scope) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (scope.bindings[name]) {
|
|
172
|
+
return scope.bindings[name];
|
|
173
|
+
} else {
|
|
174
|
+
return getTokenBinding(scope.parent, name);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -102,28 +102,29 @@ function synchronizeFigmaTokens(themeName, tokens) {
|
|
|
102
102
|
style.name = renameMap[style.name];
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
var token = tokens[style.name];
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// Effect exists in our token set.
|
|
110
|
-
// The token is no longer an effect style, time to remove it!
|
|
111
|
-
console.log("=> ".concat(style.name, " is no longer a shadow, removing!"));
|
|
112
|
-
style.remove();
|
|
113
|
-
} else {
|
|
114
|
-
// It's still an effect! Update it.
|
|
115
|
-
console.log("=> ".concat(style.name, " shadow style has been updated!"));
|
|
116
|
-
style.effects = createEffects(token.value);
|
|
117
|
-
style.description = token.attributes.description || ''; // Remove from themeValues so it isn't picked up as a new token.
|
|
118
|
-
|
|
119
|
-
delete tokens[style.name];
|
|
120
|
-
}
|
|
121
|
-
} else if (style.name.startsWith(themeName)) {
|
|
122
|
-
// The local style was in our theme, but no more!
|
|
123
|
-
// It's time to delete it.
|
|
105
|
+
var token = tokens[style.name]; // The local style was in our theme, but no more!
|
|
106
|
+
// It's time to delete it.
|
|
107
|
+
|
|
108
|
+
if (!token) {
|
|
124
109
|
console.log("=> ".concat(style.name, " shadow style no longer exists, removing."));
|
|
125
110
|
style.remove();
|
|
111
|
+
return;
|
|
126
112
|
}
|
|
113
|
+
|
|
114
|
+
if (token.attributes.group !== 'shadow') {
|
|
115
|
+
// Effect exists in our token set.
|
|
116
|
+
// The token is no longer an effect style, time to remove it!
|
|
117
|
+
console.log("=> ".concat(style.name, " is no longer a shadow, removing!"));
|
|
118
|
+
style.remove();
|
|
119
|
+
return;
|
|
120
|
+
} // It's still an effect! Update it.
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
console.log("=> ".concat(style.name, " shadow style has been updated!"));
|
|
124
|
+
style.effects = createEffects(token.value);
|
|
125
|
+
style.description = (token.attributes.description || '').trim(); // Remove from themeValues so it isn't picked up as a new token.
|
|
126
|
+
|
|
127
|
+
delete tokens[style.name];
|
|
127
128
|
}); // Iterate through all local figma styles first
|
|
128
129
|
// If it still exists in themeValues, update it (and then remove from themeValues)
|
|
129
130
|
// If it doesn't exist, delete the local figma style
|
|
@@ -137,29 +138,30 @@ function synchronizeFigmaTokens(themeName, tokens) {
|
|
|
137
138
|
style.name = renameMap[style.name];
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
var token = tokens[style.name];
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
// The token is no longer a paint style, time to remove it!
|
|
145
|
-
console.log("=> ".concat(style.name, " is no longer a paint, removing!"));
|
|
146
|
-
style.remove();
|
|
147
|
-
} else {
|
|
148
|
-
// Local style exists that also exists in our tokens!
|
|
149
|
-
// Update it and then remove from themeValues.
|
|
150
|
-
console.log("=> ".concat(style.name, " paint style has been updated!")); // Mutating is how Figma updates.
|
|
151
|
-
|
|
152
|
-
style.paints = [createPaint(token.value)];
|
|
153
|
-
style.description = token.attributes.description || ''; // Remove from themeValues so it isn't picked up as a new token.
|
|
154
|
-
|
|
155
|
-
delete tokens[style.name];
|
|
156
|
-
}
|
|
157
|
-
} else if (style.name.startsWith(themeName)) {
|
|
158
|
-
// The local style was in our theme, but no more!
|
|
159
|
-
// It's time to delete it.
|
|
141
|
+
var token = tokens[style.name]; // The local style was in our theme, but no more!
|
|
142
|
+
// It's time to delete it.
|
|
143
|
+
|
|
144
|
+
if (!token) {
|
|
160
145
|
console.log("=> ".concat(style.name, " paint style no longer exists, removing."));
|
|
161
146
|
style.remove();
|
|
147
|
+
return;
|
|
162
148
|
}
|
|
149
|
+
|
|
150
|
+
if (token.attributes.group !== 'paint') {
|
|
151
|
+
// The token is no longer a paint style, time to remove it!
|
|
152
|
+
console.log("=> ".concat(style.name, " is no longer a paint, removing!"));
|
|
153
|
+
style.remove();
|
|
154
|
+
return;
|
|
155
|
+
} // Local style exists that also exists in our tokens!
|
|
156
|
+
// Update it and then remove from themeValues.
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
console.log("=> ".concat(style.name, " paint style has been updated!")); // Mutating is how Figma updates.
|
|
160
|
+
|
|
161
|
+
style.paints = [createPaint(token.value)];
|
|
162
|
+
style.description = (token.attributes.description || '').trim(); // Remove from themeValues so it isn't picked up as a new token.
|
|
163
|
+
|
|
164
|
+
delete tokens[style.name];
|
|
163
165
|
}); // eslint-disable-next-line guard-for-in
|
|
164
166
|
|
|
165
167
|
for (var key in tokens) {
|
|
@@ -168,7 +170,7 @@ function synchronizeFigmaTokens(themeName, tokens) {
|
|
|
168
170
|
if (token.attributes.group === 'paint') {
|
|
169
171
|
var newStyle = figma.createPaintStyle();
|
|
170
172
|
newStyle.name = key;
|
|
171
|
-
newStyle.description = token.attributes.description || '';
|
|
173
|
+
newStyle.description = (token.attributes.description || '').trim();
|
|
172
174
|
newStyle.paints = [createPaint(token.value)];
|
|
173
175
|
console.log("=> ".concat(key, " paint style has been added!"));
|
|
174
176
|
}
|
|
@@ -177,7 +179,7 @@ function synchronizeFigmaTokens(themeName, tokens) {
|
|
|
177
179
|
var _newStyle = figma.createEffectStyle();
|
|
178
180
|
|
|
179
181
|
_newStyle.name = key;
|
|
180
|
-
_newStyle.description = token.attributes.description || '';
|
|
182
|
+
_newStyle.description = (token.attributes.description || '').trim();
|
|
181
183
|
_newStyle.effects = createEffects(token.value);
|
|
182
184
|
console.log("=> ".concat(key, " shadow style has been added!"));
|
|
183
185
|
}
|
package/dist/cjs/get-token.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var _tokenNames = _interopRequireDefault(require("./
|
|
10
|
+
var _tokenNames = _interopRequireDefault(require("./artifacts/token-names"));
|
|
11
11
|
|
|
12
12
|
function token(path, fallback) {
|
|
13
13
|
if (process.env.NODE_ENV !== 'production' && !_tokenNames.default[path]) {
|
|
@@ -10,79 +10,92 @@ var color = {
|
|
|
10
10
|
boldBlue: {
|
|
11
11
|
attributes: {
|
|
12
12
|
group: 'paint',
|
|
13
|
-
|
|
13
|
+
state: 'active',
|
|
14
|
+
description: 'Use for blue backgrounds of stronger emphasis when there is no meaning tied to the color, such as bold tags.'
|
|
14
15
|
}
|
|
15
16
|
},
|
|
16
17
|
boldGreen: {
|
|
17
18
|
attributes: {
|
|
18
19
|
group: 'paint',
|
|
19
|
-
|
|
20
|
+
state: 'active',
|
|
21
|
+
description: 'Use for green backgrounds of stronger emphasis when there is no meaning tied to the color, such as bold tags.'
|
|
20
22
|
}
|
|
21
23
|
},
|
|
22
24
|
boldOrange: {
|
|
23
25
|
attributes: {
|
|
24
26
|
group: 'paint',
|
|
25
|
-
|
|
27
|
+
state: 'active',
|
|
28
|
+
description: 'Use for orange backgrounds of stronger emphasis when there is no meaning tied to the color, such as bold tags.'
|
|
26
29
|
}
|
|
27
30
|
},
|
|
28
31
|
boldPurple: {
|
|
29
32
|
attributes: {
|
|
30
33
|
group: 'paint',
|
|
31
|
-
|
|
34
|
+
state: 'active',
|
|
35
|
+
description: 'Use for purple backgrounds of stronger emphasis when there is no meaning tied to the color, such as bold tags.'
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
38
|
boldRed: {
|
|
35
39
|
attributes: {
|
|
36
40
|
group: 'paint',
|
|
37
|
-
|
|
41
|
+
state: 'active',
|
|
42
|
+
description: 'Use for red backgrounds of stronger emphasis when there is no meaning tied to the color, such as bold tags.'
|
|
38
43
|
}
|
|
39
44
|
},
|
|
40
45
|
boldTeal: {
|
|
41
46
|
attributes: {
|
|
42
47
|
group: 'paint',
|
|
43
|
-
|
|
48
|
+
state: 'active',
|
|
49
|
+
description: 'Use for teal backgrounds of stronger emphasis when there is no meaning tied to the color, such as bold tags.'
|
|
44
50
|
}
|
|
45
51
|
},
|
|
46
52
|
subtleBlue: {
|
|
47
53
|
attributes: {
|
|
48
54
|
group: 'paint',
|
|
49
|
-
|
|
55
|
+
state: 'active',
|
|
56
|
+
description: 'Use for blue subdued backgrounds when there is no meaning tied to the color, such as colored tags.'
|
|
50
57
|
}
|
|
51
58
|
},
|
|
52
59
|
subtleGreen: {
|
|
53
60
|
attributes: {
|
|
54
61
|
group: 'paint',
|
|
55
|
-
|
|
62
|
+
state: 'active',
|
|
63
|
+
description: 'Use for green subdued backgrounds when there is no meaning tied to the color, such as colored tags.'
|
|
56
64
|
}
|
|
57
65
|
},
|
|
58
66
|
subtleMagenta: {
|
|
59
67
|
attributes: {
|
|
60
68
|
group: 'paint',
|
|
61
|
-
|
|
69
|
+
state: 'active',
|
|
70
|
+
description: 'Use for magenta subdued backgrounds when there is no meaning tied to the color, such as colored tags.'
|
|
62
71
|
}
|
|
63
72
|
},
|
|
64
73
|
subtleOrange: {
|
|
65
74
|
attributes: {
|
|
66
75
|
group: 'paint',
|
|
67
|
-
|
|
76
|
+
state: 'active',
|
|
77
|
+
description: 'Use for orange subdued backgrounds when there is no meaning tied to the color, such as colored tags.'
|
|
68
78
|
}
|
|
69
79
|
},
|
|
70
80
|
subtlePurple: {
|
|
71
81
|
attributes: {
|
|
72
82
|
group: 'paint',
|
|
73
|
-
|
|
83
|
+
state: 'active',
|
|
84
|
+
description: 'Use for purple subdued backgrounds when there is no meaning tied to the color, such as colored tags.'
|
|
74
85
|
}
|
|
75
86
|
},
|
|
76
87
|
subtleRed: {
|
|
77
88
|
attributes: {
|
|
78
89
|
group: 'paint',
|
|
79
|
-
|
|
90
|
+
state: 'active',
|
|
91
|
+
description: 'Use for red subdued backgrounds when there is no meaning tied to the color, such as colored tags.'
|
|
80
92
|
}
|
|
81
93
|
},
|
|
82
94
|
subtleTeal: {
|
|
83
95
|
attributes: {
|
|
84
96
|
group: 'paint',
|
|
85
|
-
|
|
97
|
+
state: 'active',
|
|
98
|
+
description: 'Use for teal subdued backgrounds when there is no meaning tied to the color, such as colored tags.'
|
|
86
99
|
}
|
|
87
100
|
}
|
|
88
101
|
}
|