Skip to content

Commit

Permalink
fix style dictionary script, add sc prefix for semantic colors
Browse files Browse the repository at this point in the history
  • Loading branch information
wgardiner committed Oct 14, 2024
1 parent 5a2822b commit 9abb7be
Show file tree
Hide file tree
Showing 4 changed files with 568 additions and 541 deletions.
15 changes: 2 additions & 13 deletions design/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,7 @@ StyleDictionary.registerFormat({
.replace(/\&/g, '-')
.replace(/\%/g, '');
}

if (isReference(y.original.value)) {
newValue = y.original.value.slice(1, -1);
for (const { pattern, replacement } of pathTransforms) {
newValue = newValue.replace(new RegExp(pattern), replacement);
}
} else {
newValue = newPath.replace(/\./g, '-');
}
newValue = newPath.replace(/\./g, '-');

_.setWith(
tokens,
Expand All @@ -194,6 +186,7 @@ StyleDictionary.registerFormat({
);
});

// console.log(JSON.stringify(tokens, null, 2));

return `module.exports = {
theme: {
Expand Down Expand Up @@ -258,10 +251,6 @@ const config = {
],
buildPath: 'build/',
files: [
// {
// destination: 'tailwind.config2.js',
// format: 'tailwind/colors',
// },
{
destination: 'tailwind.common.js',
format: 'tailwind/colors-shared',
Expand Down
Loading

0 comments on commit 9abb7be

Please sign in to comment.