@kolkrabbi/kol-theme 0.140.0 → 0.142.0
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/kol-components-molecules.css +110 -0
- package/kol-design-tokens.css +42 -0
- package/package.json +1 -1
|
@@ -1834,3 +1834,113 @@
|
|
|
1834
1834
|
color: var(--kol-tone-pressed-fg);
|
|
1835
1835
|
}
|
|
1836
1836
|
|
|
1837
|
+
|
|
1838
|
+
/* ─────────────────────────── DocsToc · rail ───────────────────────────
|
|
1839
|
+
* The fisheye rail render of `DocsToc` (`variant="rail"`, docstoc-rail-variant,
|
|
1840
|
+
* kol-client-olina 2026-09-03 — built and run there before filing).
|
|
1841
|
+
*
|
|
1842
|
+
* `--m` is the gaussian magnitude (0..1) the component writes per row on
|
|
1843
|
+
* pointer move; EVERY visual here derives from it, so the JS sets one number
|
|
1844
|
+
* per row and the cascade does the rest. This is CSS rather than utilities
|
|
1845
|
+
* because each rule reads a custom property through `calc()` and sets a
|
|
1846
|
+
* child's resting state from the row's variable — neither is expressible as a
|
|
1847
|
+
* Tailwind class, which is the §5 test for when a rule belongs in the theme.
|
|
1848
|
+
* ────────────────────────────────────────────────────────────────────── */
|
|
1849
|
+
|
|
1850
|
+
.kol-toc {
|
|
1851
|
+
position: fixed;
|
|
1852
|
+
top: 50%;
|
|
1853
|
+
transform: translateY(-50%);
|
|
1854
|
+
z-index: var(--kol-z-sticky);
|
|
1855
|
+
display: flex;
|
|
1856
|
+
flex-direction: column;
|
|
1857
|
+
padding-block: var(--kol-spacing-8);
|
|
1858
|
+
}
|
|
1859
|
+
/* The lens scales about the edge the rail is pinned to, so the column's outer
|
|
1860
|
+
* edge stays a straight line while the type breathes. The wide inner padding is
|
|
1861
|
+
* the lens's room to grow into without the labels colliding with the page. */
|
|
1862
|
+
.kol-toc--right {
|
|
1863
|
+
right: 0;
|
|
1864
|
+
align-items: flex-end;
|
|
1865
|
+
padding-right: var(--kol-spacing-6);
|
|
1866
|
+
padding-left: var(--kol-spacing-16);
|
|
1867
|
+
}
|
|
1868
|
+
.kol-toc--left {
|
|
1869
|
+
left: 0;
|
|
1870
|
+
align-items: flex-start;
|
|
1871
|
+
padding-left: var(--kol-spacing-6);
|
|
1872
|
+
padding-right: var(--kol-spacing-16);
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
.kol-toc-row {
|
|
1876
|
+
--m: 0;
|
|
1877
|
+
display: flex;
|
|
1878
|
+
align-items: center;
|
|
1879
|
+
gap: var(--kol-spacing-3);
|
|
1880
|
+
padding-block: 2px;
|
|
1881
|
+
text-decoration: none;
|
|
1882
|
+
}
|
|
1883
|
+
.kol-toc--right .kol-toc-row { justify-content: flex-end; }
|
|
1884
|
+
.kol-toc--left .kol-toc-row { flex-direction: row-reverse; justify-content: flex-end; }
|
|
1885
|
+
|
|
1886
|
+
/* Away from the pointer the row is small and quiet; under it, large and lit.
|
|
1887
|
+
* BOTH directions matter — grow-only reads as a bump, not a scrub. */
|
|
1888
|
+
.kol-toc-label {
|
|
1889
|
+
/* `transform` is ignored on a non-replaced INLINE element, and this label is
|
|
1890
|
+
* a bare <span>: the scale below did nothing at all until this line. It cost
|
|
1891
|
+
* the filer a round trip with the user — opacity and width worked and only
|
|
1892
|
+
* the scale did not. */
|
|
1893
|
+
display: inline-block;
|
|
1894
|
+
white-space: nowrap;
|
|
1895
|
+
opacity: calc(0.26 + 0.74 * var(--m));
|
|
1896
|
+
transform: scale(calc(0.78 + 0.42 * var(--m)));
|
|
1897
|
+
will-change: transform, opacity;
|
|
1898
|
+
}
|
|
1899
|
+
.kol-toc--right .kol-toc-label { transform-origin: right center; }
|
|
1900
|
+
.kol-toc--left .kol-toc-label { transform-origin: left center; }
|
|
1901
|
+
|
|
1902
|
+
.kol-toc-rule {
|
|
1903
|
+
height: 1px;
|
|
1904
|
+
background: var(--kol-fg-24);
|
|
1905
|
+
width: calc(8px + 26px * var(--m));
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
/* The section you are actually IN reads at rest — full ink and a size step — so
|
|
1909
|
+
* the column says where you are before the pointer arrives. It rests where an
|
|
1910
|
+
* inactive row lands only under the lens. */
|
|
1911
|
+
.kol-toc-row[data-active] .kol-toc-label {
|
|
1912
|
+
opacity: calc(0.92 + 0.08 * var(--m));
|
|
1913
|
+
transform: scale(calc(1 + 0.2 * var(--m)));
|
|
1914
|
+
color: var(--kol-fg-96);
|
|
1915
|
+
}
|
|
1916
|
+
.kol-toc-row[data-active] .kol-toc-rule {
|
|
1917
|
+
width: calc(22px + 26px * var(--m));
|
|
1918
|
+
background: var(--kol-fg-64);
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
/* Settle on leave — NEVER while the pointer is driving. A transition on a
|
|
1922
|
+
* continuous input lags behind the cursor and reads as sluggish; the component
|
|
1923
|
+
* stamps `data-live` on pointer-enter, which is what this selector reads. */
|
|
1924
|
+
.kol-toc:not([data-live]) .kol-toc-label,
|
|
1925
|
+
.kol-toc:not([data-live]) .kol-toc-rule {
|
|
1926
|
+
transition: opacity 260ms ease-out, transform 260ms ease-out, width 260ms ease-out;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
/* Graduations — the ruler between the labels. Shorter and fainter than a
|
|
1930
|
+
* heading's stroke at every point of the curve, so the labelled marks stay the
|
|
1931
|
+
* ones you read; they exist to give the lens something continuous to cross.
|
|
1932
|
+
* 3px pitch: ten between labels puts a section at ~52px, so a thirteen-section
|
|
1933
|
+
* page still stands inside a laptop viewport. */
|
|
1934
|
+
.kol-toc-tick { height: 3px; padding-block: 0; }
|
|
1935
|
+
.kol-toc-tick .kol-toc-rule {
|
|
1936
|
+
width: calc(5px + 11px * var(--m));
|
|
1937
|
+
background: var(--kol-fg-12);
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1941
|
+
.kol-toc-label { opacity: 1; transform: none; }
|
|
1942
|
+
.kol-toc-rule { width: 12px; }
|
|
1943
|
+
.kol-toc-row[data-active] .kol-toc-rule { width: 24px; }
|
|
1944
|
+
.kol-toc-tick .kol-toc-rule { width: 5px; }
|
|
1945
|
+
.kol-toc-label, .kol-toc-rule { transition: none; }
|
|
1946
|
+
}
|
package/kol-design-tokens.css
CHANGED
|
@@ -209,4 +209,46 @@
|
|
|
209
209
|
--z-index-toast: var(--kol-z-toast);
|
|
210
210
|
--z-index-tooltip: var(--kol-z-tooltip);
|
|
211
211
|
--z-index-nav: var(--kol-z-nav);
|
|
212
|
+
|
|
213
|
+
/* SPACING (theme-does-not-register-spacing, kol-client-hrafn 2026-09-03).
|
|
214
|
+
* `--kol-spacing-*` was a real scale Tailwind could not see, so a consumer
|
|
215
|
+
* chose between `gap-[var(--kol-spacing-6)]` — 28 characters, and a
|
|
216
|
+
* `var(--kol-*)` read in JSX, which check 2 of the full-consumption contract
|
|
217
|
+
* flags — and `gap-6`, which is TAILWIND's number: identical today because
|
|
218
|
+
* both ladders are index × 4, and silently divergent the day KOL moves a
|
|
219
|
+
* step. hrafn swept 57 call sites twice in one session over exactly that.
|
|
220
|
+
*
|
|
221
|
+
* The indices already agree, so this is a no-op visually and a real change
|
|
222
|
+
* semantically: `p-4` now resolves THROUGH the KOL token, and a step that
|
|
223
|
+
* moves here moves everywhere.
|
|
224
|
+
*
|
|
225
|
+
* THE OFF-LADDER STEPS STILL GENERATE, deliberately. Tailwind v4's `--spacing`
|
|
226
|
+
* multiplier produces any numeric step on demand (`p-7`, `gap-1.5`), and the
|
|
227
|
+
* ticket asks for the gaps in the ladder (no 7, 9, 11…) to stop emitting.
|
|
228
|
+
* Measured before deciding: 130+ off-ladder utilities across this repo's own
|
|
229
|
+
* packages, kol-website, the clients, fxr, monitor and mirror — `gap-1.5` ×30,
|
|
230
|
+
* `py-1.5` ×24, `gap-0.5` ×18 alone. Killing the multiplier drops every one of
|
|
231
|
+
* them to NOTHING EMITTED, no error — the same silent failure this block was
|
|
232
|
+
* written to end for `z-modal`. Closing the ladder is a real ruling and it
|
|
233
|
+
* needs its own sweep, not a side effect of registering the scale. */
|
|
234
|
+
--spacing-1: var(--kol-spacing-1);
|
|
235
|
+
--spacing-2: var(--kol-spacing-2);
|
|
236
|
+
--spacing-3: var(--kol-spacing-3);
|
|
237
|
+
--spacing-4: var(--kol-spacing-4);
|
|
238
|
+
--spacing-5: var(--kol-spacing-5);
|
|
239
|
+
--spacing-6: var(--kol-spacing-6);
|
|
240
|
+
--spacing-8: var(--kol-spacing-8);
|
|
241
|
+
--spacing-10: var(--kol-spacing-10);
|
|
242
|
+
--spacing-12: var(--kol-spacing-12);
|
|
243
|
+
--spacing-16: var(--kol-spacing-16);
|
|
244
|
+
--spacing-20: var(--kol-spacing-20);
|
|
245
|
+
--spacing-24: var(--kol-spacing-24);
|
|
246
|
+
|
|
247
|
+
/* The two semantic steps a PAGE RAMP names, registered because they read as
|
|
248
|
+
* utilities (`py-section`, `px-container`). The three `--kol-spacing-gap-*`
|
|
249
|
+
* aliases stay CSS-only on purpose: `gap-gap-md` stutters, and `gap-md` would
|
|
250
|
+
* have to burn `--spacing-md`, a name too generic to spend on three values
|
|
251
|
+
* that are already `2` / `4` / `6`. */
|
|
252
|
+
--spacing-section: var(--kol-spacing-section);
|
|
253
|
+
--spacing-container: var(--kol-spacing-container);
|
|
212
254
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.142.0",
|
|
4
4
|
"description": "KOL (Kolkrabbi) design-system tokens + base CSS — brand-neutral. The canonical token/cascade layer every other KOL package and consumer builds on.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|