Skip to content

Commit

Permalink
Breaking: Switch to modules for PostCSS and TailwindCSS
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Mar 27, 2024
1 parent a6a1991 commit d4dcd55
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
26 changes: 0 additions & 26 deletions Installer/Distribution/Defaults/.postcssrc.js

This file was deleted.

28 changes: 28 additions & 0 deletions Installer/Distribution/Defaults/.postcssrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export default function (ctx) {
return {
plugins: {
"postcss-import": {
resolve: ctx.resolve,
},
"tailwindcss/nesting": true,
tailwindcss: ctx.tailwindcss,
"postcss-assets": {
cachebuster: false,
basePath: `${ctx.basePath}/`,
baseUrl: "/_Resources/Static/Packages",
loadPaths: ["**/Resources/Public/**/*"],
},
"postcss-clip-path-polyfill": true,
"postcss-sort-media-queries": true,
autoprefixer: true,
cssnano: ctx.minify
? {
preset: ["default", { discardComments: { removeAll: true }, svgo: false }],
}
: false,
"postcss-reporter": {
clearReportedMessages: true,
},
},
};
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const content = require("./Build/Carbon.Pipeline/purge");
import content from "./Build/Carbon.Pipeline/content";

/** @type {import('tailwindcss').Config} */
module.exports = {
export default {
content,
theme: {
extend: {},
Expand Down
2 changes: 1 addition & 1 deletion defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ sassOptions: null
# Pass options to the postcss config file
postcssOptions:
tailwindcss:
config: './tailwind.config.js'
config: './tailwind.config.mjs'
additionalPackagePathPrefixes: []

esbuild:
Expand Down

0 comments on commit d4dcd55

Please sign in to comment.