@gjsify/adwaita-web 0.52.0 → 0.54.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/src/index.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  // SCSS partials at `@gjsify/adwaita-web/scss/...` for custom theming.
6
6
  // Reference: refs/libadwaita (colors/sizing), refs/adwaita-web (component patterns).
7
7
 
8
+ import { followDesktopAppearance } from './appearance.js';
8
9
  import { ADWAITA_WEB_CSS } from './styles.generated.js';
9
10
 
10
11
  // NO font import here, and the absence is the decision. This line used to be
@@ -36,6 +37,13 @@ if (typeof document !== 'undefined' && !document.getElementById('adwaita-web-sty
36
37
  document.head.appendChild(style);
37
38
  }
38
39
 
40
+ // The desktop's accent and colour scheme (ADR 0078): a server handoff in <meta> tags
41
+ // or JSON, then the CSS system colour `AccentColor` once asked for, both below the
42
+ // app's own `applyAdwaitaAccent`. Started on import like the stylesheet, so a
43
+ // gjsify-served page that carries the tags needs no code at all. Browser-only and
44
+ // idempotent.
45
+ followDesktopAppearance();
46
+
39
47
  // Responsive breakpoints: the browser size source for `@gjsify/adwaita-core`'s
40
48
  // `AdwBreakpoint`, and the `breakpoint="…"` attribute wiring the split views use.
41
49
  export { addBreakpoints, bindBreakpointSetter } from './breakpoints.js';
@@ -51,6 +59,16 @@ export {
51
59
  } from './accent.js';
52
60
  export type { ApplyAccentOptions } from './accent.js';
53
61
 
62
+ // Following the desktop's accent and colour scheme (ADR 0078); started on import, above.
63
+ export {
64
+ adwaitaAccentSource,
65
+ applyDesktopAppearance,
66
+ applySystemAccent,
67
+ followDesktopAppearance,
68
+ readSystemAccent,
69
+ } from './appearance.js';
70
+ export type { AdwAccentSource } from './appearance.js';
71
+
54
72
  // GtkScrolledWindow's undershoot/overshoot indicators. `adw-toolbar-view` drives
55
73
  // this itself; exported so a consumer that owns its own chrome can shade a scroller
56
74
  // without one.
@@ -270,7 +270,7 @@ export const AdwKeyboardOperableTest = async () => {
270
270
  // because `<adw-header-bar>` builds the section it goes in from its own
271
271
  // `connectedCallback`. Without this the dialog measures as having no
272
272
  // focusable control at all — which is also what its initial focus sees,
273
- // ledgered in status/open-todos.md.
273
+ // ledgered in status/open-todos/README.md.
274
274
  await Promise.resolve();
275
275
 
276
276
  const surface = modal.surface(el);
@@ -620,7 +620,7 @@ export const AdwKeyboardOperableTest = async () => {
620
620
  // inside and Left/Right propagates, so the axis has to follow the attribute.
621
621
  //
622
622
  // Prose cannot hold that: this line fails the commit that adds it.
623
- // `<adw-inline-view-switcher>` has the same gap (status/open-todos.md).
623
+ // `<adw-inline-view-switcher>` has the same gap (status/open-todos/README.md).
624
624
  // `active-name` joined the list without touching the axis: it picks a toggle.
625
625
  expect([...AdwToggleGroup.observedAttributes]).toStrictEqual(['active', 'active-name', 'flat', 'round']);
626
626
  });
@@ -632,7 +632,7 @@ export const AdwKeyboardOperableTest = async () => {
632
632
  // entry, and this is the line that fails when it stops being true — the first
633
633
  // disabled toggle is otherwise a `focus()` the browser refuses, with nothing
634
634
  // in the walk to step over it. Grow this list and add the filter and its spec
635
- // in the same change (status/open-todos.md, `<adw-toggle>` has no `enabled`).
635
+ // in the same change (status/open-todos/README.md, `<adw-toggle>` has no `enabled`).
636
636
  expect([...AdwToggle.observedAttributes]).toStrictEqual(['label', 'icon-name']);
637
637
  });
638
638
 
@@ -34,8 +34,20 @@ import {
34
34
  * and a `.monospace` label on the SAME page rendered in DIFFERENT typefaces.
35
35
  * `_variables.scss` is where that stack is argued about (it explains why
36
36
  * 'Cantarell' is dropped from it), so it is where it lives.
37
+ *
38
+ * The repeat is still a SECOND COPY, and a copy of a value the conformance rule
39
+ * CAN see is the failure this constant was created to end — a tail edited in one
40
+ * place and not the other is an editor in one typeface and a label beside it in
41
+ * another, which is the same bug one argument shorter. It is a `var()` FALLBACK,
42
+ * so the token wins whenever the stylesheet is loaded and this only answers for a
43
+ * page that loaded the element without the theme. Nothing enforces the agreement:
44
+ * `stylesheet-font-families` reads `.css`/`.scss`, and reaching a TS string literal
45
+ * would make it a JS parser, which its own header rules out. So it stays a step of
46
+ * the same edit, and `status/open-todos/adwaita-web.md` § "`<adw-source-view>` has
47
+ * no browser suite" is where the missing check is tracked.
37
48
  */
38
- const MONO_FONT = "var(--monospace-font-family, 'Adwaita Mono', ui-monospace, 'SF Mono', 'Menlo', monospace)";
49
+ const MONO_FONT =
50
+ "var(--monospace-font-family, 'Adwaita Mono', ui-monospace, 'SF Mono', 'Cascadia Code', 'Consolas', 'Menlo', monospace)";
39
51
 
40
52
  /** The CodeMirror EditorView theme mapping `.cm-*` chrome to Adwaita tokens. */
41
53
  export const adwaitaEditorTheme = EditorView.theme({