@cogenta/theme-entreprise 1.1.3 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/render/blocks/accordion.d.ts.map +1 -1
- package/dist/src/render/blocks/accordion.js +12 -15
- package/dist/src/render/blocks/accordion.js.map +1 -1
- package/dist/src/render/blocks/collection-list.d.ts +5 -7
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
- package/dist/src/render/blocks/collection-list.js +48 -32
- package/dist/src/render/blocks/collection-list.js.map +1 -1
- package/dist/src/render/blocks/cta.d.ts +6 -6
- package/dist/src/render/blocks/cta.d.ts.map +1 -1
- package/dist/src/render/blocks/cta.js +12 -12
- package/dist/src/render/blocks/cta.js.map +1 -1
- package/dist/src/render/blocks/embed.d.ts.map +1 -1
- package/dist/src/render/blocks/embed.js +22 -27
- package/dist/src/render/blocks/embed.js.map +1 -1
- package/dist/src/render/blocks/faq.d.ts.map +1 -1
- package/dist/src/render/blocks/faq.js +13 -16
- package/dist/src/render/blocks/faq.js.map +1 -1
- package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
- package/dist/src/render/blocks/feature-grid.js +22 -22
- package/dist/src/render/blocks/feature-grid.js.map +1 -1
- package/dist/src/render/blocks/gallery.d.ts +7 -8
- package/dist/src/render/blocks/gallery.d.ts.map +1 -1
- package/dist/src/render/blocks/gallery.js +16 -14
- package/dist/src/render/blocks/gallery.js.map +1 -1
- package/dist/src/render/blocks/hero.d.ts +13 -8
- package/dist/src/render/blocks/hero.d.ts.map +1 -1
- package/dist/src/render/blocks/hero.js +27 -17
- package/dist/src/render/blocks/hero.js.map +1 -1
- package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
- package/dist/src/render/blocks/logo-strip.js +14 -11
- package/dist/src/render/blocks/logo-strip.js.map +1 -1
- package/dist/src/render/blocks/logos.d.ts.map +1 -1
- package/dist/src/render/blocks/logos.js +21 -12
- package/dist/src/render/blocks/logos.js.map +1 -1
- package/dist/src/render/blocks/media-figure.d.ts +10 -6
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
- package/dist/src/render/blocks/media-figure.js +18 -13
- package/dist/src/render/blocks/media-figure.js.map +1 -1
- package/dist/src/render/blocks/pricing-table.d.ts.map +1 -1
- package/dist/src/render/blocks/pricing-table.js +15 -11
- package/dist/src/render/blocks/pricing-table.js.map +1 -1
- package/dist/src/render/blocks/prose.d.ts +9 -3
- package/dist/src/render/blocks/prose.d.ts.map +1 -1
- package/dist/src/render/blocks/prose.js +11 -4
- package/dist/src/render/blocks/prose.js.map +1 -1
- package/dist/src/render/blocks/quote.d.ts +10 -10
- package/dist/src/render/blocks/quote.d.ts.map +1 -1
- package/dist/src/render/blocks/quote.js +14 -13
- package/dist/src/render/blocks/quote.js.map +1 -1
- package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
- package/dist/src/render/blocks/stat-counter.js +11 -13
- package/dist/src/render/blocks/stat-counter.js.map +1 -1
- package/dist/src/render/blocks/stats.d.ts.map +1 -1
- package/dist/src/render/blocks/stats.js +12 -13
- package/dist/src/render/blocks/stats.js.map +1 -1
- package/dist/src/render/blocks/testimonial.d.ts +9 -9
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
- package/dist/src/render/blocks/testimonial.js +15 -14
- package/dist/src/render/blocks/testimonial.js.map +1 -1
- package/dist/src/render/chrome.d.ts +3 -1
- package/dist/src/render/chrome.d.ts.map +1 -1
- package/dist/src/render/chrome.js +71 -46
- package/dist/src/render/chrome.js.map +1 -1
- package/dist/src/render/layout.d.ts +26 -0
- package/dist/src/render/layout.d.ts.map +1 -0
- package/dist/src/render/layout.js +51 -0
- package/dist/src/render/layout.js.map +1 -0
- package/dist/src/render/render-block.d.ts.map +1 -1
- package/dist/src/render/render-block.js +23 -2
- package/dist/src/render/render-block.js.map +1 -1
- package/dist/src/render/term-archive.d.ts +8 -6
- package/dist/src/render/term-archive.d.ts.map +1 -1
- package/dist/src/render/term-archive.js +22 -16
- package/dist/src/render/term-archive.js.map +1 -1
- package/dist/src/render/widget-areas.d.ts +13 -0
- package/dist/src/render/widget-areas.d.ts.map +1 -0
- package/dist/src/render/widget-areas.js +20 -0
- package/dist/src/render/widget-areas.js.map +1 -0
- package/dist/theme.config.js +2 -2
- package/dist/theme.config.js.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +1 -0
- package/src/render/blocks/accordion.ts +32 -27
- package/src/render/blocks/collection-list.ts +84 -53
- package/src/render/blocks/cta.ts +27 -28
- package/src/render/blocks/embed.ts +46 -43
- package/src/render/blocks/faq.ts +25 -21
- package/src/render/blocks/feature-grid.ts +42 -35
- package/src/render/blocks/gallery.ts +21 -16
- package/src/render/blocks/hero.ts +40 -28
- package/src/render/blocks/logo-strip.ts +26 -16
- package/src/render/blocks/logos.ts +33 -17
- package/src/render/blocks/media-figure.ts +22 -14
- package/src/render/blocks/pricing-table.ts +26 -15
- package/src/render/blocks/prose.ts +18 -4
- package/src/render/blocks/quote.ts +18 -14
- package/src/render/blocks/stat-counter.ts +25 -20
- package/src/render/blocks/stats.ts +31 -21
- package/src/render/blocks/testimonial.ts +22 -18
- package/src/render/chrome.ts +84 -49
- package/src/render/layout.ts +67 -0
- package/src/render/render-block.ts +24 -1
- package/src/render/term-archive.ts +54 -50
- package/src/render/widget-areas.ts +23 -0
- package/src/styles/archive.css +135 -38
- package/src/styles/base.css +553 -426
- package/src/styles/blocks.css +1192 -1000
- package/src/styles/theme.css +18 -24
- package/src/styles/tokens.css +162 -192
- package/src/styles/widgets.css +913 -0
- package/tokens.json +17 -17
package/src/styles/theme.css
CHANGED
|
@@ -1,36 +1,30 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* `@cogenta/theme-entreprise`'s stylesheet
|
|
2
|
+
* `@cogenta/theme-entreprise`'s stylesheet: the entry point, and nothing
|
|
3
3
|
* else.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* tokens.css the design system, derived from the skin's `--cogenta-*`
|
|
6
|
+
* custom properties (contract D)
|
|
7
|
+
* base.css document, accessibility floor, grid, chrome, actions
|
|
8
|
+
* blocks.css the seventeen vocabulary blocks and the entry header
|
|
9
|
+
* archive.css the taxonomy-term archive
|
|
10
|
+
* widgets.css the widget areas: the side column, the bands, the footer row
|
|
6
11
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* base.css document, accessibility floor, page frame, chrome, actions
|
|
10
|
-
* blocks.css the seventeen vocabulary blocks
|
|
12
|
+
* Not one colour is written literally in any of them: every value comes from
|
|
13
|
+
* a skin token or from a `--cg-*` property composed from those.
|
|
11
14
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* inliner when `cogenta serve` renders without a build. Both flatten these
|
|
20
|
-
* three into one sheet, so no visitor ever pays for three round trips.
|
|
21
|
-
*
|
|
22
|
-
* The one thing this file adds on its own: the Google Fonts request for the
|
|
23
|
-
* two type families `tokens.json` names (Archivo for the sans, Source Serif
|
|
24
|
-
* 4 for the serif accents in `quote`, `prose`'s blockquotes and the
|
|
25
|
-
* numbered indices in `featureGrid`/`faq`) — loaded here, once, rather than
|
|
26
|
-
* per skin, since a skin only ever *names* a font family; it does not fetch
|
|
27
|
-
* one. Both fall back to a real system stack (`tokens.json`'s `font.sans`/
|
|
28
|
-
* `font.serif`) if Google Fonts is unreachable.
|
|
15
|
+
* The one thing this file adds on its own is the Google Fonts request for the
|
|
16
|
+
* two families `tokens.json` names: Newsreader (display and headings, with
|
|
17
|
+
* its optical-size axis, so a 13 px caption and an 80 px title each get the
|
|
18
|
+
* cut drawn for them) and Hanken Grotesk (text and interface). A skin only
|
|
19
|
+
* names a family; it never fetches one. Both fall back to real system stacks
|
|
20
|
+
* if Google Fonts is unreachable, and `display=swap` keeps text visible while
|
|
21
|
+
* they load. `cogenta serve` hoists this `@import` above the skin's rules.
|
|
29
22
|
*/
|
|
30
23
|
|
|
31
|
-
@import url("https://fonts.googleapis.com/css2?family=
|
|
24
|
+
@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,300..700;1,400&family=Newsreader:ital,opsz,wght@0,6..72,300..600;1,6..72,300..500&display=swap");
|
|
32
25
|
|
|
33
26
|
@import "./tokens.css";
|
|
34
27
|
@import "./base.css";
|
|
35
28
|
@import "./blocks.css";
|
|
36
29
|
@import "./archive.css";
|
|
30
|
+
@import "./widgets.css";
|
package/src/styles/tokens.css
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* `@cogenta/theme-entreprise`'s design system.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* generated `--cogenta-*` sheet and this whole system follows, with no
|
|
10
|
-
* build step.
|
|
4
|
+
* The register is a management consultancy's: institutional restraint,
|
|
5
|
+
* generous whitespace, editorial confidence. Neutrals carry the page (a cool
|
|
6
|
+
* ivory paper and a blue-black ink), one deep green accent is spent rarely
|
|
7
|
+
* (links, the eyebrow rule, one bar in an exhibit), and depth comes from
|
|
8
|
+
* hairlines and space, never from shadows or tinted boxes.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
10
|
+
* Contract D fixes a closed skin token set, so nothing here adds a token:
|
|
11
|
+
* every value is derived from a `--cogenta-*` property (`calc`,
|
|
12
|
+
* `color-mix`, relative colour syntax). A skin swap rewrites that sheet and
|
|
13
|
+
* this whole system follows.
|
|
13
14
|
*
|
|
14
|
-
*
|
|
15
|
-
* Every colour is either a skin token or a function *of* a skin token.
|
|
16
|
-
* 2. **No second scale.** The type steps come from `--cogenta-font-size-*`
|
|
17
|
-
* and the spacing multiplier from `--cogenta-space-scale`, both emitted
|
|
18
|
-
* by `renderSkin` from the same tokens the validator checked.
|
|
15
|
+
* Two rules hold in every stylesheet of this theme:
|
|
19
16
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* reserved for genuine hover elevation), and the dark mode is designed on
|
|
26
|
-
* its own terms rather than mechanically inverted — see the colour section
|
|
27
|
-
* below for the five choices that make it so.
|
|
17
|
+
* 1. No colour literal. Every colour is a skin token or a function of one.
|
|
18
|
+
* 2. No second scale. Type steps come from `--cogenta-font-size-*`; the
|
|
19
|
+
* display steps above `3xl` continue the same ratio
|
|
20
|
+
* (`--cogenta-font-scale`), and fluid sizes only interpolate between
|
|
21
|
+
* steps of that one ladder.
|
|
28
22
|
*/
|
|
29
23
|
|
|
30
24
|
:where(:root) {
|
|
@@ -40,10 +34,7 @@
|
|
|
40
34
|
}
|
|
41
35
|
|
|
42
36
|
/* --------------------------------------------------------------------------
|
|
43
|
-
Space
|
|
44
|
-
suggest: the aesthetic direction asks for "real breathing room", which
|
|
45
|
-
this theme spends mostly in its section rhythm (`--cg-section-y`) and
|
|
46
|
-
its row/card padding, not in a larger base unit.
|
|
37
|
+
Space: one unit, one section rhythm, one grid.
|
|
47
38
|
-------------------------------------------------------------------------- */
|
|
48
39
|
|
|
49
40
|
:where(:root) {
|
|
@@ -61,18 +52,30 @@
|
|
|
61
52
|
--cg-s12: calc(var(--cg-unit) * 12);
|
|
62
53
|
--cg-s16: calc(var(--cg-unit) * 16);
|
|
63
54
|
--cg-s20: calc(var(--cg-unit) * 20);
|
|
64
|
-
--cg-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
--cg-s24: calc(var(--cg-unit) * 24);
|
|
56
|
+
--cg-s32: calc(var(--cg-unit) * 32);
|
|
57
|
+
|
|
58
|
+
/* The only vertical rhythm between sections. Every block is padded by
|
|
59
|
+
half of it above and below, so any two blocks sit one full step apart
|
|
60
|
+
whatever their order; a band (the call to action, a muted variant) is
|
|
61
|
+
padded by the whole step. */
|
|
62
|
+
--cg-section: clamp(var(--cg-s16), 9vw, var(--cg-s32));
|
|
63
|
+
|
|
64
|
+
/* A twelve-column grid with constant gutters. */
|
|
65
|
+
--cg-columns: 12;
|
|
66
|
+
--cg-gutter: clamp(var(--cg-s5), 4.5vw, var(--cg-s16));
|
|
67
|
+
--cg-col-gap: clamp(var(--cg-s4), 2.2vw, var(--cg-s8));
|
|
68
|
+
--cg-page: 80rem;
|
|
69
|
+
|
|
70
|
+
/* One column's width, for an element that hangs into the margin (a prose
|
|
71
|
+
heading). Unregistered custom properties are substituted where they are
|
|
72
|
+
used, so `cqi` resolves against the grid container around that element. */
|
|
73
|
+
--cg-col: calc((100cqi - (var(--cg-columns) - 1) * var(--cg-col-gap)) / var(--cg-columns));
|
|
71
74
|
|
|
72
75
|
--cg-measure: 66ch;
|
|
73
|
-
--cg-measure-narrow:
|
|
74
|
-
|
|
75
|
-
--cg-
|
|
76
|
+
--cg-measure-narrow: 48ch;
|
|
77
|
+
|
|
78
|
+
--cg-header-height: var(--cg-s20);
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
:where([data-density="compact"]) {
|
|
@@ -88,109 +91,90 @@
|
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
/* --------------------------------------------------------------------------
|
|
91
|
-
Type
|
|
94
|
+
Type: Newsreader for display and headings, Hanken Grotesk for text and
|
|
95
|
+
interface. The skin names both; the theme only decides where each goes.
|
|
92
96
|
-------------------------------------------------------------------------- */
|
|
93
97
|
|
|
94
98
|
:where(:root) {
|
|
95
|
-
--cg-
|
|
96
|
-
--cg-text
|
|
97
|
-
|
|
98
|
-
--cg-text-
|
|
99
|
-
--cg-text-
|
|
100
|
-
--cg-text-
|
|
101
|
-
--cg-text-
|
|
102
|
-
|
|
103
|
-
--cg-
|
|
104
|
-
--cg-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
--cg-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
99
|
+
--cg-font-display: var(--cogenta-font-serif);
|
|
100
|
+
--cg-font-text: var(--cogenta-font-sans);
|
|
101
|
+
|
|
102
|
+
--cg-text-xs: var(--cogenta-font-size-xs, 0.68rem);
|
|
103
|
+
--cg-text-sm: var(--cogenta-font-size-sm, 0.85rem);
|
|
104
|
+
--cg-text-md: var(--cogenta-font-size-md, var(--cogenta-font-base-size, 1.0625rem));
|
|
105
|
+
--cg-text-lg: var(--cogenta-font-size-lg, 1.33rem);
|
|
106
|
+
--cg-text-xl: var(--cogenta-font-size-xl, 1.66rem);
|
|
107
|
+
--cg-text-2xl: var(--cogenta-font-size-2xl, 2.08rem);
|
|
108
|
+
--cg-text-3xl: var(--cogenta-font-size-3xl, 2.59rem);
|
|
109
|
+
/* The same ladder, continued: each step is the previous one times the
|
|
110
|
+
skin's own ratio. */
|
|
111
|
+
--cg-text-4xl: calc(var(--cg-text-3xl) * var(--cogenta-font-scale, 1.25));
|
|
112
|
+
--cg-text-5xl: calc(var(--cg-text-4xl) * var(--cogenta-font-scale, 1.25));
|
|
113
|
+
--cg-text-6xl: calc(var(--cg-text-5xl) * var(--cogenta-font-scale, 1.25));
|
|
114
|
+
/* Interface text (navigation, buttons, labels in forms) sits between two
|
|
115
|
+
steps: `sm` is too small for a primary control, `md` too loud. */
|
|
116
|
+
--cg-text-ui: calc((var(--cg-text-sm) + var(--cg-text-md)) / 2);
|
|
117
|
+
|
|
118
|
+
/* Fluid sizes interpolate between two steps of the ladder above. */
|
|
119
|
+
--cg-size-display: clamp(var(--cg-text-3xl), calc(1.1rem + 4.2vw), var(--cg-text-6xl));
|
|
120
|
+
--cg-size-heading: clamp(var(--cg-text-2xl), calc(1rem + 2.3vw), var(--cg-text-4xl));
|
|
121
|
+
--cg-size-subheading: clamp(var(--cg-text-xl), calc(0.95rem + 1vw), var(--cg-text-2xl));
|
|
122
|
+
--cg-size-quote: clamp(var(--cg-text-xl), calc(1rem + 1.8vw), var(--cg-text-3xl));
|
|
123
|
+
--cg-size-figure: clamp(var(--cg-text-3xl), calc(1rem + 3vw), var(--cg-text-5xl));
|
|
124
|
+
--cg-size-lead: clamp(var(--cg-text-lg), calc(0.9rem + 0.6vw), var(--cg-text-xl));
|
|
125
|
+
|
|
126
|
+
--cg-leading-display: 1.02;
|
|
127
|
+
--cg-leading-heading: 1.1;
|
|
128
|
+
--cg-leading-snug: 1.3;
|
|
129
|
+
--cg-leading-text: 1.62;
|
|
130
|
+
|
|
131
|
+
--cg-tracking-display: -0.022em;
|
|
132
|
+
--cg-tracking-heading: -0.014em;
|
|
133
|
+
--cg-tracking-label: 0.08em;
|
|
134
|
+
|
|
135
|
+
--cg-weight-light: 350;
|
|
116
136
|
--cg-weight-regular: 400;
|
|
117
137
|
--cg-weight-medium: 500;
|
|
118
138
|
--cg-weight-semibold: 600;
|
|
119
|
-
--cg-weight-bold: 700;
|
|
120
139
|
}
|
|
121
140
|
|
|
122
141
|
/* --------------------------------------------------------------------------
|
|
123
|
-
|
|
124
|
-
consultancy or a software vendor reads as more serious with edges that
|
|
125
|
-
are structured rather than soft. `--cg-radius-pill` is the one rounded
|
|
126
|
-
shape this theme uses freely (the eyebrow tag, small badges) precisely
|
|
127
|
-
because everything else stays close to square.
|
|
142
|
+
Shape and motion: corners are square, and motion is a colour change.
|
|
128
143
|
-------------------------------------------------------------------------- */
|
|
129
144
|
|
|
130
145
|
:where(:root) {
|
|
131
|
-
--cg-radius
|
|
132
|
-
--cg-radius-
|
|
133
|
-
--cg-radius-md: var(--cogenta-radius-md);
|
|
134
|
-
--cg-radius-lg: var(--cogenta-radius-lg);
|
|
135
|
-
--cg-radius-xl: calc(var(--cogenta-radius-lg) * 1.5);
|
|
136
|
-
--cg-radius-pill: 999rem;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* --------------------------------------------------------------------------
|
|
140
|
-
Motion
|
|
141
|
-
-------------------------------------------------------------------------- */
|
|
146
|
+
--cg-radius: var(--cogenta-radius-sm);
|
|
147
|
+
--cg-radius-portrait: var(--cogenta-radius-md);
|
|
142
148
|
|
|
143
|
-
:
|
|
144
|
-
--cg-duration-fast: calc(var(--cogenta-motion-duration) * 0.65);
|
|
145
|
-
--cg-duration: var(--cogenta-motion-duration);
|
|
146
|
-
--cg-duration-slow: calc(var(--cogenta-motion-duration) * 3);
|
|
149
|
+
--cg-duration: min(var(--cogenta-motion-duration), 150ms);
|
|
147
150
|
--cg-ease: var(--cogenta-motion-easing);
|
|
151
|
+
|
|
152
|
+
--cg-rule: 1px;
|
|
153
|
+
--cg-rule-strong: 2px;
|
|
148
154
|
}
|
|
149
155
|
|
|
150
156
|
/* --------------------------------------------------------------------------
|
|
151
|
-
Colour
|
|
157
|
+
Colour: one palette per scheme, both derived from the same seven tokens.
|
|
152
158
|
--------------------------------------------------------------------------
|
|
153
159
|
|
|
154
|
-
The block
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
palette lifts it to L 0.68 and pulls a third of its chroma back, which
|
|
173
|
-
is what makes it still read as "the same considered green" instead of
|
|
174
|
-
a highlighter.
|
|
175
|
-
3. *The accent's foreground flips to ink.* Light text on a lifted accent
|
|
176
|
-
fails contrast, so `accent-fg` is derived dark from the accent's own
|
|
177
|
-
hue rather than kept as the skin's white.
|
|
178
|
-
4. *Text is never pure light and never fully desaturated.* Ink carries a
|
|
179
|
-
trace of the accent's hue at low chroma — an off-white that still
|
|
180
|
-
belongs to this palette rather than a generic dark-mode grey.
|
|
181
|
-
5. *A border lightens rather than darkens against its surface* — a
|
|
182
|
-
darker line on dark ink is invisible.
|
|
183
|
-
|
|
184
|
-
The hue and chroma of every dark value come from a skin token, so a skin
|
|
185
|
-
with a different accent gets a dark palette tuned the same way without
|
|
186
|
-
touching this file. Every ratio these values produce is computed for
|
|
187
|
-
real, from this file, by `test/design-system.test.ts`, in both schemes.
|
|
188
|
-
|
|
189
|
-
Known limit, same one `theme-canonical` records: the derivation assumes a
|
|
190
|
-
light-first skin (`bg` lighter than `fg`) — what contract D's default and
|
|
191
|
-
every blueprint use. A skin that starts dark would need a second colour
|
|
192
|
-
group in the contract, a `theme@2.0` change no single theme can make on
|
|
193
|
-
its own.
|
|
160
|
+
The first block declares the light palette plainly; the scheme-aware
|
|
161
|
+
values follow behind a feature query, so a browser that cannot parse
|
|
162
|
+
`light-dark()` still gets a complete light palette.
|
|
163
|
+
|
|
164
|
+
The dark palette is designed, not inverted:
|
|
165
|
+
|
|
166
|
+
1. The ground is deep ink, derived from the skin's own `fg` hue, never a
|
|
167
|
+
neutral grey and never pure black. Surfaces step up in lightness
|
|
168
|
+
(sunken, canvas, raised); nothing casts a shadow.
|
|
169
|
+
2. Text is the paper colour, lifted: the ivory's own hue at a lower
|
|
170
|
+
lightness than white, so long reading on ink stays calm.
|
|
171
|
+
3. The accent is lifted and desaturated, and its foreground flips to ink.
|
|
172
|
+
4. Hairlines step up in lightness from the surface they sit on.
|
|
173
|
+
5. The ink band keeps its role (the one dark plane of a light page) by
|
|
174
|
+
becoming the raised ink surface, framed by hairlines.
|
|
175
|
+
|
|
176
|
+
Every ratio is computed from this file by `test/design-system.test.ts`,
|
|
177
|
+
in both schemes.
|
|
194
178
|
-------------------------------------------------------------------------- */
|
|
195
179
|
|
|
196
180
|
:where(:root) {
|
|
@@ -198,27 +182,28 @@
|
|
|
198
182
|
--cg-surface: var(--cogenta-color-bg);
|
|
199
183
|
--cg-surface-raised: var(--cogenta-color-bg);
|
|
200
184
|
--cg-surface-sunken: var(--cogenta-color-muted);
|
|
201
|
-
--cg-surface-tinted: color-mix(in oklab, var(--cogenta-color-accent) 7%, var(--cogenta-color-bg));
|
|
202
185
|
|
|
203
186
|
--cg-ink: var(--cogenta-color-fg);
|
|
204
187
|
--cg-ink-muted: var(--cogenta-color-muted-fg);
|
|
205
|
-
--cg-ink-subtle: color-mix(in oklab, var(--cogenta-color-muted-fg)
|
|
188
|
+
--cg-ink-subtle: color-mix(in oklab, var(--cogenta-color-muted-fg) 88%, var(--cogenta-color-bg));
|
|
206
189
|
|
|
207
190
|
--cg-accent: var(--cogenta-color-accent);
|
|
208
191
|
--cg-accent-fg: var(--cogenta-color-accent-fg);
|
|
209
|
-
--cg-accent-hover: color-mix(in oklab, var(--cogenta-color-accent)
|
|
210
|
-
--cg-accent-soft: color-mix(in oklab, var(--cogenta-color-accent) 9%, var(--cogenta-color-bg));
|
|
211
|
-
--cg-accent-soft-fg: color-mix(
|
|
212
|
-
in oklab,
|
|
213
|
-
var(--cogenta-color-accent) 70%,
|
|
214
|
-
var(--cogenta-color-fg)
|
|
215
|
-
);
|
|
192
|
+
--cg-accent-hover: color-mix(in oklab, var(--cogenta-color-accent) 70%, var(--cogenta-color-fg));
|
|
216
193
|
|
|
217
194
|
--cg-line: var(--cogenta-color-border);
|
|
218
|
-
--cg-line-soft: color-mix(in oklab, var(--cogenta-color-border)
|
|
219
|
-
--cg-line-strong: color-mix(in oklab, var(--cogenta-color-border)
|
|
220
|
-
|
|
221
|
-
--cg-
|
|
195
|
+
--cg-line-soft: color-mix(in oklab, var(--cogenta-color-border) 60%, var(--cogenta-color-bg));
|
|
196
|
+
--cg-line-strong: color-mix(in oklab, var(--cogenta-color-border) 42%, var(--cogenta-color-fg));
|
|
197
|
+
|
|
198
|
+
--cg-band: var(--cogenta-color-fg);
|
|
199
|
+
--cg-band-ink: var(--cogenta-color-bg);
|
|
200
|
+
--cg-band-muted: color-mix(in oklab, var(--cogenta-color-bg) 74%, var(--cogenta-color-fg));
|
|
201
|
+
--cg-band-line: color-mix(in oklab, var(--cogenta-color-bg) 24%, var(--cogenta-color-fg));
|
|
202
|
+
|
|
203
|
+
--cg-action: var(--cogenta-color-fg);
|
|
204
|
+
--cg-action-fg: var(--cogenta-color-bg);
|
|
205
|
+
--cg-action-hover: var(--cogenta-color-accent);
|
|
206
|
+
--cg-action-hover-fg: var(--cogenta-color-accent-fg);
|
|
222
207
|
}
|
|
223
208
|
|
|
224
209
|
@supports (color: light-dark(currentColor, currentColor)) and
|
|
@@ -226,101 +211,86 @@
|
|
|
226
211
|
:where(:root) {
|
|
227
212
|
--cg-canvas: light-dark(
|
|
228
213
|
var(--cogenta-color-bg),
|
|
229
|
-
oklch(from var(--cogenta-color-fg) 0.
|
|
214
|
+
oklch(from var(--cogenta-color-fg) 0.19 calc(c * 0.8) h)
|
|
230
215
|
);
|
|
231
216
|
--cg-surface: light-dark(
|
|
232
217
|
var(--cogenta-color-bg),
|
|
233
|
-
oklch(from var(--cogenta-color-fg) 0.
|
|
218
|
+
oklch(from var(--cogenta-color-fg) 0.19 calc(c * 0.8) h)
|
|
234
219
|
);
|
|
235
220
|
--cg-surface-raised: light-dark(
|
|
236
221
|
var(--cogenta-color-bg),
|
|
237
|
-
oklch(from var(--cogenta-color-fg) 0.
|
|
222
|
+
oklch(from var(--cogenta-color-fg) 0.24 calc(c * 0.8) h)
|
|
238
223
|
);
|
|
239
224
|
--cg-surface-sunken: light-dark(
|
|
240
225
|
var(--cogenta-color-muted),
|
|
241
|
-
oklch(from var(--cogenta-color-fg) 0.
|
|
242
|
-
);
|
|
243
|
-
--cg-surface-tinted: light-dark(
|
|
244
|
-
color-mix(in oklab, var(--cogenta-color-accent) 7%, var(--cogenta-color-bg)),
|
|
245
|
-
oklch(from var(--cogenta-color-accent) 0.235 calc(c * 0.55) h)
|
|
226
|
+
oklch(from var(--cogenta-color-fg) 0.16 calc(c * 0.8) h)
|
|
246
227
|
);
|
|
247
228
|
|
|
248
|
-
--cg-ink: light-dark(
|
|
249
|
-
var(--cogenta-color-fg),
|
|
250
|
-
oklch(from var(--cogenta-color-accent) 0.93 0.01 h)
|
|
251
|
-
);
|
|
229
|
+
--cg-ink: light-dark(var(--cogenta-color-fg), oklch(from var(--cogenta-color-bg) 0.93 c h));
|
|
252
230
|
--cg-ink-muted: light-dark(
|
|
253
231
|
var(--cogenta-color-muted-fg),
|
|
254
|
-
oklch(from var(--cogenta-color-
|
|
232
|
+
oklch(from var(--cogenta-color-bg) 0.79 c h)
|
|
255
233
|
);
|
|
256
234
|
--cg-ink-subtle: light-dark(
|
|
257
|
-
color-mix(in oklab, var(--cogenta-color-muted-fg)
|
|
258
|
-
oklch(from var(--cogenta-color-
|
|
235
|
+
color-mix(in oklab, var(--cogenta-color-muted-fg) 88%, var(--cogenta-color-bg)),
|
|
236
|
+
oklch(from var(--cogenta-color-bg) 0.69 c h)
|
|
259
237
|
);
|
|
260
238
|
|
|
261
239
|
--cg-accent: light-dark(
|
|
262
240
|
var(--cogenta-color-accent),
|
|
263
|
-
oklch(from var(--cogenta-color-accent) 0.
|
|
241
|
+
oklch(from var(--cogenta-color-accent) 0.76 calc(c * 0.72) h)
|
|
264
242
|
);
|
|
265
243
|
--cg-accent-fg: light-dark(
|
|
266
244
|
var(--cogenta-color-accent-fg),
|
|
267
|
-
oklch(from var(--cogenta-color-accent) 0.
|
|
245
|
+
oklch(from var(--cogenta-color-accent) 0.18 calc(c * 0.5) h)
|
|
268
246
|
);
|
|
269
247
|
--cg-accent-hover: light-dark(
|
|
270
|
-
color-mix(in oklab, var(--cogenta-color-accent) 84%, var(--cogenta-color-fg)),
|
|
271
|
-
oklch(from var(--cogenta-color-accent) 0.77 calc(c * 0.68) h)
|
|
272
|
-
);
|
|
273
|
-
--cg-accent-soft: light-dark(
|
|
274
|
-
color-mix(in oklab, var(--cogenta-color-accent) 9%, var(--cogenta-color-bg)),
|
|
275
|
-
oklch(from var(--cogenta-color-accent) 0.28 calc(c * 0.45) h)
|
|
276
|
-
);
|
|
277
|
-
--cg-accent-soft-fg: light-dark(
|
|
278
248
|
color-mix(in oklab, var(--cogenta-color-accent) 70%, var(--cogenta-color-fg)),
|
|
279
|
-
oklch(from var(--cogenta-color-accent) 0.
|
|
249
|
+
oklch(from var(--cogenta-color-accent) 0.85 calc(c * 0.55) h)
|
|
280
250
|
);
|
|
281
251
|
|
|
282
252
|
--cg-line: light-dark(
|
|
283
253
|
var(--cogenta-color-border),
|
|
284
|
-
oklch(from var(--cogenta-color-
|
|
254
|
+
oklch(from var(--cogenta-color-fg) 0.33 calc(c * 0.8) h)
|
|
285
255
|
);
|
|
286
256
|
--cg-line-soft: light-dark(
|
|
287
|
-
color-mix(in oklab, var(--cogenta-color-border)
|
|
288
|
-
oklch(from var(--cogenta-color-
|
|
257
|
+
color-mix(in oklab, var(--cogenta-color-border) 60%, var(--cogenta-color-bg)),
|
|
258
|
+
oklch(from var(--cogenta-color-fg) 0.27 calc(c * 0.8) h)
|
|
289
259
|
);
|
|
290
260
|
--cg-line-strong: light-dark(
|
|
291
|
-
color-mix(in oklab, var(--cogenta-color-border)
|
|
292
|
-
oklch(from var(--cogenta-color-
|
|
261
|
+
color-mix(in oklab, var(--cogenta-color-border) 42%, var(--cogenta-color-fg)),
|
|
262
|
+
oklch(from var(--cogenta-color-fg) 0.55 calc(c * 0.6) h)
|
|
293
263
|
);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
264
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
:
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
--cg-elevation-3: var(--cogenta-shadow-md), var(--cg-ring);
|
|
314
|
-
}
|
|
265
|
+
--cg-band: light-dark(
|
|
266
|
+
var(--cogenta-color-fg),
|
|
267
|
+
oklch(from var(--cogenta-color-fg) 0.25 calc(c * 0.9) h)
|
|
268
|
+
);
|
|
269
|
+
--cg-band-ink: light-dark(
|
|
270
|
+
var(--cogenta-color-bg),
|
|
271
|
+
oklch(from var(--cogenta-color-bg) 0.95 c h)
|
|
272
|
+
);
|
|
273
|
+
--cg-band-muted: light-dark(
|
|
274
|
+
color-mix(in oklab, var(--cogenta-color-bg) 74%, var(--cogenta-color-fg)),
|
|
275
|
+
oklch(from var(--cogenta-color-bg) 0.8 c h)
|
|
276
|
+
);
|
|
277
|
+
--cg-band-line: light-dark(
|
|
278
|
+
color-mix(in oklab, var(--cogenta-color-bg) 24%, var(--cogenta-color-fg)),
|
|
279
|
+
oklch(from var(--cogenta-color-fg) 0.37 calc(c * 0.8) h)
|
|
280
|
+
);
|
|
315
281
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
282
|
+
--cg-action: light-dark(var(--cogenta-color-fg), oklch(from var(--cogenta-color-bg) 0.93 c h));
|
|
283
|
+
--cg-action-fg: light-dark(
|
|
284
|
+
var(--cogenta-color-bg),
|
|
285
|
+
oklch(from var(--cogenta-color-fg) 0.19 calc(c * 0.8) h)
|
|
286
|
+
);
|
|
287
|
+
--cg-action-hover: light-dark(
|
|
288
|
+
var(--cogenta-color-accent),
|
|
289
|
+
oklch(from var(--cogenta-color-accent) 0.76 calc(c * 0.72) h)
|
|
290
|
+
);
|
|
291
|
+
--cg-action-hover-fg: light-dark(
|
|
292
|
+
var(--cogenta-color-accent-fg),
|
|
293
|
+
oklch(from var(--cogenta-color-accent) 0.18 calc(c * 0.5) h)
|
|
294
|
+
);
|
|
320
295
|
}
|
|
321
296
|
}
|
|
322
|
-
|
|
323
|
-
:where(:root[data-theme="dark"]) {
|
|
324
|
-
--cg-elevation-2: var(--cg-ring-strong);
|
|
325
|
-
--cg-elevation-3: var(--cg-ring-strong), var(--cogenta-shadow-md);
|
|
326
|
-
}
|