@webority/theme 0.95.0 → 0.98.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/README.md +8 -22
- package/dist/postcss/forced-states.mjs +1 -1
- package/dist/published-theme.json +5 -5
- package/dist/purge-safelist.json +1 -0
- package/dist/runtime.mjs +1 -0
- package/dist/webority-theme.css +1 -1
- package/package.json +3 -6
- package/scss/_components.scss +18 -8
- package/scss/_runtime-brand.scss +2 -2
- package/scss/_tokens.scss +5 -6
- package/scss/_variables.scss +1 -1
- package/scss/wui/_flow.scss +1 -1
- package/scss/wui/_navigation.scss +7 -0
- package/scss/wui/_overlays.scss +12 -10
- package/scss/wui/_shortcuts.scss +6 -0
- package/scss/wui/_typography.scss +2 -4
- package/dist/webority-brand-signal.css +0 -1
- package/dist/webority-theme-export.mjs +0 -2
- package/scss/_brand-signal.scss +0 -249
package/README.md
CHANGED
|
@@ -129,36 +129,20 @@ The full `wui-components` chain stays the default and renders as before. Each on
|
|
|
129
129
|
Caution: an on-demand partial loaded after the core sheet comes after the shared focus ring and pressed
|
|
130
130
|
wash (`wui/interaction`, `wui/menu-motion`), so check its hover and press states in the showcase.
|
|
131
131
|
|
|
132
|
-
## Signal brand layer (opt-in)
|
|
133
|
-
|
|
134
|
-
`dist/webority-brand-signal.css` (export `@webority/theme/css/brand-signal`, source `scss/_brand-signal.scss`)
|
|
135
|
-
re-points the theme to the Webority company palette: violet #4A0FBF primary, ink #16093A headings, tint
|
|
136
|
-
#F1EBFF, pink #B517C8 for unread counts only, muted text #6A6A6A, a dark set on pure black #000 with neutral
|
|
137
|
-
grey surfaces and violet #A98BFF kept for accents, and the Webority Serif 600 face for page and result titles at 24px and above. It is never imported by
|
|
138
|
-
the default theme (check-theme-exports asserts the default dist has no #4A0FBF).
|
|
139
|
-
|
|
140
|
-
Load it once, after the theme: React `import "@webority/theme/css/brand-signal"`; Razor
|
|
141
|
-
`_content/Webority.Ui.Razor/css/webority-brand-signal.css`; SCSS `@import "@webority/theme/scss/brand-signal"`
|
|
142
|
-
after the components. Dark mode is emitted under `[data-theme=dark]`, `[data-bs-theme=dark]` and the
|
|
143
|
-
`data-theme=auto` media query. Contrast of every brand text and surface pair is held at 4.5:1 by check-contrast.
|
|
144
|
-
`_brand-signal.scss` owns brand values only; no component CSS.
|
|
145
|
-
|
|
146
132
|
## Runtime brand from a product's token file (opt-in)
|
|
147
133
|
|
|
148
134
|
A product's look can be applied to the precompiled theme at runtime, which is how the hosted showcase shows
|
|
149
135
|
every component in a product's design language.
|
|
150
136
|
|
|
151
|
-
- `webority
|
|
152
|
-
|
|
153
|
-
map of custom property to value. It reads the product's compiled CSS, not its SCSS, because Bootstrap's rgb
|
|
154
|
-
triplets and subtle and emphasis mixes only exist after compilation. `light` is the top-level `:root`,
|
|
155
|
-
`dark` the theme's `:root[data-theme=dark]` rule, `bootstrapDark` Bootstrap's `[data-bs-theme=dark]` rule.
|
|
137
|
+
- `webority brand` (the `webority` command of `@webority/tokens`) writes a product's token file, `webority-web.json`,
|
|
138
|
+
format `webority-theme-tokens/2`: `{ format, source, colors: { light, dark }, space, radius, text, fonts, shadow }`.
|
|
156
139
|
- `dist/webority-runtime-brand.css` (export `@webority/theme/css/runtime-brand`, source
|
|
157
140
|
`scss/_runtime-brand.scss`) re-points the few component rules Bootstrap compiles from `$primary` as literals
|
|
158
141
|
(primary buttons, nav pills, pagination, list group, progress, range thumb, mouse focus border, `.link-primary`
|
|
159
142
|
hover, `.table-primary`) at `--bs-primary`. It holds no colour of its own (check-theme-exports asserts it).
|
|
160
|
-
- Load order: the theme, then the runtime brand layer, then the token file's values on `:root`, under
|
|
161
|
-
|
|
143
|
+
- Load order: the theme, then the runtime brand layer, then the token file's values: light on `:root`, dark under
|
|
144
|
+
`:root[data-theme=dark]` and `:root[data-bs-theme=dark]`, and the Bootstrap primary and link triplets under
|
|
145
|
+
`[data-bs-theme=dark]`.
|
|
162
146
|
- Each product serves its file at `/theme/tokens.json` with `Access-Control-Allow-Origin` for the showcase host.
|
|
163
147
|
- A font the token file names renders only when the page has its face: the theme's own families do.
|
|
164
148
|
|
|
@@ -167,10 +151,12 @@ every component in a product's design language.
|
|
|
167
151
|
The classes `wui-force-hover`, `wui-force-focus` and `wui-force-active` make an element show its hover, focus or
|
|
168
152
|
pressed look without a pointer.
|
|
169
153
|
|
|
170
|
-
They exist in the compiled
|
|
154
|
+
They exist in the compiled stylesheet `@webority/theme/css`, not in a
|
|
171
155
|
product's own SCSS build. A product that builds the theme SCSS itself adds `forcedStatesPlugin()`, imported from
|
|
172
156
|
`@webority/theme/postcss/forced-states`, to its PostCSS plugins to get the same classes.
|
|
173
157
|
|
|
158
|
+
Code that sets the classes imports their names from `@webority/theme/runtime` as `FORCED_STATE_CLASSES` (`hover`, `focus`, `active`). The export has no dependencies, so it runs in a browser bundle or in Node.
|
|
159
|
+
|
|
174
160
|
A class forces only the element that carries it, so a design tool sets it on a part's root and on its first
|
|
175
161
|
focusable child. The purge safelist keeps these three classes.
|
|
176
162
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"postcss";import
|
|
1
|
+
import{FORCED_STATE_CLASSES as e}from"../runtime.mjs";import t from"postcss";import n from"postcss-selector-parser";var r=new Map([[`:hover`,e.hover],[`:focus`,e.focus],[`:focus-visible`,e.focus],[`:focus-within`,e.focus],[`:active`,e.active]]),i=new Set(Object.values(e)),a=n();function o(e){for(let t=e.parent;t;t=t.parent)if(t.type===`atrule`&&/keyframes$/i.test(t.name))return!0;return!1}function s(e,t){let n=e.parent?.parent;return n?.type!==`pseudo`||n.value.toLowerCase()!==`:is`?!1:n.nodes.some(e=>e.nodes.some(e=>e.type===`class`&&e.value===t))}function c(e){for(let t=e.prev();t&&t.type!==`combinator`;t=t.prev())if(t.type===`pseudo`&&t.value.startsWith(`::`))return!0;return!1}function l(e){let t=[];e.walkPseudos(e=>{let n=r.get(e.value.toLowerCase());n&&!s(e,n)&&!c(e)&&t.push({pseudo:e,cls:n})});for(let{pseudo:e,cls:r}of t){let t=n.selector({value:``});t.append(e.clone());let i=n.selector({value:``});i.append(n.className({value:r}));let a=n.pseudo({value:`:is`});a.append(t),a.append(i),e.replaceWith(a)}return t.length}function u(e){let t=!1;return e.walkClasses(e=>{t||=i.has(e.value)}),t}function d(e){let t=0,n=0;return e.walkRules(e=>{if(o(e))return;let r=a.astSync(e.selector),i=!1;for(let e of r.nodes)l(e)>0&&(t++,i=!0),u(e)&&n++;i&&(e.selector=r.toString())}),{rewritten:t,carrying:n}}function f(e){let n=t.parse(e);return d(n),n.toString()}function p(){return{postcssPlugin:`wui-forced-states`,OnceExit(e){d(e)}}}p.postcss=!0;export{f as addForcedStates,p as forcedStatesPlugin,d as rewriteRoot};
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"dark": "#2a2f3a"
|
|
86
86
|
},
|
|
87
87
|
"chart-label": {
|
|
88
|
-
"light": "#
|
|
88
|
+
"light": "#626A82",
|
|
89
89
|
"dark": "#8a90a0"
|
|
90
90
|
},
|
|
91
91
|
"chart-neutral": {
|
|
@@ -169,8 +169,8 @@
|
|
|
169
169
|
"dark": "#4B5675"
|
|
170
170
|
},
|
|
171
171
|
"fg-4": {
|
|
172
|
-
"light": "#
|
|
173
|
-
"dark": "#
|
|
172
|
+
"light": "#626A82",
|
|
173
|
+
"dark": "#626A82"
|
|
174
174
|
},
|
|
175
175
|
"fg-5": {
|
|
176
176
|
"light": "#C4CADA",
|
|
@@ -361,8 +361,8 @@
|
|
|
361
361
|
"dark": "#4B5675"
|
|
362
362
|
},
|
|
363
363
|
"text-3": {
|
|
364
|
-
"light": "#
|
|
365
|
-
"dark": "#
|
|
364
|
+
"light": "#626A82",
|
|
365
|
+
"dark": "#626A82"
|
|
366
366
|
},
|
|
367
367
|
"text-4": {
|
|
368
368
|
"light": "#99A1B7",
|
package/dist/purge-safelist.json
CHANGED
package/dist/runtime.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.freeze({hover:`wui-force-hover`,focus:`wui-force-focus`,active:`wui-force-active`});export{e as FORCED_STATE_CLASSES};
|