Skip to content

Commit

Permalink
fix: boxShadow transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
Enjoy2Live committed Sep 18, 2023
1 parent d2bcf8f commit a0d2a37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-tokens.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on:
push:
branches: 'development/design-team'
branches: ['development/design-team']

jobs:
build:
Expand Down
16 changes: 8 additions & 8 deletions packages/tailwind-constructor/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,23 @@ StyleDictionaryPackage.registerTransform({
'borderRadius',
'borderWidth',
'sizing',
'Highlight',
'Shadow',
'boxShadow',
'Universal',
'Link Text',
'Default',
'Mobile',
].includes(prop.attributes.category);
].includes(prop.type);
},
transformer: function (prop) {
// You can also modify the value here if you want to convert pixels to ems

switch (prop.attributes.category) {
switch (prop.type) {
case 'fontSizes':
case 'spacing':
case 'borderRadius':
case 'borderWidth':
case 'sizing':
return parseFloat(prop.original.value) + 'rem';
return prop.original.value;
case 'Default':
case 'Mobile':
case 'Link Text':
Expand All @@ -93,11 +92,12 @@ StyleDictionaryPackage.registerTransform({
return prop.original.value
? `${fontFamily} ${fontSize}px ${fontWeight} ${lineHeight}px ${letterSpacing} ${paragraphSpacing} ${textCase} ${textDecoration}`
: 'none';
case 'Highlight':
case 'Shadow':
case 'boxShadow':
const { x, y, blur, spread, color } = prop.original.value;
return prop.original.value
? `${x}px ${y}px ${blur}px ${spread}px ${color}`
? `${
prop.original.value.type === 'innerShadow' ? 'inset ' : ''
}${x}px ${y}px ${blur}px ${spread}px ${color}`
: 'none';
default:
return prop.original.value;
Expand Down

0 comments on commit a0d2a37

Please sign in to comment.