Skip to content

Commit

Permalink
Merge pull request #37 from kmcfaul/extra-px
Browse files Browse the repository at this point in the history
fix(transforms): exclude box-shadow-color from px transform
  • Loading branch information
srambach authored Apr 25, 2024
2 parents 98a7af8 + 111d95f commit c578031
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 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-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, 25 Apr 2024 15:11:06 GMT

:root {
--pf-t--chart--global--layout--width: 450;
Expand Down
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, 25 Apr 2024 15:11:05 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, 25 Apr 2024 15:11:05 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, 25 Apr 2024 15:11:05 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, 25 Apr 2024 15:11:05 GMT

:root {
--pf-t--color--red--70: #5f0000;
Expand Down
2 changes: 1 addition & 1 deletion packages/module/patternfly-docs/scssAsJson.json

Large diffs are not rendered by default.

0 comments on commit c578031

Please sign in to comment.