Skip to content

Commit 3eaec29

Browse files
authored
Merge pull request #4 from code-for-canada/feat/eyebrow-color-variants
feat(eyebrow): add purple and blue color variants
2 parents 445c582 + 289a322 commit 3eaec29

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@code-for-canada/ui": minor
3+
---
4+
5+
Add `purple` and `blue` color variants to `Eyebrow`
6+
7+
`Eyebrow` now accepts `color="purple"` and `color="blue"` in addition to `"red"`, matching the brand colors already available on `IconCircle`. Text shades (`red-600`, `purple-800`, `blue-800`) are picked for legibility as on-white text.

src/components/typography.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ function Heading({ className, size, as: Component, ...props }: HeadingProps) {
9292

9393
// Eyebrow - Uppercase section labels
9494
// Default text follows the surrounding scheme (--scheme-muted), falling back
95-
// to the brand primary when no scheme is set. `color="red"` forces brand red.
95+
// to the brand primary when no scheme is set. Passing `color` pins to a fixed
96+
// brand value regardless of scheme.
9697
const eyebrowVariants = cva(
9798
"font-semibold uppercase leading-none text-[var(--scheme-muted,var(--primary))]",
9899
{
@@ -104,6 +105,8 @@ const eyebrowVariants = cva(
104105
},
105106
color: {
106107
red: "text-c4c-red-600",
108+
purple: "text-c4c-purple-800",
109+
blue: "text-c4c-blue-800",
107110
},
108111
},
109112
defaultVariants: {
@@ -112,7 +115,7 @@ const eyebrowVariants = cva(
112115
}
113116
);
114117

115-
export type EyebrowColor = "red"
118+
export type EyebrowColor = "red" | "purple" | "blue"
116119

117120
interface EyebrowProps
118121
extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color">,
@@ -121,7 +124,7 @@ interface EyebrowProps
121124
icon?: React.ReactNode;
122125
}
123126

124-
/** Uppercase section label above a heading. Use sparingly — only with longer "editorial" headings to aid scanning. Keep to 1–4 words. Colour follows the surrounding scheme (or the brand red when no scheme is set); `color="red"` pins to brand red regardless of scheme. Optional `icon` shows a matching circle. */
127+
/** Uppercase section label above a heading. Use sparingly — only with longer "editorial" headings to aid scanning. Keep to 1–4 words. Colour follows the surrounding scheme (or the brand red when no scheme is set); pass `color` (red | purple | blue) to pin a fixed brand colour regardless of scheme. Optional `icon` shows a matching circle. */
125128
function Eyebrow({
126129
className,
127130
size,

0 commit comments

Comments
 (0)