@digigov/css 2.0.13 → 2.0.14-platform-201.01-04-26-11-49
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 +73 -4
- package/dist/digigov-base.css +1 -0
- package/dist/digigov-plain.css +1 -0
- package/dist/digigov.css +1 -9
- package/package.json +14 -47
- package/src/base/index.css +0 -2
- package/src/components/accordion.common.css +0 -1
- package/src/components/blockquote.common.css +0 -1
- package/src/components/button.common.css +0 -1
- package/src/components/card.common.css +0 -1
- package/src/components/checkboxes.common.css +0 -1
- package/src/components/chip.common.css +0 -1
- package/src/components/components.css +0 -1
- package/src/components/details.common.css +0 -1
- package/src/components/dropdown.common.css +0 -1
- package/src/components/form.common.css +0 -1
- package/src/components/header.common.css +0 -1
- package/src/components/layout.common.css +0 -1
- package/src/components/loader.common.css +0 -1
- package/src/components/modal.common.css +0 -1
- package/src/components/nav.common.css +0 -1
- package/src/components/notification-banner.common.css +0 -1
- package/src/components/panel.common.css +0 -1
- package/src/components/phase-banner.common.css +0 -1
- package/src/components/radios.common.css +0 -1
- package/src/components/skeleton.common.css +0 -1
- package/src/components/stack.common.css +0 -1
- package/src/components/summary-list.common.css +0 -1
- package/src/components/svg-icons.common.css +0 -1
- package/src/components/typography.common.css +0 -1
- package/src/components/warning-text.common.css +0 -1
- package/src/index.css +6 -3
- package/tailwind.config.js +1 -1
- package/dist/base/index.css +0 -7
- package/dist/base.js +0 -1
- package/dist/components.js +0 -1
- package/dist/utilities/index.css +0 -1
- package/dist/utilities.js +0 -1
- package/index.js +0 -127
- package/postcss.config.js +0 -20
- package/src/base/postcss.config.js +0 -33
- package/src/base/tailwind.config.js +0 -14
- package/src/components/postcss.config.js +0 -20
- package/src/components/tailwind.config.js +0 -16
- package/src/pages/_app.js +0 -5
- package/src/pages/headings/service-heading.js +0 -20
- package/src/pages/index.js +0 -417
- package/src/utilities/postcss.config.js +0 -20
- package/src/utilities/tailwind.config.js +0 -10
- package/theming.js +0 -121
package/README.md
CHANGED
|
@@ -1,7 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @digigov/css
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CSS component library for the Digigov design system. Ships pre-built CSS files that include base styles, component classes (`.ds-*`), and layout utilities — all built on Tailwind CSS and themed via CSS custom properties.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
npm install @digigov/css
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Without Tailwind CSS
|
|
14
|
+
|
|
15
|
+
Import the pre-built CSS bundle. No build tooling required — all Tailwind directives are already compiled.
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import '@digigov/css'; // dist/digigov.css — includes theme-default + theme-govgr
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or pick a variant:
|
|
22
|
+
|
|
23
|
+
| Dist file | Contents |
|
|
24
|
+
| ------------------------ | ----------------------------------------------------------- |
|
|
25
|
+
| `dist/digigov.css` | theme-default + theme-govgr + base + components + utilities |
|
|
26
|
+
| `dist/digigov-plain.css` | theme-default + base + components + utilities |
|
|
27
|
+
| `dist/digigov-base.css` | base + components + utilities (no theme) |
|
|
28
|
+
|
|
29
|
+
### With Tailwind CSS
|
|
30
|
+
|
|
31
|
+
If your app uses Tailwind and you want to write utility classes like `bg-primary`, `text-error/50`, or `md:flex` using the design system tokens, use the exported Tailwind config as a preset:
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
// tailwind.config.js
|
|
35
|
+
module.exports = {
|
|
36
|
+
presets: [require('@digigov/css/tailwind.config.js')],
|
|
37
|
+
content: ['./src/**/*.{js,ts,jsx,tsx}'],
|
|
38
|
+
};
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then import the dist CSS alongside your own Tailwind entry:
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import '@digigov/css'; // design system components + theme
|
|
45
|
+
import './main.css'; // your Tailwind entry point
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```css
|
|
49
|
+
/* main.css */
|
|
50
|
+
@tailwind base;
|
|
51
|
+
@tailwind components;
|
|
52
|
+
@tailwind utilities;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The preset gives your Tailwind build access to all design system colors, breakpoints, fonts, and extended theme values. Your utility classes will resolve to the same CSS custom properties that the design system components use.
|
|
56
|
+
|
|
57
|
+
## Dist contents
|
|
58
|
+
|
|
59
|
+
The pre-built CSS includes:
|
|
60
|
+
|
|
61
|
+
- **Base styles** — Global defaults (`body`, `html`) using design system tokens
|
|
62
|
+
- **Components** — All `.ds-*` component classes (buttons, forms, cards, accordions, navigation, etc.)
|
|
63
|
+
- **Utilities** — Layout helpers (`.ds-grid`, `.ds-gap-*`, `.ds-m-*`, `.ds-p-*`, `.ds-print-*`)
|
|
64
|
+
|
|
65
|
+
## Theming
|
|
66
|
+
|
|
67
|
+
Themes provide CSS custom properties (e.g. `--color-primary-rgb`) that the component styles reference. Two themes are available:
|
|
68
|
+
|
|
69
|
+
- **theme-default** — included in `digigov.css` and `digigov-plain.css`
|
|
70
|
+
- **theme-govgr** — included in `digigov.css`
|
|
71
|
+
|
|
72
|
+
Use `digigov-plain.css` if you only need the default theme, or `digigov-base.css` if you want to provide your own theme variables.
|
|
73
|
+
|
|
74
|
+
### Dark mode
|
|
75
|
+
|
|
76
|
+
Dark mode uses the `class` strategy. Add the `dark` class to an ancestor element to activate dark theme overrides.
|