irongit

text shadow plugin is easy to import

huncholanehuncholaneauthored
parent 32c2c15commit 55a1b671c58a539220cd89ed73590bb163c1b3d2Browse files

2 files changed, +32 -19

+32-12twench_landing_page/plugins/text-shadow.ts
@@ -1,17 +1,37 @@
1+import { text } from "stream/consumers";
12 import plugin from "tailwindcss/plugin";
23
3-const textShadowPlugin = plugin(function ({ matchUtilities, theme }) {
4- matchUtilities(
5- {
6- "text-shadow": (value: string) => ({
7- textShadow: `${value} ${value} 0 #000, -${value} -${value} 0 #000, ${value} -${value} 0 #000,
8- -${value} ${value} 0 #000, ${value} 0 0 #000, -${value} 0 0 #000, 0 ${value} 0 #000, 0 -${value} 0 #000;`,
9- }),
4+function textShadow(value: string) {
5+ return {
6+ textShadow: `${value} ${value} 0 #000, -${value} -${value} 0 #000, ${value} -${value} 0 #000,
7+ -${value} ${value} 0 #000, ${value} 0 0 #000, -${value} 0 0 #000, 0 ${value} 0 #000, 0 -${value} 0 #000;`,
8+ };
9+}
10+
11+const textShadowPlugin = plugin(
12+ function ({ matchUtilities, theme }) {
13+ matchUtilities(
14+ {
15+ "text-shadow": (value: string) => ({
16+ textShadow: textShadow(value),
17+ }),
18+ },
19+ {
20+ values: theme("textShadow"),
21+ }
22+ );
23+ },
24+ {
25+ theme: {
26+ textShadow: {
27+ DEFAULT: "1px",
28+ sm: "2px",
29+ md: "3px",
30+ lg: "4px",
31+ xl: "5px",
32+ },
1033 },
11- {
12- values: theme("textShadow"),
13- }
14- );
15-});
34+ }
35+);
1636
1737 export default textShadowPlugin;
+0-7twench_landing_page/tailwind.config.ts
@@ -13,13 +13,6 @@ const config: Config = {
1313 background: "var(--background)",
1414 foreground: "var(--foreground)",
1515 },
16- textShadow: {
17- DEFAULT: "1px",
18- sm: "2px",
19- md: "3px",
20- lg: "4px",
21- xl: "5px",
22- },
2316 },
2417 },
2518 plugins: [textShadowPlugin],