Skip to content

Commit

Permalink
feat: add prefix to tokens to avoid shadowing (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnyTheCarrot committed Aug 17, 2023
1 parent c2b48c5 commit 2de589a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"types": "dist/index.d.ts",
"scripts": {
"i18n-extract": "i18next 'src/**/*.tsx' --config i18next-parser.config.mjs",
"build": "pnpm run i18n-extract && vite build",
"build": "vite build",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"prepublishOnly": "pnpm build",
Expand Down
3 changes: 3 additions & 0 deletions src/Stitches/stitches.config.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { createStitches } from "@stitches/react";

export const prefix = "wb-msg";

const stitches = createStitches({
prefix,
theme: {
colors: {
primaryOpacity10: "rgba(255, 255, 255, 0.1)",
Expand Down
4 changes: 2 additions & 2 deletions src/stories/Wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import type {
Snowflake,
} from "discord-api-types/v10";
import { ChannelType, GuildNSFWLevel } from "discord-api-types/v10";
import { globalCss, styled, theme } from "../Stitches/stitches.config";
import { globalCss, prefix, styled, theme } from "../Stitches/stitches.config";
import getDisplayName from "../utils/getDisplayName";
import type {
ChatBadgeProps,
Expand Down Expand Up @@ -357,7 +357,7 @@ const globalStyles = globalCss({
});

const StorybookStyles = styled("div", {
"--fonts-main":
[`--${prefix}-fonts-main`]:
'"gg sans","Noto Sans","Helvetica Neue",Helvetica,Arial,sans-serif',
fontFamily: theme.fonts.main,
padding: 40,
Expand Down

0 comments on commit 2de589a

Please sign in to comment.