From f65c00d71a3ff3b692fa1a88c9d647c57ccb7444 Mon Sep 17 00:00:00 2001 From: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:17:52 +0200 Subject: [PATCH 1/3] feat: prefix the css class names --- packages/markup/vite.config.ts | 13 ++++++++++++- packages/preact/vite.config.ts | 13 ++++++++++++- packages/react/vite.config.ts | 9 +++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/markup/vite.config.ts b/packages/markup/vite.config.ts index 6ebee2197..1f46b6589 100644 --- a/packages/markup/vite.config.ts +++ b/packages/markup/vite.config.ts @@ -10,7 +10,18 @@ import { viteStaticCopy } from "vite-plugin-static-copy" export default defineConfig({ plugins: [ - vanillaExtractPlugin(), + vanillaExtractPlugin({ + emitCssInSsr: true, + identifiers: ({ hash, filePath, debugId }) => { + const name = filePath + .split("/") + ?.pop() + ?.split(".")[0] + ?.replace("-", "_") + const id = debugId ? "_" + debugId : "" + return `ory_elements__${name}${id}__${hash}` + }, + }), dts({ insertTypesEntry: true }), react(), viteStaticCopy({ diff --git a/packages/preact/vite.config.ts b/packages/preact/vite.config.ts index 5af9556ba..9edbc8107 100644 --- a/packages/preact/vite.config.ts +++ b/packages/preact/vite.config.ts @@ -32,7 +32,18 @@ export default defineConfig({ }, }, plugins: [ - vanillaExtractPlugin(), + vanillaExtractPlugin({ + emitCssInSsr: true, + identifiers: ({ hash, filePath, debugId }) => { + const name = filePath + .split("/") + ?.pop() + ?.split(".")[0] + ?.replace("-", "_") + const id = debugId ? "_" + debugId : "" + return `ory_elements__${name}${id}__${hash}` + }, + }), dts({ insertTypesEntry: true }), preact(), viteStaticCopy({ diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts index d026cecfe..aa3eba5fe 100644 --- a/packages/react/vite.config.ts +++ b/packages/react/vite.config.ts @@ -21,6 +21,15 @@ export default defineConfig({ plugins: [ vanillaExtractPlugin({ emitCssInSsr: true, + identifiers: ({ hash, filePath, debugId }) => { + const name = filePath + .split("/") + ?.pop() + ?.split(".")[0] + ?.replace("-", "_") + const id = debugId ? "_" + debugId : "" + return `ory_elements__${name}${id}__${hash}` + }, }), dts({ insertTypesEntry: true, From 0ff4fc89bca692ba482653843ca7404a836497c6 Mon Sep 17 00:00:00 2001 From: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:23:39 +0200 Subject: [PATCH 2/3] chore: css remove hash --- packages/markup/vite.config.ts | 4 ++-- packages/preact/vite.config.ts | 4 ++-- packages/react/vite.config.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/markup/vite.config.ts b/packages/markup/vite.config.ts index 1f46b6589..4f263b22e 100644 --- a/packages/markup/vite.config.ts +++ b/packages/markup/vite.config.ts @@ -12,14 +12,14 @@ export default defineConfig({ plugins: [ vanillaExtractPlugin({ emitCssInSsr: true, - identifiers: ({ hash, filePath, debugId }) => { + identifiers: ({ filePath, debugId }) => { const name = filePath .split("/") ?.pop() ?.split(".")[0] ?.replace("-", "_") const id = debugId ? "_" + debugId : "" - return `ory_elements__${name}${id}__${hash}` + return `ory_elements__${name}${id}` }, }), dts({ insertTypesEntry: true }), diff --git a/packages/preact/vite.config.ts b/packages/preact/vite.config.ts index 9edbc8107..11bfcaa21 100644 --- a/packages/preact/vite.config.ts +++ b/packages/preact/vite.config.ts @@ -34,14 +34,14 @@ export default defineConfig({ plugins: [ vanillaExtractPlugin({ emitCssInSsr: true, - identifiers: ({ hash, filePath, debugId }) => { + identifiers: ({ filePath, debugId }) => { const name = filePath .split("/") ?.pop() ?.split(".")[0] ?.replace("-", "_") const id = debugId ? "_" + debugId : "" - return `ory_elements__${name}${id}__${hash}` + return `ory_elements__${name}${id}` }, }), dts({ insertTypesEntry: true }), diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts index aa3eba5fe..f5d403649 100644 --- a/packages/react/vite.config.ts +++ b/packages/react/vite.config.ts @@ -21,14 +21,14 @@ export default defineConfig({ plugins: [ vanillaExtractPlugin({ emitCssInSsr: true, - identifiers: ({ hash, filePath, debugId }) => { + identifiers: ({ filePath, debugId }) => { const name = filePath .split("/") ?.pop() ?.split(".")[0] ?.replace("-", "_") const id = debugId ? "_" + debugId : "" - return `ory_elements__${name}${id}__${hash}` + return `ory_elements__${name}${id}` }, }), dts({ From a8fcc3fa3157571effe84905c5e7644708364cab Mon Sep 17 00:00:00 2001 From: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:38:00 +0200 Subject: [PATCH 3/3] chore: restore css class name hash --- packages/markup/vite.config.ts | 4 ++-- packages/preact/vite.config.ts | 4 ++-- packages/react/vite.config.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/markup/vite.config.ts b/packages/markup/vite.config.ts index 4f263b22e..1f46b6589 100644 --- a/packages/markup/vite.config.ts +++ b/packages/markup/vite.config.ts @@ -12,14 +12,14 @@ export default defineConfig({ plugins: [ vanillaExtractPlugin({ emitCssInSsr: true, - identifiers: ({ filePath, debugId }) => { + identifiers: ({ hash, filePath, debugId }) => { const name = filePath .split("/") ?.pop() ?.split(".")[0] ?.replace("-", "_") const id = debugId ? "_" + debugId : "" - return `ory_elements__${name}${id}` + return `ory_elements__${name}${id}__${hash}` }, }), dts({ insertTypesEntry: true }), diff --git a/packages/preact/vite.config.ts b/packages/preact/vite.config.ts index 11bfcaa21..9edbc8107 100644 --- a/packages/preact/vite.config.ts +++ b/packages/preact/vite.config.ts @@ -34,14 +34,14 @@ export default defineConfig({ plugins: [ vanillaExtractPlugin({ emitCssInSsr: true, - identifiers: ({ filePath, debugId }) => { + identifiers: ({ hash, filePath, debugId }) => { const name = filePath .split("/") ?.pop() ?.split(".")[0] ?.replace("-", "_") const id = debugId ? "_" + debugId : "" - return `ory_elements__${name}${id}` + return `ory_elements__${name}${id}__${hash}` }, }), dts({ insertTypesEntry: true }), diff --git a/packages/react/vite.config.ts b/packages/react/vite.config.ts index f5d403649..aa3eba5fe 100644 --- a/packages/react/vite.config.ts +++ b/packages/react/vite.config.ts @@ -21,14 +21,14 @@ export default defineConfig({ plugins: [ vanillaExtractPlugin({ emitCssInSsr: true, - identifiers: ({ filePath, debugId }) => { + identifiers: ({ hash, filePath, debugId }) => { const name = filePath .split("/") ?.pop() ?.split(".")[0] ?.replace("-", "_") const id = debugId ? "_" + debugId : "" - return `ory_elements__${name}${id}` + return `ory_elements__${name}${id}__${hash}` }, }), dts({