diff --git a/build-scss.js b/build-scss.js index e53b1ed420..e7788c980f 100755 --- a/build-scss.js +++ b/build-scss.js @@ -84,16 +84,22 @@ const compileAndWriteStyleSheets = ({ }], }); const commonPostCssPlugins = [ - postCSSCustomMedia({ preserve: true }), postCSSImport(), + postCSSCustomMedia({ preserve: true }), combineSelectors({ removeDuplicatedProperties: true }), ]; postCSS(commonPostCssPlugins) - .process(compiledStyleSheet.css, { from: stylesPath, map: { inline: false } }) - .then(result => { + .process(compiledStyleSheet.css, { from: stylesPath, map: false }) + .then((result) => { fs.writeFileSync(`${outDir}/${name}.css`, result.css); - fs.writeFileSync(`${outDir}/${name}.css.map`, result.map.toString()); + + postCSS([postCSSMinify()]) + .process(result.css, { from: `${name}.css`, map: { inline: false } }) + .then((minifiedResult) => { + fs.writeFileSync(`${outDir}/${name}.css.map`, minifiedResult.map.toString()); + fs.writeFileSync(`${outDir}/${name}.min.css`, minifiedResult.css); + }); const hasExistingParagonThemeOutput = fs.existsSync(`${outDir}/${paragonThemeOutputFilename}`); let paragonThemeOutput; @@ -118,15 +124,6 @@ const compileAndWriteStyleSheets = ({ } fs.writeFileSync(`${outDir}/${paragonThemeOutputFilename}`, `${JSON.stringify(paragonThemeOutput, null, 2)}\n`); }); - - postCSS([ - ...commonPostCssPlugins, - postCSSMinify(), - ]) - .process(compiledStyleSheet.css, { from: stylesPath, map: { inline: false } }) - .then(result => { - fs.writeFileSync(`${outDir}/${name}.min.css`, result.css); - }); }; program diff --git a/styles/css/core/custom-media-breakpoints.css b/styles/css/core/custom-media-breakpoints.css index 4f3fed60ac..68498b2ffa 100644 --- a/styles/css/core/custom-media-breakpoints.css +++ b/styles/css/core/custom-media-breakpoints.css @@ -1,7 +1,7 @@ /** * IMPORTANT: This file is the result of assembling design tokens * Do not edit directly - * Generated on Sun, 04 Jun 2023 14:05:19 GMT + * Generated on Sun, 04 Jun 2023 18:39:23 GMT */ @custom-media --min-pgn-size-breakpoint-xs (min-width: 0); diff --git a/styles/css/core/variables.css b/styles/css/core/variables.css index df7d52bf59..7289f5000b 100644 --- a/styles/css/core/variables.css +++ b/styles/css/core/variables.css @@ -1,7 +1,7 @@ /** * IMPORTANT: This file is the result of assembling design tokens * Do not edit directly - * Generated on Sun, 04 Jun 2023 14:05:19 GMT + * Generated on Sun, 04 Jun 2023 18:39:23 GMT */ :root { diff --git a/styles/css/themes/light/utility-classes.css b/styles/css/themes/light/utility-classes.css index 20832db2cd..54e432c06e 100644 --- a/styles/css/themes/light/utility-classes.css +++ b/styles/css/themes/light/utility-classes.css @@ -1,7 +1,7 @@ /** * IMPORTANT: This file is the result of assembling design tokens * Do not edit directly - * Generated on Sun, 04 Jun 2023 14:05:19 GMT + * Generated on Sun, 04 Jun 2023 18:39:23 GMT */ .bg-accent-a { diff --git a/styles/css/themes/light/variables.css b/styles/css/themes/light/variables.css index 9a5d9acd05..03209c4db0 100644 --- a/styles/css/themes/light/variables.css +++ b/styles/css/themes/light/variables.css @@ -1,7 +1,7 @@ /** * IMPORTANT: This file is the result of assembling design tokens * Do not edit directly - * Generated on Sun, 04 Jun 2023 14:05:19 GMT + * Generated on Sun, 04 Jun 2023 18:39:23 GMT */ :root {