Skip to content

Commit 41f0cff

Browse files
committed
PRide banner
1 parent e21af31 commit 41f0cff

2 files changed

Lines changed: 50 additions & 44 deletions

File tree

src/lib/themeUtils.ts

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ export const themes: Theme[] = [
3333
{
3434
id: "rainbow",
3535
name: "Rainbow Pride",
36+
// Functional colors (links, buttons, gradients) use softened, readable
37+
// jewel tones so text stays legible. The full 6-color flag lives only in
38+
// decorative gradients (dot below, .gradient-hero/header/text in rainbow.css).
3639
colors: {
37-
primary: "#E40303", // Red
38-
secondary: "#FF8C00", // Orange
39-
accent: "#FFED00", // Yellow
40+
primary: "#D6336C", // Raspberry (readable on white & dark)
41+
secondary: "#7048E8", // Violet
42+
accent: "#0B7285", // Deep teal
4043
},
4144
dotGradient:
4245
"linear-gradient(to bottom right, #E40303 0%, #E40303 16.67%, #FF8C00 16.67%, #FF8C00 33.33%, #FFED00 33.33%, #FFED00 50%, #008026 50%, #008026 66.67%, #004CFF 66.67%, #004CFF 83.33%, #732982 83.33%, #732982 100%)",
@@ -278,34 +281,51 @@ export function getCurrentTheme(): string {
278281
* - id: stable identifier for the season (used to remember banner dismissal)
279282
* - themeId: the color theme auto-applied during this season
280283
* - banner: dismissable banner text shown during this season (empty string = no banner)
284+
* - command: optional faux IPython input rendered before the banner, e.g.
285+
* `celebrate('pride')`. Shown as `In [<month>]: <command>`.
286+
* - accentGradient: optional CSS gradient for the banner's top strip. Falls back
287+
* to the active theme's gradient when omitted.
281288
*/
282289
export interface SeasonalConfig {
283290
id: string;
284291
themeId: string;
285292
banner: string;
293+
command?: string;
294+
accentGradient?: string;
286295
}
287296

297+
// The authentic 6-color Pride flag as hard-edged horizontal bands.
298+
const PRIDE_FLAG_GRADIENT =
299+
"linear-gradient(to right, " +
300+
"#E40303 0 16.66%, #FF8C00 16.66% 33.33%, #FFED00 33.33% 50%, " +
301+
"#008026 50% 66.66%, #004CFF 66.66% 83.33%, #732982 83.33% 100%)";
302+
303+
const WINTER_SEASON: SeasonalConfig = {
304+
id: "winter",
305+
themeId: "winter",
306+
banner: "❄️ Happy holidays from the IPython team!",
307+
command: "celebrate('holidays')",
308+
accentGradient:
309+
"linear-gradient(to right, #0ea5e9, #38bdf8, #e0f2fe, #38bdf8, #0ea5e9)",
310+
};
311+
312+
const PRIDE_SEASON: SeasonalConfig = {
313+
id: "pride",
314+
themeId: "rainbow",
315+
banner:
316+
"🏳️‍🌈 Happy Pride Month! IPython celebrates and supports our diverse community.",
317+
command: "celebrate('pride')",
318+
accentGradient: PRIDE_FLAG_GRADIENT,
319+
};
320+
288321
/**
289322
* Seasonal configuration keyed by month (0 = January, 11 = December).
290-
* Edit the `banner` text here to change what the seasonal banner says.
323+
* Edit the `banner` text (and `command`) above to change what the banner says.
291324
*/
292325
export const seasonalConfigs: Record<number, SeasonalConfig> = {
293-
0: {
294-
id: "winter",
295-
themeId: "winter",
296-
banner: "❄️ Happy holidays from the IPython team!",
297-
},
298-
5: {
299-
id: "pride",
300-
themeId: "rainbow",
301-
banner:
302-
"🏳️‍🌈 Happy Pride Month! IPython celebrates and supports our diverse community.",
303-
},
304-
11: {
305-
id: "winter",
306-
themeId: "winter",
307-
banner: "❄️ Happy holidays from the IPython team!",
308-
},
326+
0: WINTER_SEASON,
327+
5: PRIDE_SEASON,
328+
11: WINTER_SEASON,
309329
};
310330

311331
/**

src/styles/themes/rainbow.css

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/* Rainbow theme */
2+
/* Functional colors are softened for readability (see themeUtils.ts, the live
3+
source — these mirror it as the pre-hydration fallback). The bright 6-color
4+
flag is kept only in the decorative gradients below. */
25
[data-color-theme="rainbow"] {
3-
--theme-primary: #e40303;
4-
--theme-secondary: #ff8c00;
5-
--theme-accent: #ffed00;
6+
--theme-primary: #d6336c; /* Raspberry */
7+
--theme-secondary: #7048e8; /* Violet */
8+
--theme-accent: #0b7285; /* Deep teal */
69
}
710

811
[data-color-theme="rainbow"] .gradient-hero {
@@ -25,27 +28,10 @@
2528
#732982 83.33%, #732982 100%) !important;
2629
}
2730

28-
[data-color-theme="rainbow"] .gradient-text {
29-
background: linear-gradient(
30-
to right,
31-
#E40303 0%,
32-
#E40303 16.67%,
33-
#FF8C00 16.67%,
34-
#FF8C00 33.33%,
35-
#FFED00 33.33%,
36-
#FFED00 50%,
37-
#008026 50%,
38-
#008026 66.67%,
39-
#004CFF 66.67%,
40-
#004CFF 83.33%,
41-
#732982 83.33%,
42-
#732982 100%
43-
);
44-
-webkit-background-clip: text;
45-
background-clip: text;
46-
-webkit-text-fill-color: transparent;
47-
color: transparent;
48-
}
31+
/* Note: headings (h2/h3) use the base `.gradient-text`, which is driven by the
32+
softened, readable theme vars above. We intentionally do NOT clip the full
33+
6-color flag into heading text — its yellow band is unreadable on white
34+
sections. The flag stays in the decorative section backgrounds below. */
4935

5036
/* Add backdrop blur to gradient sections */
5137
[data-color-theme="rainbow"] section.gradient-hero .max-w-7xl.py-20,

0 commit comments

Comments
 (0)