@jdpo2008/ngx-ds 0.5.0 → 0.6.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 CHANGED
@@ -128,9 +128,25 @@ bootstrapApplication(AppComponent, {
128
128
  | `locale` | `'es-ES'` | Month and weekday names, date and number formatting. An `en-*` locale also switches the labels to English. |
129
129
  | `labels` | — | Overrides individual labels. Missing keys come from the locale's set. |
130
130
  | `theme` | — | `'light'`, `'dark'` or `'system'` (follows `prefers-color-scheme` and updates live). Sets `data-theme` on `<html>`. Omit it to manage the theme yourself. |
131
+ | `colors` | — | `{ primary: '#0d9488' }` replaces the default indigo. See [Brand colour](#brand-colour). |
131
132
 
132
133
  `provideNgxDsLocale()` and `provideNgxDsLabels()` still work for setting one thing at a time.
133
134
 
135
+ ### Brand colour
136
+
137
+ `colors.primary` takes a `#rgb` or `#rrggbb` colour. It becomes `--primary-600` (buttons, focus rings, selected states) and the rest of the `--primary-*` scale is generated from it in OKLCH, for the light and the dark theme. Pick a colour dark enough for white text: in dev mode, ngx-ds warns when the contrast is below 4.5:1.
138
+
139
+ To change it at runtime, for example per tenant:
140
+
141
+ ```ts
142
+ import { applyPrimaryColor } from '@jdpo2008/ngx-ds';
143
+
144
+ applyPrimaryColor('#e11d48'); // switch
145
+ applyPrimaryColor(null); // back to indigo
146
+ ```
147
+
148
+ `createPrimaryPalette(color)` returns the generated scale if you need the values elsewhere.
149
+
134
150
  ## Components
135
151
 
136
152
  - **Atoms:** Avatar, Badge, Button, Divider, Icon, IconButton, Kbd, MenuButton, ProgressBar, Skeleton, Spinner, Tag, Tooltip.