Skip to content

Commit

Permalink
Merge pull request #710 from madeindjs/WF-57
Browse files Browse the repository at this point in the history
feat(ui): use CSS layer to let user customize app - WF-57
  • Loading branch information
ramedina86 authored Jan 7, 2025
2 parents 54623ff + ddfae0b commit f9c960e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 9 deletions.
54 changes: 45 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-storybook": "0.8.0",
"eslint-plugin-vue": "^9.28.0",
"postcss": "^8.4.49",
"postcss-assign-layer": "^0.4.0",
"prettier": "3.2.5",
"storybook": "8.0.5",
"vite": "^5.2.7",
Expand Down
11 changes: 11 additions & 0 deletions src/ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { fileURLToPath, URL } from "url";
import { defineConfig, UserConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import writerPlugin from "./viteWriterPlugin";
import postcssAssignLayer from "postcss-assign-layer";

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -11,6 +12,16 @@ export default defineConfig({
define: {
WRITER_LIVE_CCT: JSON.stringify("no"),
},
css: {
postcss: {
plugins: [
// we move all our CSS into Cascade layers to let the user's stylesheets have more priority
postcssAssignLayer([
{ include: "**/*/*.css", layerName: "wf" },
]),
],
},
},
build: {
outDir: "../writer/static",
emptyOutDir: true,
Expand Down

0 comments on commit f9c960e

Please sign in to comment.