Skip to content

Commit 58b4ad2

Browse files
committed
Add per-tech badge colors and data-badge attr
Emit a data-badge attribute for each resource badge and add CSS rules to style badges per technology (ESX, QBCore, Lua, JavaScript, Discord, FiveM, Standalone). Includes light/dark theme variants and retains a default fallback, replacing the previous generic dark-mode badge rule so badges get distinct, theme-aware colors.
1 parent 043f3da commit 58b4ad2

2 files changed

Lines changed: 76 additions & 6 deletions

File tree

src/pages/index.module.css

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,86 @@
148148
font-weight: 600;
149149
padding: 0.2rem 0.55rem;
150150
border-radius: 999px;
151-
background: var(--ifm-color-primary-lightest);
152-
color: var(--ifm-color-primary-darkest);
153151
white-space: nowrap;
154152
text-transform: uppercase;
155153
letter-spacing: 0.04em;
154+
/* default fallback */
155+
background: var(--ifm-color-primary-lightest);
156+
color: var(--ifm-color-primary-darkest);
157+
}
158+
159+
/* ── Badge colors per technology ── */
160+
161+
/* ESX — orange-red */
162+
.cardBadge[data-badge="ESX"] {
163+
background: #fff0e6;
164+
color: #c94a00;
165+
}
166+
[data-theme='dark'] .cardBadge[data-badge="ESX"] {
167+
background: #3d1a00;
168+
color: #ff874d;
169+
}
170+
171+
/* QBCore — violet */
172+
.cardBadge[data-badge="QBCore"] {
173+
background: #f0edff;
174+
color: #5b3fcf;
175+
}
176+
[data-theme='dark'] .cardBadge[data-badge="QBCore"] {
177+
background: #1f1545;
178+
color: #a68fff;
179+
}
180+
181+
/* Lua — dark blue */
182+
.cardBadge[data-badge="Lua"] {
183+
background: #e8eeff;
184+
color: #1a3a8f;
185+
}
186+
[data-theme='dark'] .cardBadge[data-badge="Lua"] {
187+
background: #0d1f4d;
188+
color: #7fa3ff;
189+
}
190+
191+
/* JavaScript — classic yellow */
192+
.cardBadge[data-badge="Javascript"],
193+
.cardBadge[data-badge="JavaScript"] {
194+
background: #fefac0;
195+
color: #7a6000;
196+
}
197+
[data-theme='dark'] .cardBadge[data-badge="Javascript"],
198+
[data-theme='dark'] .cardBadge[data-badge="JavaScript"] {
199+
background: #3d3000;
200+
color: #f7df1e;
201+
}
202+
203+
/* Discord — blurple */
204+
.cardBadge[data-badge="Discord"] {
205+
background: #edefff;
206+
color: #3b45c4;
207+
}
208+
[data-theme='dark'] .cardBadge[data-badge="Discord"] {
209+
background: #1a1d4d;
210+
color: #8891ff;
211+
}
212+
213+
/* FiveM — red */
214+
.cardBadge[data-badge="FiveM"] {
215+
background: #ffecec;
216+
color: #b91c1c;
217+
}
218+
[data-theme='dark'] .cardBadge[data-badge="FiveM"] {
219+
background: #3d0a0a;
220+
color: #ff7070;
156221
}
157222

158-
[data-theme='dark'] .cardBadge {
159-
background: var(--ifm-color-primary-darkest);
160-
color: var(--ifm-color-primary-lightest);
223+
/* Standalone — neutral gray */
224+
.cardBadge[data-badge="Standalone"] {
225+
background: #f0f0f0;
226+
color: #444;
227+
}
228+
[data-theme='dark'] .cardBadge[data-badge="Standalone"] {
229+
background: #2a2a2a;
230+
color: #ccc;
161231
}
162232

163233
.cardDescription {

src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function ResourceCard({ title, image, badges, description, to, features }: Resou
118118
</Heading>
119119
<div className={styles.cardBadges}>
120120
{badges.map((b) => (
121-
<span key={b} className={styles.cardBadge}>{b}</span>
121+
<span key={b} className={styles.cardBadge} data-badge={b}>{b}</span>
122122
))}
123123
</div>
124124
</div>

0 commit comments

Comments
 (0)