Skip to content

Commit

Permalink
feat: prefix the css class names (#163)
Browse files Browse the repository at this point in the history
* feat: prefix the css class names

* chore: css remove hash

* chore: restore css class name hash
  • Loading branch information
Benehiko authored Oct 17, 2023
1 parent d1cfe00 commit 11a97ff
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
13 changes: 12 additions & 1 deletion packages/markup/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
13 changes: 12 additions & 1 deletion packages/preact/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
9 changes: 9 additions & 0 deletions packages/react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 11a97ff

Please sign in to comment.