Skip to content

Commit bb0a0b4

Browse files
Copilotsy-records
andcommitted
Add comprehensive documentation comments explaining color calculations
Co-authored-by: sy-records <33931153+sy-records@users.noreply.github.com>
1 parent dbd9e3a commit bb0a0b4

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

src/themes/addons/core-dark.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
--heading-color : var(--strong-color);
2020
--mark-bg : #fde047;
2121
--mark-color : var(--color-bg);
22-
--strong-color : #e9e9e9;
22+
--strong-color : #e9e9e9; /* 35% lighter than --color-text (#ddd) */
2323

2424
/* Sidebar */
2525
--sidebar-toggle-bg : var(--color-mono-3);

src/themes/shared/_vars.css

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,35 @@
77
--theme-color: #0b85d7;
88

99
/* Color: Monochromatic */
10+
/* NOTE: Static color values computed from --color-bg (#fff) and --color-text (#333)
11+
These replace color-mix() for browser compatibility. If base colors change,
12+
recalculate using: mix(#fff, #333, percentage) in sRGB color space.
13+
Formula: newColor = color1 * (1 - p) + color2 * p */
1014
--color-mono-min: var(--color-bg);
11-
--color-mono-1 : #f5f5f5;
12-
--color-mono-2 : #ebebeb;
13-
--color-mono-3 : #d6d6d6;
14-
--color-mono-4 : #bebebe;
15-
--color-mono-5 : #999999;
16-
--color-mono-6 : #747474;
17-
--color-mono-7 : #5c5c5c;
18-
--color-mono-8 : #474747;
19-
--color-mono-9 : #3d3d3d;
15+
--color-mono-1 : #f5f5f5; /* 5% mix of --color-text with --color-bg */
16+
--color-mono-2 : #ebebeb; /* 10% mix of --color-text with --color-bg */
17+
--color-mono-3 : #d6d6d6; /* 20% mix of --color-text with --color-bg */
18+
--color-mono-4 : #bebebe; /* 32% mix of --color-text with --color-bg */
19+
--color-mono-5 : #999999; /* 50/50 mix of --color-text and --color-bg */
20+
--color-mono-6 : #747474; /* 68% mix of --color-text with --color-bg */
21+
--color-mono-7 : #5c5c5c; /* 80% mix of --color-text with --color-bg */
22+
--color-mono-8 : #474747; /* 90% mix of --color-text with --color-bg */
23+
--color-mono-9 : #3d3d3d; /* 95% mix of --color-text with --color-bg */
2024
--color-mono-max: var(--color-text);
2125

2226
/* Color: Theme Shades (darker) & Tints (lighter)*/
23-
/* NOTE: Values derived from --theme-color */
24-
--theme-color-1: #e7f3fb;
25-
--theme-color-2: #c2e1f5;
26-
--theme-color-3: #91c8ed;
27-
--theme-color-4: #54aae3;
28-
--theme-color-5: #176ca6;
29-
--theme-color-6: #21587d;
30-
--theme-color-7: #29485c;
31-
--theme-color-8: #2f3b43;
27+
/* NOTE: Static color values computed from --theme-color (#0b85d7)
28+
These replace color-mix() for browser compatibility. If --theme-color changes,
29+
recalculate using: mix(#0b85d7, target, percentage) in sRGB color space.
30+
Tints (1-4) mix with --color-bg (#fff), Shades (5-8) mix with --color-text (#333) */
31+
--theme-color-1: #e7f3fb; /* 10% --theme-color, 90% white (lightest tint) */
32+
--theme-color-2: #c2e1f5; /* 25% --theme-color, 75% white */
33+
--theme-color-3: #91c8ed; /* 45% --theme-color, 55% white */
34+
--theme-color-4: #54aae3; /* 70% --theme-color, 30% white */
35+
--theme-color-5: #176ca6; /* 70% --theme-color, 30% dark gray */
36+
--theme-color-6: #21587d; /* 45% --theme-color, 55% dark gray */
37+
--theme-color-7: #29485c; /* 25% --theme-color, 75% dark gray */
38+
--theme-color-8: #2f3b43; /* 10% --theme-color, 90% dark gray (darkest shade) */
3239

3340
/* Typography */
3441
--font-family : system-ui, sans-serif;
@@ -133,7 +140,7 @@
133140
--link-underline-thickness-hover: var(--link-underline-thickness);
134141
--mark-bg : #fef08a;
135142
--mark-color : ;
136-
--strong-color : #212121;
143+
--strong-color : #212121; /* 35% darker than --color-text (#333) */
137144
--strong-font-weight : 600;
138145
--table-row-alt-bg : var(--color-mono-1);
139146

@@ -171,6 +178,9 @@
171178
--sidebar-toggle-alignment : center; /* start center end */
172179
--sidebar-toggle-bg : var(--color-mono-2);
173180
--sidebar-toggle-bg-hover : var(--button-bg);
181+
/* NOTE: Hardcoded RGBA from --theme-color (#0b85d7) at 10% opacity for compatibility.
182+
Modern rgba(from var(--theme-color) r g b / 0.1) syntax not widely supported yet.
183+
If --theme-color changes, update this to: rgba(R, G, B, 0.1) */
174184
--sidebar-toggle-bg-hover-alpha : rgba(11, 133, 215, 0.1);
175185
--sidebar-toggle-color : var(--color-mono-4);
176186
--sidebar-toggle-color-hover : var(--button-color);

0 commit comments

Comments
 (0)