apexgantt 3.17.2 → 3.18.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 +53 -0
- package/apexgantt.es.min.js +1 -1
- package/apexgantt.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1419,3 +1419,56 @@ function GanttChart({tasks}) {
|
|
|
1419
1419
|
return <div ref={containerRef} />;
|
|
1420
1420
|
}
|
|
1421
1421
|
```
|
|
1422
|
+
|
|
1423
|
+
## Family theme tokens (`--apx-*`)
|
|
1424
|
+
|
|
1425
|
+
Every chart in the ApexCharts family reads the same five root tokens, so a page can state its brand once and have trees, flow diagrams, Gantt charts and plots all follow:
|
|
1426
|
+
|
|
1427
|
+
| Token | Role |
|
|
1428
|
+
| ----------------------------------- | ---------------------------------------------------------------- |
|
|
1429
|
+
| `--apx-accent` | The colour that means interactive or selected |
|
|
1430
|
+
| `--apx-fore` | Text and anything that must stay legible on the surface |
|
|
1431
|
+
| `--apx-grid` | Hairlines: borders, gridlines, connectors |
|
|
1432
|
+
| `--apx-surface` | The plane content sits on |
|
|
1433
|
+
| `--apx-series-1` … `--apx-series-N` | An ordered categorical palette (1-based, stops at the first gap) |
|
|
1434
|
+
|
|
1435
|
+
```css
|
|
1436
|
+
:root {
|
|
1437
|
+
--apx-accent: #5b21b6;
|
|
1438
|
+
--apx-fore: #101828;
|
|
1439
|
+
--apx-grid: #e4e7ec;
|
|
1440
|
+
--apx-surface: #ffffff;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
@media (prefers-color-scheme: dark) {
|
|
1444
|
+
:root {
|
|
1445
|
+
--apx-fore: #f8fafc;
|
|
1446
|
+
--apx-grid: #334155;
|
|
1447
|
+
--apx-surface: #0f172a;
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
```
|
|
1451
|
+
|
|
1452
|
+
Custom properties inherit, so declaring them on `:root` reaches every chart on the page. They resolve **below anything you configured explicitly**, so adopting them cannot change a chart that was already themed:
|
|
1453
|
+
|
|
1454
|
+
```
|
|
1455
|
+
product CSS variable > explicit option > --apx-* token > built-in default
|
|
1456
|
+
```
|
|
1457
|
+
|
|
1458
|
+
An option set to a value equal to its built-in default is indistinguishable from one left alone, and the token wins there. Set a product variable if you need a value pinned regardless.
|
|
1459
|
+
|
|
1460
|
+
### Named themes
|
|
1461
|
+
|
|
1462
|
+
`registerTheme` from `@apex/commons` records a named set of tokens on a registry shared by the whole family, so a brand theme registered once from any product is resolvable by name from all of them:
|
|
1463
|
+
|
|
1464
|
+
```js
|
|
1465
|
+
import {registerTheme} from '@apex/commons';
|
|
1466
|
+
|
|
1467
|
+
registerTheme('acme', {
|
|
1468
|
+
tokens: {accent: '#5b21b6', fore: '#101828', grid: '#e4e7ec', surface: '#ffffff'},
|
|
1469
|
+
});
|
|
1470
|
+
```
|
|
1471
|
+
|
|
1472
|
+
A named theme's tokens sit one layer below the CSS `--apx-*` tokens, so the cascade still wins over the registry.
|
|
1473
|
+
|
|
1474
|
+
Gantt reads the CSS `--apx-*` tokens directly. It has no theme-name option, so the named-theme layer does not apply to it; use the CSS tokens (or a `prefers-color-scheme` block over them) to theme it alongside the rest of the family.
|