Skip to content

Commit 7e2b1cd

Browse files
committed
refactor(ui): replace CSS module files with Tailwind classnames
Extend tailwind.config.js with cs-* design tokens and font families so components can reference bg-cs-surface, text-cs-orange, font-cs-mono etc. Delete all 11 index.module.css files and inline their styles as Tailwind utility classes. Dynamic color-mix() values derived from runtime props remain as style={} attributes.
1 parent 5743c5d commit 7e2b1cd

23 files changed

Lines changed: 145 additions & 1186 deletions

File tree

crowdsec-docs/src/components/docs/AccessCard/index.module.css

Lines changed: 0 additions & 74 deletions
This file was deleted.

crowdsec-docs/src/components/docs/AccessCard/index.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from "react";
2-
import styles from "./index.module.css";
32

43
type Props = {
54
icon?: React.ReactNode;
@@ -28,18 +27,23 @@ function DefaultIcon() {
2827

2928
export default function AccessCard({ icon, title, command, ctaLabel, ctaHref }: Props) {
3029
return (
31-
<div className={styles.card}>
32-
<div className={styles.top}>
33-
<div className={styles.iconWrap}>{icon ?? <DefaultIcon />}</div>
34-
<div className={styles.title}>{title}</div>
30+
<div className="flex flex-col gap-3 py-5 px-[22px] bg-cs-surface border border-cs-border-hi rounded-xl my-4">
31+
<div className="flex items-center gap-3">
32+
<div className="w-[38px] h-[38px] rounded-[9px] bg-cs-orange-soft border border-[color-mix(in_srgb,var(--cs-orange)_25%,transparent)] flex items-center justify-center text-cs-orange shrink-0 [&>svg]:w-[18px] [&>svg]:h-[18px]">
33+
{icon ?? <DefaultIcon />}
34+
</div>
35+
<div className="text-[14.5px] font-semibold text-cs-ink">{title}</div>
3536
</div>
3637
{command && (
37-
<div className={styles.command}>
38+
<div className="flex items-center gap-2 py-[9px] px-[14px] bg-cs-bg border border-cs-border rounded-[7px] font-cs-mono text-[12.5px] text-cs-teal">
3839
<span style={{ color: "var(--cs-ink-mute)" }}>$</span>
3940
<span>{command}</span>
4041
</div>
4142
)}
42-
<a href={ctaHref} className={styles.cta}>
43+
<a
44+
href={ctaHref}
45+
className="inline-flex items-center gap-1.5 py-2 px-[18px] rounded-[7px] bg-cs-orange text-[#0a1120] text-[13px] font-semibold no-underline transition-opacity duration-150 self-start hover:opacity-[0.85] hover:no-underline hover:text-[#0a1120]"
46+
>
4347
{ctaLabel}
4448
</a>
4549
</div>

crowdsec-docs/src/components/docs/ChallengeGrid/index.module.css

Lines changed: 0 additions & 56 deletions
This file was deleted.

crowdsec-docs/src/components/docs/ChallengeGrid/index.tsx

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,7 @@ type Props = {
1616

1717
export default function ChallengeGrid({ challenges }: Props) {
1818
return (
19-
<div
20-
style={{
21-
display: "grid",
22-
gridTemplateColumns: "repeat(2, 1fr)",
23-
gap: 14,
24-
margin: "20px 0",
25-
}}
26-
>
19+
<div className="grid grid-cols-2 gap-[14px] my-5">
2720
{challenges.map((c, i) => {
2821
const iconEl =
2922
c.icon ??
@@ -34,16 +27,9 @@ export default function ChallengeGrid({ challenges }: Props) {
3427
<div
3528
// biome-ignore lint/suspicious/noArrayIndexKey: challenges have no stable id
3629
key={i}
37-
style={{
38-
position: "relative",
39-
padding: 18,
40-
borderRadius: 12,
41-
background: "var(--cs-surface)",
42-
border: "1px solid var(--cs-border)",
43-
overflow: "hidden",
44-
}}
30+
className="relative p-[18px] rounded-xl bg-cs-surface border border-cs-border overflow-hidden"
4531
>
46-
<div style={{ display: "flex", alignItems: "center", gap: 12, marginBottom: 10 }}>
32+
<div className="flex items-center gap-3 mb-[10px]">
4733
{iconEl && (
4834
<div
4935
style={{
@@ -62,29 +48,12 @@ export default function ChallengeGrid({ challenges }: Props) {
6248
<div style={{ width: 17, height: 17, display: "flex" }}>{iconEl}</div>
6349
</div>
6450
)}
65-
<div
66-
style={{
67-
fontFamily: "var(--cs-font-mono)",
68-
fontSize: 11,
69-
color: "var(--cs-ink-mute)",
70-
letterSpacing: "0.10em",
71-
}}
72-
>
51+
<div className="font-cs-mono text-[11px] text-cs-ink-mute tracking-[0.10em]">
7352
{String(i + 1).padStart(2, "0")}
7453
</div>
7554
</div>
76-
<div
77-
style={{
78-
fontSize: 15,
79-
fontWeight: 600,
80-
color: "var(--cs-ink)",
81-
marginBottom: 6,
82-
letterSpacing: "-0.005em",
83-
}}
84-
>
85-
{c.title}
86-
</div>
87-
<div style={{ fontSize: 13.5, color: "var(--cs-ink-dim)", lineHeight: 1.55 }}>{c.body}</div>
55+
<div className="text-[15px] font-semibold text-cs-ink mb-[6px] tracking-[-0.005em]">{c.title}</div>
56+
<div className="text-[13.5px] text-cs-ink-dim leading-[1.55]">{c.body}</div>
8857
</div>
8958
);
9059
})}

crowdsec-docs/src/components/docs/ConsoleMockup/index.module.css

Lines changed: 0 additions & 34 deletions
This file was deleted.

crowdsec-docs/src/components/docs/ConsoleMockup/index.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import styles from "./index.module.css";
2-
31
export default function ConsoleMockup() {
42
return (
5-
<div className={styles.wrap}>
6-
<div className={styles.titleBar}>
7-
<div className={styles.dot} style={{ background: "#FF5F57" }} />
8-
<div className={styles.dot} style={{ background: "#FFBD2E" }} />
9-
<div className={styles.dot} style={{ background: "#28C840" }} />
10-
<span className={styles.titleText}>app.crowdsec.net — Console</span>
3+
<div className="rounded-xl overflow-hidden border border-cs-border-hi bg-cs-surface my-6">
4+
<div className="flex items-center gap-1.5 py-[10px] px-4 bg-cs-surface-2 border-b border-cs-border">
5+
<div className="w-2.5 h-2.5 rounded-full" style={{ background: "#FF5F57" }} />
6+
<div className="w-2.5 h-2.5 rounded-full" style={{ background: "#FFBD2E" }} />
7+
<div className="w-2.5 h-2.5 rounded-full" style={{ background: "#28C840" }} />
8+
<span className="ml-2 font-cs-mono text-[11px] text-cs-ink-mute">app.crowdsec.net — Console</span>
119
</div>
1210
<svg
13-
className={styles.svg}
11+
className="w-full block"
1412
viewBox="0 0 800 420"
1513
xmlns="http://www.w3.org/2000/svg"
1614
aria-label="CrowdSec Console dashboard preview"

crowdsec-docs/src/components/docs/DocsHero/index.module.css

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)