ng-hub-ui-ds 22.4.3 → 22.5.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/CHANGELOG.md +63 -0
- package/README.es.md +48 -10
- package/README.md +48 -10
- package/docs/variables-css-library.en.md +852 -849
- package/package.json +16 -6
- package/styles/base/reset.css +149 -0
- package/styles/base/reset.scss +150 -0
- package/styles/index.scss +9 -2
- package/styles/mixins/_breakpoints.scss +38 -0
- package/styles/mixins/_helpers.scss +62 -0
- package/styles/mixins/_surfaces.scss +72 -0
- package/styles/mixins/_theme.scss +82 -0
- package/styles/mixins/_typography.scss +111 -0
- package/styles/tokens/hub-tokens.css +7 -3
- package/styles/tokens/hub-tokens.scss +42 -26
- package/styles/utilities/layout.css +2591 -39
- package/styles/utilities/layout.scss +518 -52
- package/styles/utilities/surfaces.css +383 -0
- package/styles/utilities/surfaces.scss +189 -0
- package/styles/utilities/text.css +411 -0
- package/styles/utilities/text.scss +208 -0
- package/styles/utilities/layout.hub.css +0 -490
- package/styles/utilities/layout.hub.scss +0 -252
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,69 @@ All notable changes to `ng-hub-ui-ds` are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [22.5.0] - 2026-07-04
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **One-call partial theming — `theme()` mixin** (`styles/mixins/_theme.scss`, forwarded by the root Sass entry): pass only the overrides as partial maps (`$accents`, `$space`, `$gap`, `$radius`, `$shadow`, `$font-family/-size/-weight`, `$line-height`, plus a raw `$tokens` escape hatch) and it emits the matching custom properties with the canonical names — everything derived (sys aliases, role families, utilities, components) re-derives at runtime through the var() chain. Scopeable to `:root`, a `[data-theme]` block or any subtree.
|
|
13
|
+
- **Radius tokens `xl` / `xxl`** (`--hub-ref-radius-xl: 1rem`, `--hub-ref-radius-xxl: 2rem` and their `--hub-sys-radius-*` aliases), completing Bootstrap's radius scale — `.rounded-4` / `.rounded-5` are now emitted by the surfaces sheet.
|
|
14
|
+
- **Breakpoints** (`styles/mixins/_breakpoints.scss`, forwarded by the root Sass entry): the Bootstrap-compatible `$hub-breakpoints` map (sm 576 · md 768 · lg 992 · xl 1200 · xxl 1400, retunable via `with (…)`) plus `media-breakpoint-up($name)` / `media-breakpoint-down($name)` mixins.
|
|
15
|
+
- **Responsive utility variants** (mobile-first, Bootstrap-exact names) generated for the highest-traffic groups: display (`.d-{bp}-*`), 12-column spans (`.col-{bp}-1…12`), spacing (`.p/.px/.py/.pt/.pb/.ps/.pe-{bp}-*`, `.m…-{bp}-*`, auto margins) and gap. Other groups get their responsive variant in consumer code with `media-breakpoint-up()`.
|
|
16
|
+
- **Focus ring**: `focus-ring()` helper mixin over the (previously unconsumed) `--hub-sys-focus-ring-width/color` tokens, plus the `.focus-ring` utility.
|
|
17
|
+
- **Background / text opacity hooks**: `bg()`, `text-bg()` and `text-color()` now emit their colour through the local custom properties `--hub-bg-opacity` / `--hub-text-opacity` (default 1, via `color-mix`), and the sheets add Bootstrap's `.bg-opacity-10/25/50/75/100` and `.text-opacity-25/50/75/100`.
|
|
18
|
+
- **Link utilities & mixin**: `link-color($variant)` (accent link with `-emphasis` hover) and the `.link-{variant}`, `.link-underline(-{variant})`, `.link-underline-opacity-0…100` (via `--hub-link-underline-opacity`), `.link-offset-1…3` and `.icon-link` classes.
|
|
19
|
+
- **`.bg-gradient`** and **print display utilities** (`.d-print-none/inline/inline-block/block/grid/table(-row/-cell)/flex/inline-flex`).
|
|
20
|
+
- **Surface mixins** (`styles/mixins/_surfaces.scss`, forwarded by the root Sass entry): `bg($variant, $subtle)` over the open accent map plus `body` / `transparent`, `text-bg($variant)` (accent background + guaranteed-contrast `-on` text), `border($width, $color)`, `border-color($variant)`, `radius($size)` (none | sm | md | lg | pill | circle) and `shadow($size)` (none | sm | md | lg | inset).
|
|
21
|
+
- **Helper mixins** (`styles/mixins/_helpers.scss`, forwarded by the root Sass entry): `visually-hidden()`, `stretched-link()`, `ratio($x, $y)` (native `aspect-ratio`) and `clearfix()`.
|
|
22
|
+
- **Surface utility sheet** (`styles/utilities/surfaces.scss` / `.css`, exported as `./styles/utilities/surfaces`): Bootstrap-exact helpers built on the surface mixins — backgrounds (`.bg-primary` … `.bg-dark`, `.bg-*-subtle`, `.bg-body`, `.bg-transparent`, `.bg-white/black`), `.text-bg-*`, borders (`.border`, per-side add/remove, `.border-{variant}` colours, `.border-1…5` widths), radii (`.rounded`, `.rounded-0…3`, `.rounded-circle`, `.rounded-pill`, per-side variants), shadows (`.shadow-sm/.shadow/.shadow-lg/.shadow-none`) and `.opacity-0/25/50/75/100`. `.rounded-4` / `.rounded-5` are not emitted — the ds radius scale has no xl/xxl tokens yet.
|
|
23
|
+
- **Layout sheet expansion** (`styles/utilities/layout.scss`), all Bootstrap-exact: per-side spacing (`.pt/.pb/.ps/.pe-*`, `.mt/.mb/.ms/.me-*` on the 0–5 scale, logical properties), auto margins (`.m-auto`, `.mx-auto`, `.ms-auto` …), `.row-gap-*` / `.column-gap-*`, table display helpers (`.d-table(-row/-cell)`), position (`.position-*`, `.top/bottom/start/end-0/50/100`, `.translate-middle(-x/-y)`, `.fixed-top/bottom`, `.sticky-top/bottom`), overflow (`.overflow-*` plus `-x`/`-y` axes), `.order-first/0…5/last`, `.align-content-*`, float (`.float-start/end/none`, `.clearfix`), `.visible`/`.invisible`, `.z-n1/0…3`, `.object-fit-*`, vertical alignment (`.align-baseline/top/middle/bottom/text-top/text-bottom`), interactions (`.user-select-*`, `.pe-none/.pe-auto`) and the behaviour helpers (`.visually-hidden`, `.visually-hidden-focusable`, `.stretched-link`, `.ratio` + `.ratio-1x1/4x3/16x9/21x9`).
|
|
24
|
+
- **Typography mixins** (`styles/mixins/_typography.scss`, forwarded by the root Sass entry): `text-truncate()`, `text-break()`, `font-family($family)`, `font-size($size)` — Bootstrap's heading scale 1–6 derived from the base token, or the xs/sm/base/lg steps —, `font-weight($weight)`, `line-height($height)` and `text-color($variant)` over the open accent map plus the `body` / `muted` document roles.
|
|
25
|
+
- **Text utility sheet** (`styles/utilities/text.scss` / `.css`, exported as `./styles/utilities/text`): Bootstrap-exact helpers built on the typography mixins — alignment (`.text-start/center/end`), wrapping (`.text-wrap/nowrap`, `.text-break`, `.text-truncate`), transform (`.text-lowercase/uppercase/capitalize`), decoration (`.text-decoration-none/underline/line-through`), weight & style (`.fw-lighter/light/normal/medium/semibold/bold/bolder`, `.fst-italic/normal`), size (`.fs-1…6`), line-height (`.lh-1/sm/base/lg`), `.font-monospace`, and semantic text colours (`.text-primary` … `.text-dark`, `.text-body`, `.text-muted`, `.text-white`, `.text-black`, `.text-reset`).
|
|
26
|
+
- **Native-element reset** (`styles/base/reset.scss` / `.css`, exported as `./styles/base/reset`): an opt-in, token-driven reboot of the browser defaults — `box-sizing: border-box`, body typography/surface from `--hub-ref-*` / `--hub-sys-*`, heading/paragraph/list margins on the spacing scale, link colors from `--hub-sys-link-*`, monospace for `code`/`pre`, form controls inheriting the document font, and sensible `hr`/`table`/`fieldset` normalization. Load it only when the host app does not already ship a reset (e.g. Bootstrap's Reboot).
|
|
27
|
+
|
|
28
|
+
### Removed
|
|
29
|
+
|
|
30
|
+
- **BREAKING**: the `hub-`-prefixed utility sheet (`styles/utilities/layout.hub.scss` / `.css`) and its `./styles/utilities/layout.hub` package exports. The ds now ships a single, unprefixed utility sheet: `styles/utilities/layout`, whose helper names mirror Bootstrap's exactly. Migration: update imports from `ng-hub-ui-ds/styles/utilities/layout.hub` to `ng-hub-ui-ds/styles/utilities/layout` and rename classes — `.hub-stack` → `.stack`, `.hub-d-flex` → `.d-flex`, `.hub-gap-3` → `.gap-3`, `.hub-row`/`.hub-col-6` → `.row`/`.col-6`, `.hub-w-50` → `.w-50`, `.hub-justify-*` → `.justify-content-*`, `.hub-items-*` → `.align-items-*`, `.hub-self-*` → `.align-self-*`, and `.hub-grid` → `.grid-auto`. Do not load the sheet AND Bootstrap globally in the same document (the names now overlap by design; the spacing scale already matched Bootstrap's).
|
|
31
|
+
- **BREAKING**: the Tailwind-style flex aliases `.flex-1`, `.flex-auto`, `.flex-initial` and `.flex-none` — helper classes mirror Bootstrap exactly, which has no such utilities. Use `.flex-fill` / `.flex-grow-*` / `.flex-shrink-*` instead.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- **Size scales are now generated from public Sass maps** — `$hub-space-scale`, `$hub-radius-scale` and `$hub-gap-steps` (`!default`, retunable via `with (…)`) are the single source for the `--hub-ref-space-*` / `--hub-ref-radius-*` blocks and their `sys` aliases, mirroring the `$hub-accents` pattern. Emitted CSS is unchanged except `--hub-sys-radius-pill`'s dead-code fallback, normalized from `9999px` to the ref value `50rem`.
|
|
36
|
+
- The layout primitives of the utility sheet (`.stack`, `.cluster`, `.grid-auto`, `.row`, `.col-*`, `.center`) are now emitted from the canonical layout mixins instead of duplicating their CSS — no behaviour change; the mixins remain the single source of truth.
|
|
37
|
+
- **BREAKING**: the flexbox alignment utilities of the unprefixed sheet now use Bootstrap's exact names — `.justify-start|end|center|between|around|evenly` → `.justify-content-*`, `.items-start|end|center|baseline|stretch` → `.align-items-*`, `.self-auto|start|end|center|baseline|stretch` → `.align-self-*`.
|
|
38
|
+
|
|
39
|
+
## [22.4.5] - 2026-07-02
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- Token-spec MD: new `INTERNAL` status in the Components legend for variables the component writes at runtime (from inputs/config/state) — inventoried so every variable in code has a row, but explicitly not themable hooks.
|
|
44
|
+
- Token-spec MD: documented 35 previously missing component variables — the `--hub-dropdown-header-*` / `--hub-dropdown-divider-color` hooks (buttons), the `--hub-nav-mobile-*` drawer hooks, the `--hub-milestone-pulse-*` / `--hub-milestone-reveal-*` animation hooks, `--hub-stepper-nav-title-max-width`, and the `INTERNAL` runtime variables of badges (`--hub-badge-group-*`), nav (`--hub-nav-sticky-top`), skeleton (`--hub-skeleton-node-*`), milestones (`--hub-milestone-index`), panels (`--hub-panels-multiple-vertical-panel-min-width`) and forms slider (`--hub-slider-from/-to/-percent`).
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- Token-spec MD: the formal component-token regex required three name segments (`{2,}`), invalidating the dominant `--hub-{component}-{property}` pattern (89 legitimate tokens like `--hub-badge-bg`); relaxed to `{1,}`.
|
|
49
|
+
- Token-spec MD: the "Tokenization coverage" appendix was a stale snapshot (e.g. `paginable` listed at 22.4% — it is now 84.8%); regenerated with current per-library numbers, dated methodology notes and updated priorities (`buttons` is now the lowest at 70.6%).
|
|
50
|
+
- Token-spec MD: the "Standalone neutral colors" table wrongly claimed `secondary` / `light` / `dark` derive no role family — they are `$hub-accents` variants and derive the full family like every other variant. Split into "Neutral variant accents" (with `neutral` added) and "Standalone brand aliases" (`--hub-sys-color-brand-default` / `-on-default`, the only true base-only tokens).
|
|
51
|
+
- Token-spec MD: the "Directional spacing rule" now records the grandfathered logical-suffix exceptions (modal margin cascade, `--hub-nav-mobile-*-padding-inline`, `--hub-table-batch-actions-margin-inline-end`) and clarifies that single-value spacing tokens may keep the bare `-padding` suffix.
|
|
52
|
+
- Token-spec MD: 213 "Initial value" cells re-synchronized from the actual code declarations (new value-parity guard below) — including the canonical accent-slot derivations (oklch, 12% subtle / 80% emphasis) that panels, toast and nav now share, and the new `--hub-speed-dial-label-bg` / `--hub-speed-dial-label-color` tokens from buttons 22.7.0.
|
|
53
|
+
- `tokens-parity.mjs` guard extended: library scan now covers `.ts` / `.html` (inline component styles count as public API), consumed-only hooks (`var(--hub-x, fallback)` without a declaration) must now have an MD row, and `INTERNAL` rows are checked for existence in code like `IN_USE` ones. A new **value-parity check (D)** compares every component row's "Initial value" cell against the token's declaration in the file named by its Source column (tolerant normalization; `url(data:)` icons and Sass-interpolated values exempt), and `--write` rewrites drifted cells from code.
|
|
54
|
+
|
|
55
|
+
- Token-spec MD: `--hub-table-filter-count-bg` / `--hub-table-filter-count-color` were still marked `PENDING` but have shipped in paginable — promoted to `IN_USE` (a new parity sub-check now flags any PENDING/PROPOSAL row whose token is declared in code).
|
|
56
|
+
|
|
57
|
+
- Token-spec MD: adversarial re-audit fixes — 27 `Source` cells pointed at ghost files (24 legacy `accordion/*` rows → retargeted to the panels bridge `panels.variables.scss`; 3 `form/*` → the real forms fieldset component) and 60% of `Source` line numbers had drifted (675 cells renumbered); `url(data:)` icon values are no longer exempt from value parity (3 had drifted — `--hub-check-input-checked-icon` documented a different glyph entirely) and the descriptive icon placeholders were replaced by the real data URIs; the Figma-mapping sections now use real tokens as examples; `--hub-avatar-size` reclassified `IN_USE` → `INTERNAL` (written from the `size` input; a CSS override is overruled by the inline host style); the three `--hub-form-fieldset-border-*` values re-synced to the fallbacks the fieldset actually consumes.
|
|
58
|
+
- `tokens-parity.mjs`: two more guards — **check E** validates every `Source` cell (file exists, contains the token, right line; `--write` retargets/renumbers) and **check F** keeps each library's `docs/css-variables-reference.md` "Default" cells in sync with the code declarations (254 cells resynchronized on first run).
|
|
59
|
+
|
|
60
|
+
### Removed
|
|
61
|
+
|
|
62
|
+
- Token-spec MD: the superseded `tabs` proposal section (23 `--hub-tabs-tab-*` PENDING rows) — the tabs UI shipped in `ng-hub-ui-panels` as `--hub-panels-tab-*`; a tombstone note now points there.
|
|
63
|
+
- Token-spec MD: 49 superseded PENDING rows in the `select` section — the `--hub-select-btn-*` block shipped as the `--hub-select-button-*` tokens, and the `--hub-select-checkbox-input-*` / `--hub-select-radio-input-*` proposals were dropped in favour of the `check` component tokens the implemented select actually uses.
|
|
64
|
+
|
|
65
|
+
## [22.4.4] - 2026-07-01
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
|
|
69
|
+
- Token-spec MD: documented the `<hub-input>` affix and clear-button tokens added in `ng-hub-ui-forms` 22.3.0 — `--hub-input-icon-color` / `--hub-input-icon-size`, `--hub-input-affix-inset` / `--hub-input-affix-gap`, and `--hub-input-clear-icon` / `--hub-input-clear-size` / `--hub-input-clear-color` / `--hub-input-clear-hover-color`. Docs only — no change to the emitted tokens.
|
|
70
|
+
|
|
8
71
|
## [22.4.3] - 2026-07-01
|
|
9
72
|
|
|
10
73
|
### Changed
|
package/README.es.md
CHANGED
|
@@ -58,13 +58,14 @@ Este paquete es la base de design tokens de la que lee el resto del ecosistema
|
|
|
58
58
|
4. [🧱 Arquitectura: las capas](#-arquitectura-las-capas)
|
|
59
59
|
5. [🎨 Los colores semánticos](#-los-colores-semánticos)
|
|
60
60
|
6. [🌗 Temas](#-temas)
|
|
61
|
-
7. [
|
|
62
|
-
8. [
|
|
63
|
-
9. [
|
|
64
|
-
10. [
|
|
65
|
-
11. [
|
|
66
|
-
12. [
|
|
67
|
-
13. [
|
|
61
|
+
7. [🧰 Utilidades y mixins opt-in](#-utilidades-y-mixins-opt-in)
|
|
62
|
+
8. [🛠️ Cómo modificarlo](#️-cómo-modificarlo)
|
|
63
|
+
9. [🧩 Funciones SCSS (cómo se genera por dentro)](#-funciones-scss-cómo-se-genera-por-dentro)
|
|
64
|
+
10. [📋 Tabla de referencia rápida](#-tabla-de-referencia-rápida)
|
|
65
|
+
11. [📊 Changelog](#-changelog)
|
|
66
|
+
12. [🤝 Contribución](#-contribución)
|
|
67
|
+
13. [☕ Apoyo](#-apoyo)
|
|
68
|
+
14. [📄 Licencia](#-licencia)
|
|
68
69
|
|
|
69
70
|
---
|
|
70
71
|
|
|
@@ -216,6 +217,43 @@ Como cada tema **redefine los mismos tokens** con sus valores, todo lo que lee
|
|
|
216
217
|
|
|
217
218
|
---
|
|
218
219
|
|
|
220
|
+
## 🧰 Utilidades y mixins opt-in
|
|
221
|
+
|
|
222
|
+
Además de los tokens, el paquete incluye una capa de estilos opt-in — no se emite nada salvo que la importes.
|
|
223
|
+
|
|
224
|
+
**Hojas de utilidades** — los nombres de clase son **exactamente los de Bootstrap** y cada valor resuelve a los tokens canónicos. No cargues estas hojas Y Bootstrap globalmente en el mismo documento. Cada hoja tiene además su gemela `.css` compilada para apps sin Sass:
|
|
225
|
+
|
|
226
|
+
```scss
|
|
227
|
+
@use 'ng-hub-ui-ds/styles/utilities/layout'; // display/flex, grid de 12 col, spacing, sizing, position, overflow, order, .ratio-*, .visually-hidden…
|
|
228
|
+
@use 'ng-hub-ui-ds/styles/utilities/text'; // .fs-1…6, .fw-*, .lh-*, .text-truncate, colores de texto semánticos
|
|
229
|
+
@use 'ng-hub-ui-ds/styles/utilities/surfaces'; // .bg-* (+ -subtle), .text-bg-*, .border*, .rounded*, .shadow*, .opacity-*
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Los únicos nombres fuera de Bootstrap son los primitivos de layout que reflejan los mixins: `.stack`, `.cluster`, `.grid-auto`, `.center`.
|
|
233
|
+
|
|
234
|
+
**Reset de elementos nativos** — una normalización estilo reboot, dirigida por tokens, para apps que no traigan ya un reset (p. ej. el Reboot de Bootstrap):
|
|
235
|
+
|
|
236
|
+
```scss
|
|
237
|
+
@use 'ng-hub-ui-ds/styles/base/reset';
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Mixins Sass** — las utilidades son wrappers finos sobre ellos; úsalos para acuñar tus propias variantes con los mismos primitivos:
|
|
241
|
+
|
|
242
|
+
```scss
|
|
243
|
+
@use 'ng-hub-ui-ds' as hub;
|
|
244
|
+
|
|
245
|
+
.toolbar { @include hub.cluster($gap: 2); }
|
|
246
|
+
.card__title { @include hub.font-size(4); @include hub.font-weight(semibold); }
|
|
247
|
+
.card--brand { @include hub.text-bg(brand); @include hub.radius(lg); @include hub.shadow(sm); }
|
|
248
|
+
.sr-label { @include hub.visually-hidden(); }
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Grupos: **tema** (`theme()` — tematización parcial en una llamada: pásale solo las escalas/acentos cambiados como mapas), **breakpoints** (`media-breakpoint-up/down` sobre el mapa `$hub-breakpoints` — de él se generan las variantes responsive `.d-md-*`, `.col-lg-*`, `.p-sm-*`…), **layout** (`stack`, `cluster`, `grid`, `grid-fixed`, `row`, `col`, `center`), **tipografía** (`font-family`, `font-size`, `font-weight`, `line-height`, `text-color`, `link-color`, `text-truncate`, `text-break`), **superficies** (`bg`, `text-bg`, `border`, `border-color`, `radius`, `shadow`), **helpers** (`focus-ring`, `visually-hidden`, `stretched-link`, `ratio`, `clearfix`) y los **puentes** (`bridge-bootstrap` / `bridge-material` / `bridge-tailwind` / `bridge-open-props`).
|
|
252
|
+
|
|
253
|
+
El catálogo completo con demos en vivo está documentado en [hubui.dev/design-system](https://hubui.dev/design-system).
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
219
257
|
## 🛠️ Cómo modificarlo
|
|
220
258
|
|
|
221
259
|
Hay tres mecanismos, de más simple a más avanzado.
|
|
@@ -300,9 +338,9 @@ $hub-accents-light: (
|
|
|
300
338
|
// vez en :root; los temas solo cambian las entradas y la familia se recalcula.
|
|
301
339
|
@mixin hub-color-derive() {
|
|
302
340
|
@each $name in $hub-variants {
|
|
303
|
-
--hub-sys-color-#{$name}-subtle: color-mix(in
|
|
304
|
-
--hub-sys-color-#{$name}-border-subtle: color-mix(in
|
|
305
|
-
--hub-sys-color-#{$name}-emphasis: color-mix(in
|
|
341
|
+
--hub-sys-color-#{$name}-subtle: color-mix(in oklch, var(--hub-sys-color-#{$name}) 12%, var(--hub-sys-surface-page, #fff));
|
|
342
|
+
--hub-sys-color-#{$name}-border-subtle: color-mix(in oklch, var(--hub-sys-color-#{$name}) 35%, var(--hub-sys-surface-page, #fff));
|
|
343
|
+
--hub-sys-color-#{$name}-emphasis: color-mix(in oklch, var(--hub-sys-color-#{$name}) 80%, var(--hub-sys-color-ink, #212529));
|
|
306
344
|
--hub-sys-color-#{$name}-dark: var(--hub-sys-color-#{$name}-emphasis); // alias retrocompatible
|
|
307
345
|
}
|
|
308
346
|
}
|
package/README.md
CHANGED
|
@@ -58,13 +58,14 @@ ecosystem reads from:
|
|
|
58
58
|
4. [🧱 Architecture: the layers](#-architecture-the-layers)
|
|
59
59
|
5. [🎨 Semantic colours](#-semantic-colours)
|
|
60
60
|
6. [🌗 Themes](#-themes)
|
|
61
|
-
7. [
|
|
62
|
-
8. [
|
|
63
|
-
9. [
|
|
64
|
-
10. [
|
|
65
|
-
11. [
|
|
66
|
-
12. [
|
|
67
|
-
13. [
|
|
61
|
+
7. [🧰 Opt-in utilities & mixins](#-opt-in-utilities--mixins)
|
|
62
|
+
8. [🛠️ How to customise it](#️-how-to-customise-it)
|
|
63
|
+
9. [🧩 SCSS functions (how it is generated internally)](#-scss-functions-how-it-is-generated-internally)
|
|
64
|
+
10. [📋 Quick reference table](#-quick-reference-table)
|
|
65
|
+
11. [📊 Changelog](#-changelog)
|
|
66
|
+
12. [🤝 Contribution](#-contribution)
|
|
67
|
+
13. [☕ Support](#-support)
|
|
68
|
+
14. [📄 License](#-license)
|
|
68
69
|
|
|
69
70
|
---
|
|
70
71
|
|
|
@@ -218,6 +219,43 @@ own CSS.
|
|
|
218
219
|
|
|
219
220
|
---
|
|
220
221
|
|
|
222
|
+
## 🧰 Opt-in utilities & mixins
|
|
223
|
+
|
|
224
|
+
Besides the tokens, the package ships an opt-in styling layer — nothing is emitted unless you import it.
|
|
225
|
+
|
|
226
|
+
**Utility sheets** — class names mirror Bootstrap's **exactly** and every value resolves to the canonical tokens. Do not load them AND Bootstrap globally in the same document. Each sheet also has a compiled `.css` twin for Sass-less apps:
|
|
227
|
+
|
|
228
|
+
```scss
|
|
229
|
+
@use 'ng-hub-ui-ds/styles/utilities/layout'; // display/flex, 12-col grid, spacing, sizing, position, overflow, order, .ratio-*, .visually-hidden…
|
|
230
|
+
@use 'ng-hub-ui-ds/styles/utilities/text'; // .fs-1…6, .fw-*, .lh-*, .text-truncate, semantic text colours
|
|
231
|
+
@use 'ng-hub-ui-ds/styles/utilities/surfaces'; // .bg-* (+ -subtle), .text-bg-*, .border*, .rounded*, .shadow*, .opacity-*
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
The only non-Bootstrap names are the layout primitives that mirror the mixins: `.stack`, `.cluster`, `.grid-auto`, `.center`.
|
|
235
|
+
|
|
236
|
+
**Native-element reset** — a reboot-style, token-driven normalisation for apps that do not already ship one (e.g. Bootstrap's Reboot):
|
|
237
|
+
|
|
238
|
+
```scss
|
|
239
|
+
@use 'ng-hub-ui-ds/styles/base/reset';
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Sass mixins** — the utilities are thin wrappers over these; use them to mint your own variants with the same primitives:
|
|
243
|
+
|
|
244
|
+
```scss
|
|
245
|
+
@use 'ng-hub-ui-ds' as hub;
|
|
246
|
+
|
|
247
|
+
.toolbar { @include hub.cluster($gap: 2); }
|
|
248
|
+
.card__title { @include hub.font-size(4); @include hub.font-weight(semibold); }
|
|
249
|
+
.card--brand { @include hub.text-bg(brand); @include hub.radius(lg); @include hub.shadow(sm); }
|
|
250
|
+
.sr-label { @include hub.visually-hidden(); }
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Groups: **theme** (`theme()` — partial theming in one call: pass only the changed scales/accents as maps), **breakpoints** (`media-breakpoint-up/down` over the `$hub-breakpoints` map — the responsive variants `.d-md-*`, `.col-lg-*`, `.p-sm-*`… are generated from it), **layout** (`stack`, `cluster`, `grid`, `grid-fixed`, `row`, `col`, `center`), **typography** (`font-family`, `font-size`, `font-weight`, `line-height`, `text-color`, `link-color`, `text-truncate`, `text-break`), **surfaces** (`bg`, `text-bg`, `border`, `border-color`, `radius`, `shadow`), **helpers** (`focus-ring`, `visually-hidden`, `stretched-link`, `ratio`, `clearfix`) and the **bridges** (`bridge-bootstrap` / `bridge-material` / `bridge-tailwind` / `bridge-open-props`).
|
|
254
|
+
|
|
255
|
+
The full catalogue with live demos is documented at [hubui.dev/design-system](https://hubui.dev/design-system).
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
221
259
|
## 🛠️ How to customise it
|
|
222
260
|
|
|
223
261
|
There are three mechanisms, from simplest to most advanced.
|
|
@@ -302,9 +340,9 @@ $hub-accents-light: (
|
|
|
302
340
|
// :root; themes only override the inputs, so the family recomputes contextually.
|
|
303
341
|
@mixin hub-color-derive() {
|
|
304
342
|
@each $name in $hub-variants {
|
|
305
|
-
--hub-sys-color-#{$name}-subtle: color-mix(in
|
|
306
|
-
--hub-sys-color-#{$name}-border-subtle: color-mix(in
|
|
307
|
-
--hub-sys-color-#{$name}-emphasis: color-mix(in
|
|
343
|
+
--hub-sys-color-#{$name}-subtle: color-mix(in oklch, var(--hub-sys-color-#{$name}) 12%, var(--hub-sys-surface-page, #fff));
|
|
344
|
+
--hub-sys-color-#{$name}-border-subtle: color-mix(in oklch, var(--hub-sys-color-#{$name}) 35%, var(--hub-sys-surface-page, #fff));
|
|
345
|
+
--hub-sys-color-#{$name}-emphasis: color-mix(in oklch, var(--hub-sys-color-#{$name}) 80%, var(--hub-sys-color-ink, #212529));
|
|
308
346
|
--hub-sys-color-#{$name}-dark: var(--hub-sys-color-#{$name}-emphasis); // back-compat alias
|
|
309
347
|
}
|
|
310
348
|
}
|