Skip to content

Commit

Permalink
fix(transforms): exclude box-shadow-color from px transform
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Apr 25, 2024
1 parent 98a7af8 commit 031190d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions packages/module/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ console.log('\n============================');
//Register comment format
StyleDictionary.registerFormat({
name: 'customFormat',
formatter: function({dictionary, file, options}) {
formatter: function ({ dictionary, file, options }) {
const { outputReferences } = options;
return fileHeader({file, commentStyle: 'short'}) +
return (
fileHeader({ file, commentStyle: 'short' }) +
':root {\n' +
formattedVariables({format: 'css', dictionary, outputReferences}) +
'\n}\n';
formattedVariables({ format: 'css', dictionary, outputReferences }) +
'\n}\n'
);
}
});

Expand All @@ -25,7 +27,7 @@ StyleDictionary.registerTransform({
token.attributes.type === 'spacer' ||
token.attributes.type === 'border' ||
token.attributes.type === 'icon' ||
token.attributes.type === 'box-shadow' ||
(token.attributes.type === 'box-shadow' && token.attributes.item !== 'color') ||
token.attributes.type === 'font',
transformer: (token) => `${token.value}px`
});
Expand Down Expand Up @@ -67,6 +69,5 @@ paletteExtendedSD.buildAllPlatforms();
chartExtendedSD.buildAllPlatforms();
chartDarkExtendedSD.buildAllPlatforms();


console.log('\n============================');
console.log('\nBuild completed.');
2 changes: 1 addition & 1 deletion packages/module/build/css/_tokens-charts.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Wed, 17 Apr 2024 14:31:33 GMT
// Generated on Thu, 18 Apr 2024 14:33:26 GMT

:root {
--pf-t--chart--global--layout--width: 450;
Expand Down
2 changes: 1 addition & 1 deletion packages/module/build/css/_tokens-dark.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Wed, 17 Apr 2024 14:31:33 GMT
// Generated on Thu, 18 Apr 2024 14:33:25 GMT

:root {
--pf-t--global--background--color--action--plain--default: rgba(0, 0, 0, 0.0000);
Expand Down
2 changes: 1 addition & 1 deletion packages/module/build/css/_tokens-default.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Wed, 17 Apr 2024 14:31:33 GMT
// Generated on Thu, 18 Apr 2024 14:33:25 GMT

:root {
--pf-t--global--background--color--action--plain--default: rgba(255, 255, 255, 0.0000);
Expand Down
2 changes: 1 addition & 1 deletion packages/module/build/css/_tokens-palette.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Wed, 17 Apr 2024 14:31:33 GMT
// Generated on Thu, 18 Apr 2024 14:33:25 GMT

:root {
--pf-t--color--red--70: #5f0000;
Expand Down

0 comments on commit 031190d

Please sign in to comment.