Skip to content

Commit 096468e

Browse files
committed
Fix!: scoped base tailwind styles to avoid conflicts
1 parent d9a59a7 commit 096468e

File tree

7 files changed

+21
-5
lines changed

7 files changed

+21
-5
lines changed

bun.lockb

464 Bytes
Binary file not shown.

esbuild.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const options = {
3131
},
3232
plugins: [cleaner],
3333
legalComments: "none",
34-
external: ["react", "react-dom", "@dreamworld/addon-redux"]
34+
external: ["react", "react-dom", "@dreamworld/addon-redux", "tailwindcss-scoped-preflight"]
3535
};
3636

3737
build({

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@
116116
"sonner": "1.5.0",
117117
"storybook": "7.3.2",
118118
"storybook-addon-deep-controls": "0.2.1",
119-
"tailwindcss": "3.4.1",
119+
"tailwindcss": "3.4.6",
120120
"tailwindcss-animate": "1.0.6",
121+
"tailwindcss-scoped-preflight": "3.4.3",
121122
"tsc-alias": "1.8.8",
122123
"vite": "4.5.2"
123124
},
@@ -127,5 +128,6 @@
127128
},
128129
"patchedDependencies": {
129130
130-
}
131+
},
132+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
131133
}

src/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Provider } from "react-redux";
2+
import { twMerge } from "tailwind-merge";
23
import { default as Core, TooltipProvider } from "@/components";
34
import { store } from "@/store";
45
import { type ISTKProps } from "./types";
@@ -11,7 +12,12 @@ export const SeatToolkit = (props: ISTKProps) => {
1112
return (
1213
<Provider store={store}>
1314
<TooltipProvider>
14-
<Core {...props} />
15+
<div
16+
className={twMerge("stk-core", props.styles?.core?.container?.className)}
17+
style={props.styles?.core?.container?.properties}
18+
>
19+
<Core {...props} />
20+
</div>
1521
</TooltipProvider>
1622
</Provider>
1723
);

src/styles/storybook.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ body,
44
#storybook-root {
55
min-height: 100% !important;
66
height: 100% !important;
7+
font-family: "Inter", sans-serif !important;
78
}
89
body {
910
margin-right: 0px !important;

src/types/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export interface IStyles {
8787
};
8888
};
8989
core?: {
90+
container?: IStyle;
9091
button?: IStyle;
9192
};
9293
}

tailwind.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import animate from "tailwindcss-animate";
2+
import { isolateInsideOfContainer, scopedPreflightStyles } from "tailwindcss-scoped-preflight";
23

34
export const screens = {
45
xs: "400px",
@@ -26,5 +27,10 @@ export default {
2627
}
2728
}
2829
},
29-
plugins: [animate]
30+
plugins: [
31+
animate,
32+
scopedPreflightStyles({
33+
isolationStrategy: isolateInsideOfContainer(".stk-core")
34+
})
35+
]
3036
};

0 commit comments

Comments
 (0)