Skip to content

Commit 7129d00

Browse files
committed
feat: migrated to oklch
1 parent d701323 commit 7129d00

File tree

27 files changed

+416
-972
lines changed

27 files changed

+416
-972
lines changed

docs/nimiq-colors/index.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ The `nimiq-colors` package is the central source of truth for color definitions
1414
The `nimiq-colors` package exports:
1515

1616
1. **CSS File**:
17-
- Path: `nimiq-colors/dist/nimiq-colors.css`
18-
- Contains CSS custom properties for all defined colors (e.g., `--nq-blue-500`, `--nq-neutral`) and gradients (e.g., `--nq-blue-gradient`).
19-
- Automatically handles light and dark themes using `@media (prefers-color-scheme: dark)` and a `.dark` class selector.
17+
18+
- Path: `nimiq-colors/dist/nimiq-colors.css`
19+
- Contains CSS custom properties for all defined colors (e.g., `--nq-blue-500`, `--nq-neutral`) and gradients (e.g., `--nq-blue-gradient`).
20+
- Automatically handles light and dark themes using `@media (prefers-color-scheme: dark)` and a `.dark` class selector.
2021

2122
2. **TypeScript Modules**:
22-
- Path: `nimiq-colors/src/colors.ts` (and `nimiq-colors/src/gradients.ts`, re-exported from `nimiq-colors/src/index.ts`)
23-
- Provides the raw color definitions as TypeScript objects. Colors are typically defined with `light` and `dark` properties containing their oklch string values.
24-
- Example: `import { blue, neutralGradient } from 'nimiq-colors/src';`
23+
- Path: `nimiq-colors/src/colors.ts` (and `nimiq-colors/src/gradients.ts`, re-exported from `nimiq-colors/src/index.ts`)
24+
- Provides the raw color definitions as TypeScript objects. Colors are typically defined with `light` and `dark` properties containing their oklch string values.
25+
- Example: `import { blue, neutralGradient } from 'nimiq-colors/src';`
2526

2627
## Usage
2728

@@ -32,34 +33,36 @@ If you are using the main `nimiq-css` package, the Nimiq colors CSS is automatic
3233
If you want to use `nimiq-colors` directly in a project without the full `nimiq-css`:
3334

3435
```css
35-
@import "nimiq-colors/dist/nimiq-colors.css";
36+
@import 'nimiq-colors/dist/nimiq-colors.css';
3637

3738
.my-element {
3839
background-color: oklch(var(--nq-blue-500));
3940
color: oklch(var(--nq-neutral-900));
4041
}
4142
```
43+
4244
(Note: Using `oklch(var(...))` is optional; `var(...)` works directly if the value is already a full color string, but oklch() ensures the context).
4345

4446
### TypeScript
4547

4648
You can import the TypeScript definitions for use in build scripts, theming engines, or JavaScript logic:
4749

4850
```typescript
49-
import { blue, allColors, allGradients } from 'nimiq-colors/src'; // Or from 'nimiq-colors' if top-level export is configured for src
51+
import { allColors, allGradients, blue } from 'nimiq-colors/src' // Or from 'nimiq-colors' if top-level export is configured for src
5052
5153
// Accessing a specific color shade for light mode:
52-
console.log(blue[500].light); // e.g., 'oklch(0.88 0.08 230)'
54+
console.log(blue[500].light) // e.g., 'oklch(0.88 0.08 230)'
5355

5456
// Accessing a default color for dark mode:
55-
console.log(allColors.neutral.DEFAULT.dark);
57+
console.log(allColors.neutral.DEFAULT.dark)
5658

5759
// Accessing gradient stops:
58-
console.log(allGradients.blueGradient.light.from);
60+
console.log(allGradients.blueGradient.light.from)
5961
```
6062

6163
## Integration
6264

6365
The `nimiq-colors` package is a foundational part of the Nimiq design system.
64-
- `nimiq-css` uses `nimiq-colors` for its global color styles and for its UnoCSS color preset.
65-
- Other Nimiq tools or applications can consume `nimiq-colors` directly for consistent color usage.
66+
67+
- `nimiq-css` uses `nimiq-colors` for its global color styles and for its UnoCSS color preset.
68+
- Other Nimiq tools or applications can consume `nimiq-colors` directly for consistent color usage.

docs/nimiq-css/layers/colors.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ The Colors layer in `nimiq-css` ensures that these CSS variables for colors are
77
[View `nimiq-colors` source definitions](https://github.com/onmax/nimiq-ui/tree/main/packages/nimiq-colors/src/colors.ts){.nq-arrow .nq-pill-tertiary .nq-raw}
88
[View generated CSS from `nimiq-colors`](https://github.com/onmax/nimiq-ui/tree/main/packages/nimiq-colors/dist/nimiq-colors.css){.nq-arrow .nq-pill-tertiary .nq-raw}
99

10-
1110
## Usage
1211

1312
The necessary color CSS from `nimiq-colors` is automatically imported by `nimiq-css` via its main CSS file (`nimiq-css/dist/css/index.css`). You generally do not need to import it separately if you are using `nimiq-css`.

packages/nimiq-colors/package.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/nimiq-colors/scripts/build-css.ts

Lines changed: 0 additions & 130 deletions
This file was deleted.

packages/nimiq-colors/src/colors.ts

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)