@gjsify/adwaita-web 0.31.0 → 0.33.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.
Files changed (183) hide show
  1. package/dist/adwaita-web.css +835 -299
  2. package/dist/adwaita-web.css.map +1 -1
  3. package/lib/types/adw-about-dialog.spec.d.ts +1 -0
  4. package/lib/types/adw-action-rows.spec.d.ts +1 -0
  5. package/lib/types/adw-avatar.spec.d.ts +1 -0
  6. package/lib/types/adw-banner.spec.d.ts +1 -0
  7. package/lib/types/adw-button-content.spec.d.ts +1 -0
  8. package/lib/types/adw-carousel.spec.d.ts +1 -0
  9. package/lib/types/adw-checks.spec.d.ts +1 -0
  10. package/lib/types/adw-header-bar.spec.d.ts +1 -0
  11. package/lib/types/adw-icon.spec.d.ts +1 -0
  12. package/lib/types/adw-progress-bar.spec.d.ts +1 -0
  13. package/lib/types/adw-sidebar.spec.d.ts +1 -0
  14. package/lib/types/adw-switch.spec.d.ts +1 -0
  15. package/lib/types/adw-wrap-box.spec.d.ts +1 -0
  16. package/lib/types/bottom-sheet.spec.d.ts +1 -0
  17. package/lib/types/breakpoints.d.ts +22 -0
  18. package/lib/types/breakpoints.spec.d.ts +1 -0
  19. package/lib/types/chrome.spec.d.ts +1 -0
  20. package/lib/types/elements/adw-about-dialog.d.ts +47 -8
  21. package/lib/types/elements/adw-action-row.d.ts +35 -0
  22. package/lib/types/elements/adw-avatar.d.ts +11 -0
  23. package/lib/types/elements/adw-bottom-sheet.d.ts +33 -4
  24. package/lib/types/elements/adw-button-content.d.ts +12 -0
  25. package/lib/types/elements/adw-button-row.d.ts +10 -1
  26. package/lib/types/elements/adw-carousel.d.ts +111 -8
  27. package/lib/types/elements/adw-checks.d.ts +57 -0
  28. package/lib/types/elements/adw-clamp.d.ts +4 -1
  29. package/lib/types/elements/adw-combo-row.d.ts +10 -0
  30. package/lib/types/elements/adw-data-grid.d.ts +11 -31
  31. package/lib/types/elements/adw-drop-down.d.ts +17 -20
  32. package/lib/types/elements/adw-entry-row.d.ts +93 -3
  33. package/lib/types/elements/adw-expander-row.d.ts +7 -1
  34. package/lib/types/elements/adw-header-bar.d.ts +15 -0
  35. package/lib/types/elements/adw-icon.d.ts +25 -0
  36. package/lib/types/elements/adw-inline-view-switcher.d.ts +73 -11
  37. package/lib/types/elements/adw-menu-button.d.ts +6 -6
  38. package/lib/types/elements/adw-navigation-split-view.d.ts +48 -0
  39. package/lib/types/elements/adw-navigation-view.d.ts +63 -20
  40. package/lib/types/elements/adw-overlay-split-view.d.ts +94 -0
  41. package/lib/types/elements/adw-password-entry-row.d.ts +19 -10
  42. package/lib/types/elements/adw-popover.d.ts +58 -0
  43. package/lib/types/elements/adw-preferences-dialog.d.ts +57 -2
  44. package/lib/types/elements/adw-preferences-group.d.ts +31 -0
  45. package/lib/types/elements/adw-progress-bar.d.ts +38 -0
  46. package/lib/types/elements/adw-sidebar.d.ts +37 -5
  47. package/lib/types/elements/adw-spinner.d.ts +23 -0
  48. package/lib/types/elements/adw-split-button.d.ts +53 -7
  49. package/lib/types/elements/adw-switch-row.d.ts +11 -2
  50. package/lib/types/elements/adw-switch.d.ts +15 -0
  51. package/lib/types/elements/adw-tab-view.d.ts +129 -12
  52. package/lib/types/elements/adw-toolbar-view.d.ts +5 -0
  53. package/lib/types/elements/adw-view-stack.d.ts +39 -19
  54. package/lib/types/elements/adw-view-switcher-bar.d.ts +25 -7
  55. package/lib/types/elements/adw-view-switcher.d.ts +76 -13
  56. package/lib/types/elements/adw-window-title.d.ts +3 -1
  57. package/lib/types/elements/adw-wrap-box.d.ts +58 -3
  58. package/lib/types/elements/view-switcher-dom.d.ts +44 -0
  59. package/lib/types/entry-rows.spec.d.ts +1 -0
  60. package/lib/types/index.d.ts +7 -0
  61. package/lib/types/navigation-view.spec.d.ts +1 -0
  62. package/lib/types/preferences-search.d.ts +20 -0
  63. package/lib/types/preferences.spec.d.ts +1 -0
  64. package/lib/types/split-button.spec.d.ts +1 -0
  65. package/lib/types/split-views.spec.d.ts +1 -0
  66. package/lib/types/styles.generated.d.ts +1 -1
  67. package/lib/types/tab-view.spec.d.ts +1 -0
  68. package/lib/types/view-stack.spec.d.ts +1 -0
  69. package/lib/types/view-switcher.spec.d.ts +1 -0
  70. package/package.json +6 -6
  71. package/scss/_banner.scss +13 -0
  72. package/scss/_bottom_sheet.scss +5 -6
  73. package/scss/_button.scss +3 -26
  74. package/scss/_button_content.scss +28 -0
  75. package/scss/_checks.scss +228 -0
  76. package/scss/_clamp.scss +9 -3
  77. package/scss/_combo_row.scss +19 -0
  78. package/scss/_data_grid.scss +15 -7
  79. package/scss/_drop_down.scss +12 -55
  80. package/scss/_expander_row.scss +5 -50
  81. package/scss/_icon.scss +51 -0
  82. package/scss/_icons.generated.scss +6 -0
  83. package/scss/_inline_view_switcher.scss +34 -0
  84. package/scss/_labels.scss +135 -0
  85. package/scss/_menu_button.scss +10 -70
  86. package/scss/_navigation_split_view.scss +47 -8
  87. package/scss/_overlay_split_view.scss +117 -32
  88. package/scss/_popover.scss +186 -0
  89. package/scss/_preferences.scss +29 -0
  90. package/scss/_preferences_dialog.scss +17 -0
  91. package/scss/_progress_bar.scss +161 -0
  92. package/scss/_reset.scss +18 -7
  93. package/scss/_spinner.scss +37 -19
  94. package/scss/_split_button.scss +6 -50
  95. package/scss/_switch.scss +90 -0
  96. package/scss/_switch_row.scss +6 -52
  97. package/scss/_tab_view.scss +63 -0
  98. package/scss/_theme.scss +10 -0
  99. package/scss/_toolbar_view.scss +74 -0
  100. package/scss/_variables.scss +34 -0
  101. package/scss/_view_switcher.scss +40 -0
  102. package/scss/_view_switcher_bar.scss +37 -0
  103. package/scss/_wrap_box.scss +65 -6
  104. package/scss/adwaita-skin.scss +23 -0
  105. package/src/adw-about-dialog.spec.ts +350 -0
  106. package/src/adw-action-rows.spec.ts +342 -0
  107. package/src/adw-avatar.spec.ts +176 -0
  108. package/src/adw-banner.spec.ts +152 -0
  109. package/src/adw-button-content.spec.ts +207 -0
  110. package/src/adw-button-row.spec.ts +12 -6
  111. package/src/adw-carousel.spec.ts +389 -0
  112. package/src/adw-checks.spec.ts +368 -0
  113. package/src/adw-drop-down.spec.ts +123 -0
  114. package/src/adw-header-bar.spec.ts +83 -0
  115. package/src/adw-icon.spec.ts +167 -0
  116. package/src/adw-progress-bar.spec.ts +173 -0
  117. package/src/adw-row-state.spec.ts +49 -0
  118. package/src/adw-sidebar.spec.ts +332 -0
  119. package/src/adw-switch.spec.ts +242 -0
  120. package/src/adw-tab-view.spec.ts +12 -3
  121. package/src/adw-view-switcher-bar.spec.ts +61 -13
  122. package/src/adw-wrap-box.spec.ts +341 -0
  123. package/src/bottom-sheet.spec.ts +325 -0
  124. package/src/breakpoints.spec.ts +147 -0
  125. package/src/breakpoints.ts +67 -0
  126. package/src/chrome.spec.ts +400 -0
  127. package/src/elements/adw-about-dialog.ts +223 -163
  128. package/src/elements/adw-action-row.ts +131 -11
  129. package/src/elements/adw-avatar.ts +48 -54
  130. package/src/elements/adw-banner.ts +46 -10
  131. package/src/elements/adw-bottom-sheet.ts +145 -60
  132. package/src/elements/adw-button-content.ts +107 -33
  133. package/src/elements/adw-button-row.ts +61 -37
  134. package/src/elements/adw-button.ts +5 -7
  135. package/src/elements/adw-carousel.ts +467 -105
  136. package/src/elements/adw-checks.ts +299 -0
  137. package/src/elements/adw-clamp.ts +80 -10
  138. package/src/elements/adw-combo-row.ts +32 -7
  139. package/src/elements/adw-data-grid.ts +43 -91
  140. package/src/elements/adw-drop-down.ts +117 -128
  141. package/src/elements/adw-entry-row.ts +404 -36
  142. package/src/elements/adw-expander-row.ts +61 -29
  143. package/src/elements/adw-header-bar.ts +31 -6
  144. package/src/elements/adw-icon.ts +148 -0
  145. package/src/elements/adw-inline-view-switcher.ts +325 -131
  146. package/src/elements/adw-menu-button.ts +93 -70
  147. package/src/elements/adw-navigation-split-view.ts +220 -14
  148. package/src/elements/adw-navigation-view.ts +286 -148
  149. package/src/elements/adw-overlay-split-view.ts +536 -28
  150. package/src/elements/adw-password-entry-row.ts +111 -89
  151. package/src/elements/adw-popover.ts +283 -0
  152. package/src/elements/adw-preferences-dialog.ts +120 -21
  153. package/src/elements/adw-preferences-group.ts +128 -22
  154. package/src/elements/adw-progress-bar.ts +189 -0
  155. package/src/elements/adw-sidebar.ts +301 -142
  156. package/src/elements/adw-spin-row.ts +11 -5
  157. package/src/elements/adw-spinner.ts +168 -9
  158. package/src/elements/adw-split-button.ts +371 -92
  159. package/src/elements/adw-status-page.ts +9 -9
  160. package/src/elements/adw-switch-row.ts +100 -30
  161. package/src/elements/adw-switch.ts +129 -0
  162. package/src/elements/adw-tab-view.ts +700 -129
  163. package/src/elements/adw-toggle-group.ts +5 -7
  164. package/src/elements/adw-toolbar-view.ts +84 -21
  165. package/src/elements/adw-view-stack.ts +183 -85
  166. package/src/elements/adw-view-switcher-bar.ts +171 -81
  167. package/src/elements/adw-view-switcher.ts +328 -117
  168. package/src/elements/adw-window-title.ts +44 -11
  169. package/src/elements/adw-wrap-box.ts +329 -78
  170. package/src/elements/view-switcher-dom.ts +108 -0
  171. package/src/entry-rows.spec.ts +391 -0
  172. package/src/index.ts +23 -0
  173. package/src/navigation-view.spec.ts +435 -0
  174. package/src/preferences-search.ts +135 -0
  175. package/src/preferences.spec.ts +250 -0
  176. package/src/source-view/adw-source-view.ts +2 -5
  177. package/src/split-button.spec.ts +470 -0
  178. package/src/split-views.spec.ts +893 -0
  179. package/src/styles.generated.ts +1 -1
  180. package/src/tab-view.spec.ts +451 -0
  181. package/src/test.browser.mts +49 -0
  182. package/src/view-stack.spec.ts +272 -0
  183. package/src/view-switcher.spec.ts +665 -0
@@ -1,7 +1,11 @@
1
1
  // _switch_row.scss — adw-switch-row styling.
2
+ //
3
+ // The TOGGLE is not here: it is `<adw-switch>` and `scss/_switch.scss`. It used
4
+ // to be, nested under `adw-switch-row {`, which is exactly why `.adw-switch` was
5
+ // unreachable from anywhere else and `_expander_row.scss` grew a
6
+ // character-for-character copy of it.
7
+ //
2
8
  // Reference: refs/adwaita-web/adwaita-web/scss/_switch_row.scss
3
- // Reference: refs/adwaita-web/adwaita-web/scss/_switch.scss
4
- // Reference: refs/libadwaita/src/stylesheet/widgets/_switch.scss
5
9
  // Copyright (c) GNOME contributors (libadwaita). LGPLv2.1+.
6
10
  // Copyright (c) 2025 csm (adwaita-web). MIT License.
7
11
  // Modifications: Adapted for @gjsify/adwaita-web Web Components.
@@ -11,54 +15,4 @@ adw-switch-row {
11
15
  font-size: var(--font-size-base);
12
16
  color: var(--card-fg-color);
13
17
  }
14
-
15
- .adw-switch {
16
- position: relative;
17
- display: inline-block;
18
- width: 44px;
19
- height: 24px;
20
- flex-shrink: 0;
21
-
22
- input {
23
- opacity: 0;
24
- width: 0;
25
- height: 0;
26
- position: absolute;
27
- }
28
- }
29
-
30
- .adw-switch-slider {
31
- position: absolute;
32
- cursor: pointer;
33
- inset: 0;
34
- background-color: var(--switch-off-bg);
35
- border-radius: 12px;
36
- transition: background-color 0.15s ease-out;
37
-
38
- &::before {
39
- content: "";
40
- position: absolute;
41
- height: 20px;
42
- width: 20px;
43
- left: 2px;
44
- bottom: 2px;
45
- background-color: var(--switch-knob-bg);
46
- border-radius: 50%;
47
- transition: transform 0.15s ease-out;
48
- box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
49
- }
50
- }
51
-
52
- .adw-switch input:checked + .adw-switch-slider {
53
- background-color: var(--accent-bg-color);
54
-
55
- &::before {
56
- transform: translateX(20px);
57
- }
58
- }
59
-
60
- .adw-switch input:focus-visible + .adw-switch-slider {
61
- outline: 2px solid var(--accent-color);
62
- outline-offset: 2px;
63
- }
64
18
  }
@@ -127,7 +127,66 @@ adw-tab-view {
127
127
  min-width: 0;
128
128
  }
129
129
 
130
+ // --- Icon + indicator slots (AdwTab update_icons) ---
131
+ // Both are mask-image spans carrying `adw-icon adw-icon--<name>`; the element
132
+ // toggles `hidden` from `tabIconState`, whose rules decide which of the two
133
+ // shows — on a pinned tab the indicator REPLACES the icon.
134
+ // Reference: refs/libadwaita/src/adw-tab.c (update_icons, :171-198)
135
+ .adw-tab-icon,
136
+ .adw-tab-indicator {
137
+ flex-shrink: 0;
138
+ width: 16px;
139
+ height: 16px;
140
+
141
+ &[hidden] {
142
+ display: none;
143
+ }
144
+ }
145
+
146
+ // `AdwTabPage:loading` swaps the icon image for an `AdwSpinnerPaintable`
147
+ // (`update_icons`, adw-tab.c:172-190) — the SAME paintable `Adw.Spinner` uses.
148
+ // So the tab mounts a real `<adw-spinner>` in the icon's slot and this block
149
+ // only places it. It used to restate `border: 2px`,
150
+ // `rgba(127, 127, 127, 0.25)` and `0.8s` under a comment claiming the geometry
151
+ // and keyframes were adw-spinner's and "not a second copy of them" — which is
152
+ // how it inherited every spinner defect independently.
153
+ .adw-tab-spinner {
154
+ flex: none;
155
+
156
+ &[hidden] {
157
+ display: none;
158
+ }
159
+ }
160
+
161
+ // A pinned tab is a single-glyph chip: libadwaita hides both the title and the
162
+ // close button at construction (refs/libadwaita/src/adw-tab.c:645-650). The
163
+ // close button is gated in JS by `tabCloseVisible`, which carries the same rule.
164
+ .adw-tab.pinned {
165
+ padding: 0 var(--spacing-xs);
166
+
167
+ .adw-tab-title {
168
+ display: none;
169
+ }
170
+ }
171
+
172
+ // `AdwTabPage:needs-attention` — the accent underline libadwaita animates in
173
+ // (refs/libadwaita/src/adw-tab.c update_needs_attention).
174
+ .adw-tab.needs-attention::after {
175
+ content: '';
176
+ position: absolute;
177
+ bottom: 2px;
178
+ left: 50%;
179
+ width: 12px;
180
+ height: 2px;
181
+ transform: translateX(-50%);
182
+ border-radius: 1px;
183
+ background-color: var(--accent-bg-color);
184
+ }
185
+
130
186
  // --- Close affordance (CSS-drawn "×", no symbolic icon ships) ---
187
+ // Presence is decided in JS by `tabCloseVisible` — `(hovering && fullyVisible)
188
+ // || selected || dragging`, and never on a pinned tab (adw-tab.c:124, :645-650)
189
+ // — which is why the `[hidden]` rule below is load-bearing rather than cosmetic.
131
190
  .adw-tab-close {
132
191
  box-sizing: border-box;
133
192
  flex-shrink: 0;
@@ -146,6 +205,10 @@ adw-tab-view {
146
205
  background-color 150ms ease-in-out,
147
206
  opacity 150ms ease-in-out;
148
207
 
208
+ &[hidden] {
209
+ display: none;
210
+ }
211
+
149
212
  &:hover {
150
213
  opacity: 1;
151
214
  background-color: var(--button-hover-color);
package/scss/_theme.scss CHANGED
@@ -31,6 +31,16 @@
31
31
  --entry-border-hover-color: rgba(255, 255, 255, 0.26);
32
32
  --destructive-bg-color: #c01c28;
33
33
  --destructive-fg-color: #ffffff;
34
+ // Semantic states — libadwaita's dark overrides (_colors.scss:83-92): the
35
+ // backgrounds darken (green_5 / a hand-picked amber / red_4) and the
36
+ // standalone colour LIGHTENS instead of darkening, so it stays readable on a
37
+ // dark surface. Upstream does not re-declare the `*-fg-color`s here either.
38
+ --success-bg-color: #26a269;
39
+ --success-color: oklab(from var(--success-bg-color) max(l, 0.85) a b);
40
+ --warning-bg-color: #cd9309;
41
+ --warning-color: oklab(from var(--warning-bg-color) max(l, 0.85) a b);
42
+ --error-bg-color: #c01c28;
43
+ --error-color: oklab(from var(--error-bg-color) max(l, 0.85) a b);
34
44
  --switch-off-bg: rgba(255, 255, 255, 0.2);
35
45
  --switch-knob-bg: #deddda;
36
46
  // The active toggle is a raised near-white chip in both themes, so its text
@@ -11,6 +11,8 @@ adw-toolbar-view {
11
11
  min-height: 0;
12
12
  min-width: 0;
13
13
  flex: 1 1 auto;
14
+ // Positioning context for the extend-content-to-*-edge overlays below.
15
+ position: relative;
14
16
 
15
17
  .adw-toolbar-view-top,
16
18
  .adw-toolbar-view-bottom {
@@ -28,4 +30,76 @@ adw-toolbar-view {
28
30
  flex-direction: column;
29
31
  background-color: var(--window-bg-color);
30
32
  }
33
+
34
+ // top-bar-style / bottom-bar-style: an opaque background plus a persistent
35
+ // shadow, which `.border` swaps for a hairline (adw-toolbar-view.c:1011-1024,
36
+ // _toolbars.scss `> .top-bar.raised`).
37
+ .adw-toolbar-view-top.raised,
38
+ .adw-toolbar-view-bottom.raised {
39
+ background-color: var(--headerbar-bg-color);
40
+ color: var(--headerbar-fg-color);
41
+ }
42
+
43
+ .adw-toolbar-view-top.raised {
44
+ box-shadow:
45
+ 0 1px var(--headerbar-shade-color),
46
+ 0 2px 4px var(--headerbar-shade-color);
47
+
48
+ &.border {
49
+ box-shadow: 0 1px var(--headerbar-shade-color);
50
+ }
51
+ }
52
+
53
+ .adw-toolbar-view-bottom.raised {
54
+ box-shadow:
55
+ 0 -1px var(--headerbar-shade-color),
56
+ 0 -2px 4px var(--headerbar-shade-color);
57
+
58
+ &.border {
59
+ box-shadow: 0 -1px var(--headerbar-shade-color);
60
+ }
61
+ }
62
+
63
+ // The scroll fade under a FLAT bar. libadwaita paints it on the scrolled
64
+ // window; the browser equivalent is a non-interactive gradient stuck to the
65
+ // scrollport edge, taking no space of its own — a NEGATIVE margin equal to its
66
+ // height (_toolbars.scss :342-343, _scrolling.scss :150-157).
67
+ &.undershoot-top .adw-toolbar-view-content::before,
68
+ &.undershoot-bottom .adw-toolbar-view-content::after {
69
+ content: '';
70
+ position: sticky;
71
+ height: 6px;
72
+ flex-shrink: 0;
73
+ pointer-events: none;
74
+ }
75
+
76
+ &.undershoot-top .adw-toolbar-view-content::before {
77
+ top: 0;
78
+ margin-bottom: -6px;
79
+ background: linear-gradient(to bottom, var(--headerbar-shade-color), transparent);
80
+ }
81
+
82
+ &.undershoot-bottom .adw-toolbar-view-content::after {
83
+ bottom: 0;
84
+ margin-top: -6px;
85
+ background: linear-gradient(to top, var(--headerbar-shade-color), transparent);
86
+ }
87
+ }
88
+
89
+ // extend-content-to-*-edge: the content spans the full height and the bar is
90
+ // drawn OVER it, which is `content_offset = 0` / `content_height = height` in
91
+ // adw_toolbar_view_size_allocate (adw-toolbar-view.c:390-397).
92
+ adw-toolbar-view[extend-content-to-top-edge] > .adw-toolbar-view-top,
93
+ adw-toolbar-view[extend-content-to-bottom-edge] > .adw-toolbar-view-bottom {
94
+ position: absolute;
95
+ left: 0;
96
+ right: 0;
97
+ }
98
+
99
+ adw-toolbar-view[extend-content-to-top-edge] > .adw-toolbar-view-top {
100
+ top: 0;
101
+ }
102
+
103
+ adw-toolbar-view[extend-content-to-bottom-edge] > .adw-toolbar-view-bottom {
104
+ bottom: 0;
31
105
  }
@@ -60,6 +60,23 @@
60
60
  --destructive-bg-color: #e01b24;
61
61
  --destructive-fg-color: #ffffff;
62
62
 
63
+ // Semantic states. `.error` / `.warning` / `.success` (see _labels.scss) do
64
+ // not just recolour text — they REBIND the three accent tokens to these, so
65
+ // anything accent-coloured inside them follows. Values are libadwaita's
66
+ // (_colors.scss:16-29): red_3 / yellow_5 / green_4 from _palette.scss:106-121.
67
+ // The standalone `*-color` is upstream's own relative-colour derivation of the
68
+ // background, kept as an expression rather than resolved to a hex so it tracks
69
+ // a re-themed `*-bg-color`.
70
+ --success-bg-color: #2ec27e;
71
+ --success-fg-color: #ffffff;
72
+ --success-color: oklab(from var(--success-bg-color) min(l, 0.5) a b);
73
+ --warning-bg-color: #e5a50a;
74
+ --warning-fg-color: rgba(0, 0, 0, 0.8);
75
+ --warning-color: oklab(from var(--warning-bg-color) min(l, 0.5) a b);
76
+ --error-bg-color: #e01b24;
77
+ --error-fg-color: #ffffff;
78
+ --error-color: oklab(from var(--error-bg-color) min(l, 0.5) a b);
79
+
63
80
  // Switch
64
81
  --switch-off-bg: rgba(0, 0, 0, 0.2);
65
82
  --switch-knob-bg: #ffffff;
@@ -82,4 +99,21 @@
82
99
  --font-size-small: 9pt;
83
100
  --font-size-heading: 12pt;
84
101
  --dim-opacity: 0.55;
102
+
103
+ // Document + monospace families, behind `.document` / `.monospace`
104
+ // (_labels.scss:75-84). In GTK these four are written into `:root` at RUNTIME
105
+ // by AdwStyleManager from the desktop's font settings
106
+ // (adw-style-manager.c:169-218), defaulting to `Sans 10` / `Monospace 10`
107
+ // (:50-56). A browser has no style manager, so they are ordinary tokens here
108
+ // — same names, so re-theming goes through the documented contract. The
109
+ // monospace stack is the one `_data_grid.scss` used to inline; it has ONE home
110
+ // now, and Adwaita Mono heads it because `@gjsify/adwaita-fonts` ships it.
111
+ // `'Cantarell'` is dropped from that stack on the way here: Cantarell is
112
+ // GNOME's PROPORTIONAL UI font, so a monospace fallback chain that reaches it
113
+ // second lands on a font whose figures do not line up — the exact property
114
+ // `.monospace` exists for.
115
+ --document-font-family: var(--font-family);
116
+ --document-font-size: var(--font-size-base);
117
+ --monospace-font-family: 'Adwaita Mono', ui-monospace, 'SF Mono', 'Menlo', monospace;
118
+ --monospace-font-size: var(--font-size-base);
85
119
  }
@@ -47,6 +47,15 @@ adw-view-switcher {
47
47
  user-select: none;
48
48
  -webkit-user-select: none;
49
49
 
50
+ // A page with neither title nor icon has NO button at all
51
+ // (adw-view-switcher.c:178), spelled here as the `hidden` attribute.
52
+ // Re-assert it as an AUTHOR rule: the UA `[hidden] { display: none }`
53
+ // loses to this block's own author `display: inline-flex` (cascade ORIGIN
54
+ // beats specificity), so without this a hidden button stays on screen.
55
+ &[hidden] {
56
+ display: none;
57
+ }
58
+
50
59
  .adw-icon {
51
60
  width: 16px;
52
61
  height: 16px;
@@ -59,6 +68,37 @@ adw-view-switcher {
59
68
  text-overflow: ellipsis;
60
69
  }
61
70
 
71
+ // AdwIndicatorBin's badge — the unread count, or a bare dot when only
72
+ // `needs-attention` is set.
73
+ // Reference: refs/libadwaita/src/adw-indicator-bin.c
74
+ .adw-view-switcher-indicator {
75
+ display: inline-flex;
76
+ box-sizing: border-box;
77
+ align-items: center;
78
+ justify-content: center;
79
+ min-width: 16px;
80
+ height: 16px;
81
+ padding: 0 4px;
82
+ border-radius: 8px;
83
+ background-color: var(--accent-bg-color);
84
+ color: var(--accent-fg-color);
85
+ font-size: 0.625rem;
86
+ font-weight: 700;
87
+ line-height: 1;
88
+
89
+ &[hidden] {
90
+ display: none;
91
+ }
92
+
93
+ &.needs-attention {
94
+ min-width: 6px;
95
+ width: 6px;
96
+ height: 6px;
97
+ padding: 0;
98
+ border-radius: 3px;
99
+ }
100
+ }
101
+
62
102
  &:hover {
63
103
  background-color: var(--button-hover-color);
64
104
  }
@@ -64,6 +64,14 @@ adw-view-switcher-bar {
64
64
  user-select: none;
65
65
  -webkit-user-select: none;
66
66
 
67
+ // Same cascade trap as the bar itself: a page with neither title nor
68
+ // icon has no button (adw-view-switcher.c:178), and the UA
69
+ // `[hidden] { display: none }` loses to this block's author
70
+ // `display: inline-flex` unless it is re-asserted here.
71
+ &[hidden] {
72
+ display: none;
73
+ }
74
+
67
75
  .adw-view-switcher-bar-icon {
68
76
  width: 16px;
69
77
  height: 16px;
@@ -78,6 +86,35 @@ adw-view-switcher-bar {
78
86
  text-overflow: ellipsis;
79
87
  }
80
88
 
89
+ // AdwIndicatorBin's badge — see refs/libadwaita/src/adw-indicator-bin.c.
90
+ .adw-view-switcher-bar-indicator {
91
+ display: inline-flex;
92
+ box-sizing: border-box;
93
+ align-items: center;
94
+ justify-content: center;
95
+ min-width: 16px;
96
+ height: 16px;
97
+ padding: 0 4px;
98
+ border-radius: 8px;
99
+ background-color: var(--accent-bg-color);
100
+ color: var(--accent-fg-color);
101
+ font-size: 0.625rem;
102
+ font-weight: 700;
103
+ line-height: 1;
104
+
105
+ &[hidden] {
106
+ display: none;
107
+ }
108
+
109
+ &.needs-attention {
110
+ min-width: 6px;
111
+ width: 6px;
112
+ height: 6px;
113
+ padding: 0;
114
+ border-radius: 3px;
115
+ }
116
+ }
117
+
81
118
  &:hover {
82
119
  background-color: var(--button-hover-color);
83
120
  }
@@ -5,16 +5,75 @@
5
5
  // Copyright (c) GNOME contributors (libadwaita). LGPLv2.1+.
6
6
  // Modifications: Adapted for @gjsify/adwaita-web Web Components.
7
7
 
8
- // Layout (flex-direction, gaps, justify-content, align-items, align-content) is
9
- // driven imperatively by the component from its attributes — these are the
10
- // libadwaita defaults (horizontal, packed to the start of each line, lines
11
- // wrapping downwards from the top). A wrap box is a pure layout container, so it
12
- // carries no background of its own; children handle their own theming.
8
+ // Direction, gaps, `justify-content` and `align-content` are driven imperatively
9
+ // by the component from its attributes — these are the libadwaita defaults
10
+ // (horizontal, packed to the start of each line, lines wrapping downwards from
11
+ // the top). A wrap box is a pure layout container, so it carries no background
12
+ // of its own; children handle their own theming.
13
13
  adw-wrap-box {
14
14
  display: flex;
15
15
  flex-direction: row;
16
16
  flex-wrap: wrap;
17
17
  justify-content: flex-start;
18
- align-items: flex-start;
18
+ // Each child is allocated the FULL cross extent of its line — `h = line_size`
19
+ // in adw-wrap-layout.c:746-751 — which is `stretch`, the flexbox default. The
20
+ // port used to write `flex-start` here and drive it from `align`, which is a
21
+ // MAIN-axis property in libadwaita and belongs on `justify-content`.
22
+ align-items: stretch;
19
23
  align-content: flex-start;
20
24
  }
25
+
26
+ // `wrap-policy`, published by the component as a custom property. The FALLBACK
27
+ // is the load-bearing part: it is `ADW_WRAP_NATURAL`, libadwaita's default
28
+ // (adw-wrap-box.c:491-495), where CSS defaults `flex-shrink` to 1 — so a wrap
29
+ // box that has not upgraded yet, or one whose policy is unset, draws Adwaita's
30
+ // choice rather than the cascade's.
31
+ adw-wrap-box > * {
32
+ flex-shrink: var(--adw-wrap-box-child-shrink, 0);
33
+ }
34
+
35
+ // FILL grows the children and keeps the spacing constant
36
+ // (adw-wrap-layout.c:317-319, :326-341); SPREAD deliberately does NOT, so the
37
+ // gaps take the leftover instead. `data-line-justify` is the mode the component
38
+ // resolved for a COMPLETE line.
39
+ //
40
+ // A lone child is excluded because it is not on a complete line: a box with one
41
+ // element child has exactly one line, and that line is the final one — see
42
+ // below.
43
+ adw-wrap-box[data-line-justify='fill'] > *:not(:only-child) {
44
+ flex-grow: 1;
45
+ }
46
+
47
+ // `:only-child` is the one line-membership fact CSS knows without a layout pass,
48
+ // and libadwaita treats that line as the LAST one. Both justified modes stretch
49
+ // it: FILL by definition, SPREAD because its "keep the children at their minimum
50
+ // size" branch is guarded by `n_children > 1` (adw-wrap-layout.c:338), so a lone
51
+ // child is stretched regardless (adw-wrap-box.c:349-352).
52
+ adw-wrap-box[data-last-line-justify='fill'] > :only-child,
53
+ adw-wrap-box[data-last-line-justify='spread'] > :only-child {
54
+ flex-grow: 1;
55
+ }
56
+
57
+ // The final line, when it is NOT justified (`justify-last-line` unset — the C
58
+ // default, adw-wrap-box.c:379-381): a generated flex item absorbs that line's
59
+ // leftover space, so it packs at the start of the main axis the way an
60
+ // un-justified line does, while `justify-content: space-between` keeps spreading
61
+ // the complete lines above it. `::after` is the only per-line hook flexbox
62
+ // offers, and it lands on the final line by construction.
63
+ //
64
+ // The negative main-axis margin cancels exactly the one gap the filler would
65
+ // otherwise add, so an exactly-full line can never be pushed into a new one.
66
+ adw-wrap-box[data-line-justify='spread'][data-last-line-justify='none']::after {
67
+ content: '';
68
+ flex: 1 0 0;
69
+ min-width: 0;
70
+ min-height: 0;
71
+ margin-left: calc(-1 * var(--adw-wrap-box-child-spacing, 0px));
72
+ }
73
+
74
+ // A vertical box packs along the block axis, so the gap to cancel is the one
75
+ // before the filler in that direction.
76
+ adw-wrap-box[orientation='vertical'][data-line-justify='spread'][data-last-line-justify='none']::after {
77
+ margin-left: 0;
78
+ margin-top: calc(-1 * var(--adw-wrap-box-child-spacing, 0px));
79
+ }
@@ -13,16 +13,39 @@
13
13
  // Style-isolation boundary — emitted before the components so their own rules
14
14
  // override this typographic/box-model floor (see _reset.scss).
15
15
  @use 'reset';
16
+ // The ONE symbolic-icon box, behind <adw-icon>. Emitted before every widget that
17
+ // draws one, so a context that sizes its own icons (the about dialog's 96px, the
18
+ // split button's 14px arrows, the view switcher's 16px) still wins on ordinary
19
+ // specificity.
20
+ @use 'icon';
21
+ // libadwaita's typography + semantic-colour UTILITY CLASSES (`.dimmed`,
22
+ // `.numeric`, `.monospace`, `.title-1`…). Classes only — there is deliberately
23
+ // no <adw-label>, see _labels.scss. Emitted BEFORE every widget so a widget's
24
+ // own rule wins on ordinary specificity, and because two partials @extend from
25
+ // it (`_progress_bar.scss`'s text node, `_data_grid.scss`'s cells) exactly as
26
+ // libadwaita's own `_progress-bar.scss` does.
27
+ @use 'labels';
16
28
  @use 'window';
17
29
  @use 'headerbar';
18
30
  @use 'window_title';
19
31
  @use 'button';
20
32
  @use 'button_content';
33
+ // The ONE popover surface. Emitted BEFORE the widgets that host one, so a
34
+ // consumer's (or a widget's) own higher-specificity rule still wins over it.
35
+ @use 'popover';
21
36
  @use 'split_button';
22
37
  @use 'menu_button';
23
38
  @use 'drop_down';
24
39
  @use 'toggle_group';
40
+ // The ONE toggle, behind <adw-switch>. Emitted before `switch_row` and
41
+ // `expander_row`, the two widgets that host one — and which each carried their
42
+ // own copy of it until it was lifted out of `adw-switch-row {}`.
43
+ @use 'switch';
25
44
  @use 'entry';
45
+ // The two form-control primitives, in ONE partial because upstream merges them
46
+ // (there is no `_radio.scss` in libadwaita) — see _checks.scss.
47
+ @use 'checks';
48
+ @use 'progress_bar';
26
49
  @use 'preferences';
27
50
  @use 'card';
28
51
  @use 'data_grid';