Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): use CSS layer to let user customize app - WF-57 #710

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading