@carissa-io/theme-default 0.3.17 → 0.3.18
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/DESIGN.md +4 -2
- package/README.md +23 -12
- package/dist/index.css +28 -4
- package/package.json +1 -1
- package/scss/_modes.scss +39 -10
- package/scss/_tokens.scss +9 -4
package/DESIGN.md
CHANGED
|
@@ -85,9 +85,11 @@ Every `muted` text pairing passes AA in both modes (a test asserts it): the ligh
|
|
|
85
85
|
(`#dee2e6`); it draws nothing today.
|
|
86
86
|
|
|
87
87
|
## Scrollbars
|
|
88
|
-
|
|
88
|
+
Every scroll container is themed with no scrollbar rule in any component. The colours are the roles `scrollbar-thumb` and `scrollbar-track`: the thumb is the neutral 500 (`#737373`) in both modes; the track is the page ground, equal to `background` (`#ffffff` / `#0a0a0a`), so the scrollbar is just a thumb on the page and no extra rail is drawn. The thumb passes the 3:1 non-text minimum against the track and the background (4.74 / 4.18, the same pair) and also on `surface` (4.35 / 3.78) and the `surface-active` hover fill (3.76 / 3.19); a test asserts that the track equals the background and the ratio in each mode. Known trade-off: inside a surface-coloured container (the sidebar, a card) the track shows as a strip of the page colour; a theme can override `$scrollbar-track` (and the dark role) with its surface value.
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Shape: the default theme is square, so the bar is **8px (`$scrollbar-size`, 0.5rem) with a square thumb and no arrow buttons**, like the square corners everywhere else. The radius is the shared `$radius` token (`$scrollbar-radius`), so a theme with rounded corners gets a rounded thumb from the same token. This is drawn with the `*::-webkit-scrollbar` pseudo-elements (bar, track, thumb, corner, and the button hidden with `display: none`), which exist in Blink and WebKit: Chrome, Edge, Safari and the browsers built on them, including the viewport bar. The standard `scrollbar-color` / `scrollbar-width` are not used there on purpose: from Chrome 121 they switch the bar to the standardized rendering (rounded thumb, arrows can remain) and make the pseudo-elements ignored, with no control of the shape.
|
|
91
|
+
|
|
92
|
+
Known limits: Firefox has no `::-webkit-scrollbar`, so it gets the standard properties inside `@supports not selector(::-webkit-scrollbar)` (`scrollbar-color` on `:root` with the same roles, `scrollbar-width: thin` on `*` because that property is not inherited). Its shape cannot be styled: the thumb ends are not square there, and the width is its own `thin`. Engines without either keep the native bar, which stays usable. Touch and overlay scrollbars ignore all of this. Every selector has zero or near-zero specificity (`*`, `*::-webkit-scrollbar...`) and there is no `!important`, so a component rule always wins: the carousel hides its bar on purpose (`.c-carousel__track::-webkit-scrollbar { display: none }` and `scrollbar-width: none`) and the theme does not undo it.
|
|
91
93
|
|
|
92
94
|
## Typography
|
|
93
95
|
Configured through [components-typography](components/components-typography): `Heading` (the element comes from `level`, the look from `size`)
|
package/README.md
CHANGED
|
@@ -64,17 +64,26 @@ The Sass tokens above stay the static **light** values (for Sass consumers); the
|
|
|
64
64
|
text color are the app's: give `body` `background: var(--c-background); color: var(--c-text)`.
|
|
65
65
|
|
|
66
66
|
## Scrollbars
|
|
67
|
-
The theme styles every scroll container with no change in any component: the page
|
|
68
|
-
drawer bodies, the select, combobox and listbox popups, the sidebar and code blocks.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
The theme styles every scroll container with no change in any component: the page (the viewport bar follows), the message list, the table
|
|
68
|
+
wrapper, the modal and drawer bodies, the select, combobox and listbox popups, the sidebar and code blocks. The two palette roles
|
|
69
|
+
`--c-scrollbar-thumb` and `--c-scrollbar-track` follow `data-mode`.
|
|
70
|
+
|
|
71
|
+
- **Chrome, Edge, Safari and other Blink / WebKit browsers** get an 8px bar (`$scrollbar-size`) with a **square thumb** (`$scrollbar-radius`,
|
|
72
|
+
which is the shared `$radius`, so a theme with rounded corners gets a rounded thumb) and **no arrow buttons**, drawn with the
|
|
73
|
+
`*::-webkit-scrollbar` pseudo-elements. The standard `scrollbar-color` and `scrollbar-width` are deliberately not used there: from Chrome 121
|
|
74
|
+
they switch the bar to the standardized rendering (rounded thumb, arrows can remain) and make the pseudo-elements ignored.
|
|
75
|
+
- **Firefox** has no such pseudo-elements, so it gets the standard properties (`scrollbar-color` on `:root`, `scrollbar-width: thin` from
|
|
76
|
+
`$scrollbar-width` on `*`), coloured with the same roles. Their shape cannot be styled: the thumb ends are not square there.
|
|
77
|
+
- Older engines keep the native bar.
|
|
78
|
+
|
|
79
|
+
All the rules have zero or near-zero specificity (`*` and `*::-webkit-scrollbar...`), so any component rule or your own rule wins over them; the
|
|
80
|
+
carousel already hides its own bar.
|
|
81
|
+
|
|
82
|
+
To change them in your own theme, set `$scrollbar-thumb`, `$scrollbar-track`, `$scrollbar-size`, `$scrollbar-radius` and `$scrollbar-width` in
|
|
83
|
+
your `scss/_tokens.scss` (and the dark values of the two roles in `scss/_modes.scss`); keep the thumb at 3:1 or more against the track and against
|
|
84
|
+
the background. The default track is the page background, so inside a surface-coloured container (the sidebar, a card) it shows as a strip of the
|
|
85
|
+
page colour; a theme that prefers it quieter there sets `$scrollbar-track` to its surface value. An app that only needs one scroller to look
|
|
86
|
+
different overrides `::-webkit-scrollbar-thumb` (and `scrollbar-color` for Firefox) on that element. See [DESIGN.md](DESIGN.md) for the values and limits.
|
|
78
87
|
|
|
79
88
|
## Tokens
|
|
80
89
|
The palette and the values shared by every component are Sass variables in `scss/_tokens.scss`, the single source of
|
|
@@ -104,7 +113,9 @@ change.
|
|
|
104
113
|
| `$info` | `#1d4ed8` | info accent and icon (Alert) |
|
|
105
114
|
| `$scrollbar-thumb` | `#737373` | scrollbar thumb |
|
|
106
115
|
| `$scrollbar-track` | `$white` | scrollbar track (the page ground) |
|
|
107
|
-
| `$scrollbar-width` | `thin` | scrollbar thickness |
|
|
116
|
+
| `$scrollbar-width` | `thin` | scrollbar thickness where the standard property is used (Firefox) |
|
|
117
|
+
| `$scrollbar-size` | `0.5rem` | scrollbar thickness in Blink and WebKit |
|
|
118
|
+
| `$scrollbar-radius` | `$radius` | scrollbar thumb radius in Blink and WebKit (square here) |
|
|
108
119
|
| `$font-family` | `'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', sans-serif` | type stack |
|
|
109
120
|
| `$font-family-mono` | `ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace` | monospace stack for system data and code |
|
|
110
121
|
| `$radius` | `0` | corner radius |
|
package/dist/index.css
CHANGED
|
@@ -88,14 +88,38 @@
|
|
|
88
88
|
color-scheme: dark;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
*::-webkit-scrollbar {
|
|
92
|
+
width: 0.5rem;
|
|
93
|
+
height: 0.5rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
*::-webkit-scrollbar-track {
|
|
97
|
+
background-color: var(--c-scrollbar-track);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
*::-webkit-scrollbar-thumb {
|
|
101
|
+
background-color: var(--c-scrollbar-thumb);
|
|
102
|
+
border-radius: 0;
|
|
93
103
|
}
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
*::-webkit-scrollbar-corner {
|
|
106
|
+
background-color: var(--c-scrollbar-track);
|
|
97
107
|
}
|
|
98
108
|
|
|
109
|
+
*::-webkit-scrollbar-button {
|
|
110
|
+
display: none;
|
|
111
|
+
width: 0;
|
|
112
|
+
height: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@supports not selector(::-webkit-scrollbar) {
|
|
116
|
+
:root {
|
|
117
|
+
scrollbar-color: var(--c-scrollbar-thumb) var(--c-scrollbar-track);
|
|
118
|
+
}
|
|
119
|
+
* {
|
|
120
|
+
scrollbar-width: thin;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
99
123
|
.c-input {
|
|
100
124
|
display: block;
|
|
101
125
|
font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carissa-io/theme-default",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.18",
|
|
4
4
|
"description": "Carissa UI: the default theme (Swiss minimalism) as SCSS variable overrides of the Carissa components, with a compiled CSS build",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"style": "dist/index.css",
|
package/scss/_modes.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Carissa Default theme color modes: the light and dark palettes, emitted as CSS custom properties (`--c-<role>`).
|
|
2
|
-
// Loading this partial emits the CSS below (`@use 'modes' as *` in index.scss), including the
|
|
2
|
+
// Loading this partial emits the CSS below (`@use 'modes' as *` in index.scss), including the scrollbar rules at the end;
|
|
3
3
|
// `_tokens.scss` stays Sass-only.
|
|
4
4
|
//
|
|
5
5
|
// no attribute light (the default)
|
|
@@ -105,15 +105,44 @@ $var-arrow-color-disabled: $var-disabled-text;
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
// Scrollbars
|
|
109
|
-
//
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
// Scrollbars. Blink and WebKit (Chrome, Edge, Safari) get the `::-webkit-scrollbar` pseudo-elements, which give full control: a thin bar of
|
|
109
|
+
// `$scrollbar-size`, a thumb with the shared radius (square here) and no arrow buttons. The standard `scrollbar-color` / `scrollbar-width`
|
|
110
|
+
// are NOT used there, because in Chrome 121+ they switch the bar to the standardized rendering (rounded thumb, arrows may remain) and make the
|
|
111
|
+
// pseudo-elements be ignored. They are the fallback only for engines without the pseudo-elements (Firefox), inside `@supports not
|
|
112
|
+
// selector(::-webkit-scrollbar)`; there `scrollbar-color` is inherited (one declaration on `:root`) and `scrollbar-width` is not, so it is
|
|
113
|
+
// declared on every element with the universal selector.
|
|
114
|
+
// Every selector is `*::-webkit-scrollbar...` (0,0,1) or `*` (0,0,0), so a component rule always wins: the carousel hides its bar with
|
|
115
|
+
// `.c-carousel__track::-webkit-scrollbar { display: none }` and `scrollbar-width: none`. No rule here uses `!important`.
|
|
116
|
+
*::-webkit-scrollbar {
|
|
117
|
+
width: t.$scrollbar-size;
|
|
118
|
+
height: t.$scrollbar-size;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
*::-webkit-scrollbar-track {
|
|
122
|
+
background-color: $var-scrollbar-track;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
*::-webkit-scrollbar-thumb {
|
|
126
|
+
background-color: $var-scrollbar-thumb;
|
|
127
|
+
border-radius: t.$scrollbar-radius;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
*::-webkit-scrollbar-corner {
|
|
131
|
+
background-color: $var-scrollbar-track;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
*::-webkit-scrollbar-button {
|
|
135
|
+
display: none;
|
|
136
|
+
width: 0;
|
|
137
|
+
height: 0;
|
|
115
138
|
}
|
|
116
139
|
|
|
117
|
-
|
|
118
|
-
|
|
140
|
+
@supports not selector(::-webkit-scrollbar) {
|
|
141
|
+
:root {
|
|
142
|
+
scrollbar-color: $var-scrollbar-thumb $var-scrollbar-track;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
* {
|
|
146
|
+
scrollbar-width: t.$scrollbar-width;
|
|
147
|
+
}
|
|
119
148
|
}
|
package/scss/_tokens.scss
CHANGED
|
@@ -21,10 +21,6 @@ $error: #dc3545;
|
|
|
21
21
|
$success: #15803d;
|
|
22
22
|
$warning: #a16207;
|
|
23
23
|
$info: #1d4ed8;
|
|
24
|
-
// Scrollbars (every scroll container inherits them from `:root`): a neutral thumb on a track that is the page ground, thin.
|
|
25
|
-
$scrollbar-thumb: #737373; // 4.74:1 on the white track and background (the neutral 500)
|
|
26
|
-
$scrollbar-track: $white; // the light background: the track is the page ground
|
|
27
|
-
$scrollbar-width: thin;
|
|
28
24
|
|
|
29
25
|
// Values shared by every component, so the whole theme moves together.
|
|
30
26
|
$font-family: ('Helvetica Neue', Helvetica, Arial, 'Liberation Sans', sans-serif);
|
|
@@ -38,6 +34,15 @@ $label-font-size: 0.6875rem;
|
|
|
38
34
|
$label-font-weight: 700;
|
|
39
35
|
$label-letter-spacing: 0.1em;
|
|
40
36
|
|
|
37
|
+
// Scrollbars: a neutral thumb on a track that is the page ground. Blink and WebKit draw them with the `::-webkit-scrollbar` pseudo-elements
|
|
38
|
+
// (size and radius; the radius is the shared one, so the default theme has square ends and no arrows); the width is the fallback of the
|
|
39
|
+
// standard `scrollbar-width` for engines without those pseudo-elements (Firefox).
|
|
40
|
+
$scrollbar-thumb: #737373; // 4.74:1 on the white track and background (the neutral 500)
|
|
41
|
+
$scrollbar-track: $white; // the light background: the track is the page ground
|
|
42
|
+
$scrollbar-width: thin; // the standard property, used only where the pseudo-elements do not exist
|
|
43
|
+
$scrollbar-size: 0.5rem; // 8px, the thickness of the bar and the thumb
|
|
44
|
+
$scrollbar-radius: $radius; // square ends in this theme
|
|
45
|
+
|
|
41
46
|
// The dropdown arrow of Select and Combobox: 16px, muted, black on hover and when open, turns over with the list.
|
|
42
47
|
$arrow-size: 1rem;
|
|
43
48
|
$arrow-offset: 0.75rem;
|