Skip to content

Commit a0afdb2

Browse files
authored
Merge pull request #13434 from TylerAPfledderer/refactor/shadcn-complimentary-colors
refactor(global.css): add complementary color semantics
2 parents 3b2bc10 + 2fae5f4 commit a0afdb2

File tree

2 files changed

+54
-4
lines changed

2 files changed

+54
-4
lines changed

src/styles/global.css

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
@layer base {
66
:root {
7-
87
--font-inter: Inter, sans-serif;
98
--font-mono: "IBM Plex Mono", Courier, monospace;
109

@@ -85,6 +84,24 @@
8584
/* ! Deprecating neutral */
8685
--neutral: white;
8786

87+
/* Complementary Set */
88+
--attention: var(--yellow-500);
89+
--attention-light: var(--yellow-200);
90+
--attention-outline: var(--attention);
91+
92+
/* ? Keep "error" or rename to "fail" ? */
93+
--error: var(--red-500);
94+
--error-light: var(--red-100);
95+
--error-outline: var(--error);
96+
/* ! Deprecating error-neutral */
97+
--error-neutral: var(--red-100);
98+
99+
--success: var(--green-500);
100+
--success-light: var(--green-100);
101+
--success-outline: var(--success);
102+
/* ! Deprecating success-neutral */
103+
--success-neutral: var(--green-100);
104+
88105
/* Misc sematics: light mode */
89106
--tooltip-shadow: rgba(0, 0, 0, 0.24);
90107
--switch-background: var(--gray-300);
@@ -128,6 +145,17 @@
128145
/* ! Deprecating neutral */
129146
--neutral: var(--gray-900);
130147

148+
/* Complementary Set */
149+
--attention-outline: var(--attention-light);
150+
151+
--error-light: var(--error-light);
152+
/* ! Deprecating error-neutral */
153+
--error-netural: var(--red-900);
154+
155+
--success-outline: var(--success-light);
156+
/* ! Deprecating success-neutral */
157+
--success-neutral: var(--green-900);
158+
131159
/* Misc sematics: light mode */
132160
--tooltip-shadow: rgba(255, 255, 255, 0.24);
133161
--switch-background: rgba(255, 255, 255, 0.24);
@@ -146,15 +174,20 @@
146174

147175
@layer base {
148176
body {
149-
@apply bg-background font-body text-body text-sm lg:text-md;
177+
@apply bg-background font-body text-sm text-body lg:text-md;
150178
}
151179

152180
a {
153181
@apply text-primary underline;
154182
}
155183

156-
h1, h2, h3, h4, h5, h6 {
157-
@apply font-bold
184+
h1,
185+
h2,
186+
h3,
187+
h4,
188+
h5,
189+
h6 {
190+
@apply font-bold;
158191
}
159192

160193
h1 {

tailwind.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,23 @@ const config = {
6363
"tooltip-shadow": "var(--tooltip-shadow)",
6464
"switch-background": "var(--switch-background)",
6565
"hub-hero-content-bg": "var(--hub-hero-content-bg)",
66+
attention: {
67+
DEFAULT: "var(--attention)",
68+
light: "var(--attention-light)",
69+
outline: "var(--attention-outline)",
70+
},
71+
error: {
72+
DEFAULT: "var(--error)",
73+
light: "var(--error-light)",
74+
outline: "var(--error-outline)",
75+
neutral: "var(--error-neutral)",
76+
},
77+
success: {
78+
DEFAULT: "var(--success)",
79+
light: "var(--success-light)",
80+
outline: "var(--success-outline)",
81+
neutral: "var(--success-neutral)",
82+
},
6683
},
6784
backgroundImage: {
6885
"bg-main-gradient": "var(--bg-main-gradient)",

0 commit comments

Comments
 (0)