irongit

use variables for text-shadow

huncholanehuncholaneauthored
parent b3092b7commit b7ff510cf06ae8075b770fd624d81febaaed2681Browse files

2 files changed, +22 -4

+6-4twench_landing_page/app/globals.css
@@ -5,6 +5,10 @@
55 :root {
66 --background: #394b37;
77 --foreground: #171717;
8+ --ts-small: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000,
9+ 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000;
10+ --ts-medium: 4px 4px 0 #000, -4px -4px 0 #000, 4px -4px 0 #000,
11+ -4px 4px 0 #000, 4px 0 0 #000, -4px 0 0 #000, 0 4px 0 #000, 0 -4px 0 #000;
812 }
913
1014 body {
@@ -23,11 +27,9 @@ body {
2327 }
2428
2529 .small-text-shadow {
26- text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000,
27- -2px 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000;
30+ text-shadow: var(--ts-small);
2831 }
2932
3033 .text-shadow {
31- text-shadow: 4px 4px 0 #000, -4px -4px 0 #000, 4px -4px 0 #000,
32- -4px 4px 0 #000, 4px 0 0 #000, -4px 0 0 #000, 0 4px 0 #000, 0 -4px 0 #000;
34+ text-shadow: var(--ts-medium);
3335 }
+16-0twench_landing_page/plugins/text-shadow.ts
@@ -0,0 +1,16 @@
1+import plugin from "tailwindcss/plugin";
2+
3+const textShadowPlugin = plugin(function ({ matchUtilities, theme }) {
4+ matchUtilities(
5+ {
6+ "text-shadow": (value: string) => ({
7+ textShadow: value,
8+ }),
9+ },
10+ {
11+ values: theme("textShadow"),
12+ }
13+ );
14+});
15+
16+export default textShadowPlugin;