Skip to content

Commit

Permalink
Merge pull request #31 from jessiehuff/fix/token-comments
Browse files Browse the repository at this point in the history
fix: Update formatting of comments
  • Loading branch information
srambach authored Apr 16, 2024
2 parents d277ce3 + 6316670 commit ba08833
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 26 deletions.
14 changes: 14 additions & 0 deletions packages/module/build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
/* eslint-disable no-console */
const StyleDictionary = require('style-dictionary');
const { fileHeader, formattedVariables } = StyleDictionary.formatHelpers;

console.log('Build started...');
console.log('\n============================');

//Register comment format
StyleDictionary.registerFormat({
name: 'customFormat',
formatter: function({dictionary, file, options}) {
const { outputReferences } = options;
return fileHeader({file, commentStyle: 'short'}) +
':root {\n' +
formattedVariables({format: 'css', dictionary, outputReferences}) +
'\n}\n';
}
});

// Register custom transforms
StyleDictionary.registerTransform({
name: 'patternfly/global/px',
Expand Down Expand Up @@ -52,5 +65,6 @@ darkExtendedSD.buildAllPlatforms();
paletteExtendedSD.buildAllPlatforms();
chartExtendedSD.buildAllPlatforms();


console.log('\n============================');
console.log('\nBuild completed.');
7 changes: 3 additions & 4 deletions packages/module/build/css/_tokens-charts.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// /**
// * Do not edit directly
// * Generated on Mon, 01 Apr 2024 17:12:28 GMT
// */

// Do not edit directly
// Generated on Thu, 11 Apr 2024 19:46:01 GMT

:root {
--pf-t--chart--stroke--width--sm: 2;
Expand Down
7 changes: 3 additions & 4 deletions packages/module/build/css/_tokens-dark.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// /**
// * Do not edit directly
// * Generated on Mon, 01 Apr 2024 17:12:28 GMT
// */

// Do not edit directly
// Generated on Thu, 11 Apr 2024 19:46:01 GMT

:root {
--pf-t--global--background--color--action--plain--default: rgba(0, 0, 0, 0.0000);
Expand Down
19 changes: 9 additions & 10 deletions packages/module/build/css/_tokens-default.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// /**
// * Do not edit directly
// * Generated on Mon, 01 Apr 2024 17:12:28 GMT
// */

// Do not edit directly
// Generated on Thu, 11 Apr 2024 19:46:01 GMT

:root {
--pf-t--global--background--color--action--plain--default: rgba(255, 255, 255, 0.0000);
Expand Down Expand Up @@ -166,12 +165,12 @@
--pf-t--global--box-shadow--X--sm--bottom: var(--pf-t--global--box-shadow--X--400);
--pf-t--global--box-shadow--X--sm--top: var(--pf-t--global--box-shadow--X--400);
--pf-t--global--box-shadow--X--sm--default: var(--pf-t--global--box-shadow--X--400);
--pf-t--global--z-index--2xl: 600;
--pf-t--global--z-index--xl: 500;
--pf-t--global--z-index--lg: 400;
--pf-t--global--z-index--md: 300;
--pf-t--global--z-index--sm: 200;
--pf-t--global--z-index--xs: 100;
--pf-t--global--z-index--2xl: var(--pf-t--global--z-index--600);
--pf-t--global--z-index--xl: var(--pf-t--global--z-index--500);
--pf-t--global--z-index--lg: var(--pf-t--global--z-index--400);
--pf-t--global--z-index--md: var(--pf-t--global--z-index--300);
--pf-t--global--z-index--sm: var(--pf-t--global--z-index--200);
--pf-t--global--z-index--xs: var(--pf-t--global--z-index--100);
--pf-t--global--font--size--4xl: var(--pf-t--global--font--size--800);
--pf-t--global--font--size--3xl: var(--pf-t--global--font--size--700);
--pf-t--global--font--size--2xl: var(--pf-t--global--font--size--600);
Expand Down
7 changes: 3 additions & 4 deletions packages/module/build/css/_tokens-palette.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// /**
// * Do not edit directly
// * Generated on Mon, 01 Apr 2024 17:12:28 GMT
// */

// Do not edit directly
// Generated on Thu, 11 Apr 2024 19:46:01 GMT

:root {
--pf-t--color--red--70: #5f0000;
Expand Down
2 changes: 1 addition & 1 deletion packages/module/config.chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"prefix": "pf-t",
"files": [{
"destination": "_tokens-charts.scss",
"format": "css/variables",
"format": "customFormat",
"options": {
"outputReferences": true
},
Expand Down
2 changes: 1 addition & 1 deletion packages/module/config.dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"prefix": "pf-t",
"files": [{
"destination": "_tokens-dark.scss",
"format": "css/variables",
"format": "customFormat",
"options": {
"outputReferences": true
},
Expand Down
2 changes: 1 addition & 1 deletion packages/module/config.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"prefix": "pf-t",
"files": [{
"destination": "_tokens-default.scss",
"format": "css/variables",
"format": "customFormat",
"options": {
"outputReferences": true
},
Expand Down
2 changes: 1 addition & 1 deletion packages/module/config.palette-colors.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"prefix": "pf-t",
"files": [{
"destination": "_tokens-palette.scss",
"format": "css/variables",
"format": "customFormat",
"options": {
"outputReferences": true
},
Expand Down

0 comments on commit ba08833

Please sign in to comment.