@midas-ds/theme 2.0.1 → 3.0.1-local.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 +36 -0
- package/README.md +58 -0
- package/color-scheme.css +1 -0
- package/fonts.css +1 -0
- package/index.mjs +762 -474
- package/lib/index.d.ts +1 -0
- package/lib/style-dictionary-dist/token-dictionary.d.ts +18 -0
- package/lib/style-dictionary-dist/variables.d.ts +18 -0
- package/package.json +17 -2
- package/variables.css +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# 3.0.0 (2025-09-23)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **theme:** update signal colors ([#194](https://github.com/migrationsverket/midas/issues/194))
|
|
6
|
+
- ⚠️ **components-theme:** add new default css export ([60df9c5b0c](https://github.com/migrationsverket/midas/commit/60df9c5b0c))
|
|
7
|
+
|
|
8
|
+
### 🏭 Refactoring
|
|
9
|
+
|
|
10
|
+
- **theme:** refactor style dictionary build script to nx executor ([08676187cf](https://github.com/migrationsverket/midas/commit/08676187cf))
|
|
11
|
+
- remove theme from components project completely, rely on theme package ([5616f8ecc2](https://github.com/migrationsverket/midas/commit/5616f8ecc2))
|
|
12
|
+
|
|
13
|
+
### 🔧 Maintenance
|
|
14
|
+
|
|
15
|
+
- split global.css into fonts.css and color-scheme.css ([4597020286](https://github.com/migrationsverket/midas/commit/4597020286))
|
|
16
|
+
- fix errors in playground app, disable for future builds ([787e74f234](https://github.com/migrationsverket/midas/commit/787e74f234))
|
|
17
|
+
- **theme:** add auto generated files in unformatted shape ([d8e2aa989f](https://github.com/migrationsverket/midas/commit/d8e2aa989f))
|
|
18
|
+
- **theme:** add explicit exports for css type help ([444b3a6e3b](https://github.com/migrationsverket/midas/commit/444b3a6e3b))
|
|
19
|
+
- temporary fix on named module imports in preview.tsx ([4ef7584195](https://github.com/migrationsverket/midas/commit/4ef7584195))
|
|
20
|
+
- buildable docs version ([b25c77fdf3](https://github.com/migrationsverket/midas/commit/b25c77fdf3))
|
|
21
|
+
|
|
22
|
+
### ⚠️ Breaking Changes
|
|
23
|
+
|
|
24
|
+
- **components-theme:** Default styles are now accessible from `import '@midas-ds/components/default.css'` or via the `@midas-ds/theme` package.
|
|
25
|
+
|
|
26
|
+
## 2.0.1 (2025-09-12)
|
|
27
|
+
|
|
28
|
+
### 🔧 Maintenance
|
|
29
|
+
|
|
30
|
+
- **theme:** rename style dictionary artifacts ([6aef7a733f](https://github.com/migrationsverket/midas/commit/6aef7a733f))
|
|
31
|
+
- **theme:** remove 'generated' ([81eb8978a9](https://github.com/migrationsverket/midas/commit/81eb8978a9))
|
|
32
|
+
- **theme:** edit config ([8db8ba0b0a](https://github.com/migrationsverket/midas/commit/8db8ba0b0a))
|
|
33
|
+
- **theme:** streamline build config ([ca07684b88](https://github.com/migrationsverket/midas/commit/ca07684b88))
|
|
34
|
+
- **theme:** sync tokens with components lib ([30c3df9190](https://github.com/migrationsverket/midas/commit/30c3df9190))
|
|
35
|
+
- clean up workflows ([6068c40031](https://github.com/migrationsverket/midas/commit/6068c40031))
|
|
36
|
+
- **theme:** update package.json with meta data ([11fd386c38](https://github.com/migrationsverket/midas/commit/11fd386c38))
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @midas-ds/theme
|
|
2
|
+
|
|
3
|
+
This package contains the design tokens for the Midas Design System, managed by [Style Dictionary](https://style-dictionary.com/).
|
|
4
|
+
It automatically generates theme assets, such as CSS variables and JavaScript modules, from a common set of token definitions.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
To install the theme package, run the following command in your project root:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @midas-ds/theme
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
The theme provides assets for both CSS and JavaScript environments.
|
|
17
|
+
|
|
18
|
+
### CSS
|
|
19
|
+
|
|
20
|
+
Import the `variables.css` file into your project's main entry point or global stylesheet. This will make all the design tokens available as CSS Custom Properties.
|
|
21
|
+
|
|
22
|
+
The CSS variables are prefixed with `midas`.
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
/* Example: In your main stylesheet */
|
|
26
|
+
@import '@midas-ds/theme/variables.css';
|
|
27
|
+
|
|
28
|
+
body {
|
|
29
|
+
background-color: var(--midas-color-background-default);
|
|
30
|
+
font-family: var(--midas-typography-font-family);
|
|
31
|
+
font-size: var(--midas-font-size-base);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### JavaScript / TypeScript
|
|
36
|
+
|
|
37
|
+
You can import the tokens directly into your JavaScript or TypeScript files to use them in your component logic or styled-components.
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
// Example: Using tokens in a JavaScript file
|
|
41
|
+
import { variables } from '@midas-ds/theme';
|
|
42
|
+
|
|
43
|
+
const customStyle = {
|
|
44
|
+
backgroundColor: variables.color.background.default,
|
|
45
|
+
padding: variables.spacing.base,
|
|
46
|
+
};
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Contributing
|
|
50
|
+
|
|
51
|
+
The source of truth for all design tokens is located in the `tokens/` directory, organized into JSON files by category (e.g., `colors.json`, `spacing.json`).
|
|
52
|
+
|
|
53
|
+
To make changes to the theme:
|
|
54
|
+
|
|
55
|
+
1. Modify the desired token values in the JSON files under the `tokens/` directory.
|
|
56
|
+
2. Run the build script `sd.build.mjs` to regenerate the theme assets. This will update the files in the `src/lib/style-dictionary-dist/` directory.
|
|
57
|
+
|
|
58
|
+
This process ensures that all theme assets are kept in sync with the master token definitions.
|
package/color-scheme.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{color-scheme:light dark}
|
package/fonts.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:100 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/inter:vf@latest/latin-wght-normal.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}*{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
|