@rolemodel/optics 2.5.1 → 2.6.1
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/.github/workflows/linting.yml +2 -0
- package/.prettierignore +3 -0
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +41 -0
- package/README.md +16 -0
- package/build_token_json.js +2 -1
- package/dist/README.md +16 -0
- package/dist/css/core/tokens/base_color_tokens.css +74 -0
- package/dist/css/core/tokens/base_tokens.css +3 -345
- package/dist/css/core/tokens/index.css +2 -1
- package/dist/css/core/tokens/oklch/base_color_tokens.css +74 -0
- package/dist/css/core/tokens/oklch/index.css +3 -0
- package/dist/css/core/tokens/oklch/scale_color_tokens.css +1498 -0
- package/dist/css/core/tokens/shared_tokens.css +272 -0
- package/dist/css/optics+feather_icons.css +74 -73
- package/dist/css/optics+feather_icons.min.css +1 -1
- package/dist/css/optics+lucide_icons.css +74 -73
- package/dist/css/optics+lucide_icons.min.css +1 -1
- package/dist/css/optics+material_outlined_variable.css +74 -73
- package/dist/css/optics+material_outlined_variable.min.css +1 -1
- package/dist/css/optics+no_icons.css +74 -73
- package/dist/css/optics+no_icons.min.css +1 -1
- package/dist/css/optics+phosphor_icons.css +74 -73
- package/dist/css/optics+phosphor_icons.min.css +1 -1
- package/dist/css/optics+tabler_icons.css +74 -73
- package/dist/css/optics+tabler_icons.min.css +1 -1
- package/dist/css/optics-oklch+feather_icons.css +6566 -0
- package/dist/css/optics-oklch+feather_icons.min.css +1 -0
- package/dist/css/optics-oklch+lucide_icons.css +13598 -0
- package/dist/css/optics-oklch+lucide_icons.min.css +1 -0
- package/dist/css/optics-oklch+material_outlined_variable.css +5636 -0
- package/dist/css/optics-oklch+material_outlined_variable.min.css +1 -0
- package/dist/css/optics-oklch+no_icons.css +5627 -0
- package/dist/css/optics-oklch+no_icons.min.css +1 -0
- package/dist/css/optics-oklch+phosphor_icons.css +5671 -0
- package/dist/css/optics-oklch+phosphor_icons.min.css +1 -0
- package/dist/css/optics-oklch+tabler_icons.css +5638 -0
- package/dist/css/optics-oklch+tabler_icons.min.css +1 -0
- package/dist/css/optics-oklch.css +5640 -0
- package/dist/css/optics-oklch.min.css +1 -0
- package/dist/css/optics.css +74 -73
- package/dist/css/optics.min.css +1 -1
- package/dist/package.json +10 -6
- package/dist/tokens/tokens.json +16 -16
- package/dist/tools/check-contrast.cjs +47 -0
- package/dist/tools/contrast/builds/build.cjs +44 -0
- package/dist/tools/contrast/builds/hsl-build.cjs +11 -0
- package/dist/tools/contrast/builds/oklch-build.cjs +11 -0
- package/dist/tools/contrast/calc-expression.cjs +68 -0
- package/dist/tools/contrast/check-error.cjs +4 -0
- package/dist/tools/contrast/color-pair.cjs +35 -0
- package/dist/tools/contrast/colors/color.cjs +41 -0
- package/dist/tools/contrast/colors/function-color.cjs +46 -0
- package/dist/tools/contrast/colors/hex-color.cjs +19 -0
- package/dist/tools/contrast/colors/hsl-color.cjs +25 -0
- package/dist/tools/contrast/colors/oklch-color.cjs +36 -0
- package/dist/tools/contrast/colors/themed-color.cjs +37 -0
- package/dist/tools/contrast/contrast-check.cjs +37 -0
- package/dist/tools/contrast/contrast-reporter.cjs +44 -0
- package/dist/tools/contrast/contrast-result.cjs +15 -0
- package/dist/tools/contrast/css-syntax.cjs +23 -0
- package/dist/tools/contrast/stylesheet.cjs +174 -0
- package/dist/tools/contrast/theme.cjs +84 -0
- package/dist/tools/contrast/tool-options.cjs +50 -0
- package/package.json +10 -6
package/.prettierignore
CHANGED
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,47 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [2.6.1] - 2026-10-21
|
|
8
|
+
|
|
9
|
+
### Theme Token Changes
|
|
10
|
+
|
|
11
|
+
- Add a `--mode` option to the contrast checker by @Jeremy-Walton in https://github.com/RoleModel/optics/pull/371
|
|
12
|
+
- `optics-check-contrast` takes `--mode=light` or `--mode=dark` to check only one color mode. Use it if your app forces one mode, such as with `data-theme-mode="light"`. Both modes are still checked by default. See [Contrast Checker](https://docs.optics.rolemodel.design/?path=/docs/tools-contrast-checker--docs)
|
|
13
|
+
|
|
14
|
+
### Dependencies
|
|
15
|
+
|
|
16
|
+
- Add a `--mode` option to the contrast checker by @Jeremy-Walton in https://github.com/RoleModel/optics/pull/371
|
|
17
|
+
- Includes the vite bump from 8.1.4 to 8.1.6 from https://github.com/RoleModel/optics/pull/369. Development dependencies were updated in the lockfile. It does not affect the shipped CSS.
|
|
18
|
+
|
|
19
|
+
### Documentation Changes
|
|
20
|
+
|
|
21
|
+
- Add a `--mode` option to the contrast checker by @Jeremy-Walton in https://github.com/RoleModel/optics/pull/371
|
|
22
|
+
- The [Contrast Checker](https://docs.optics.rolemodel.design/?path=/docs/tools-contrast-checker--docs) page lists the `--mode` option and the default for each option.
|
|
23
|
+
|
|
24
|
+
## [2.6.0] - 2026-10-21
|
|
25
|
+
|
|
26
|
+
### Theme Token Changes
|
|
27
|
+
|
|
28
|
+
- Add an opt-in OKLCH color build by @Jeremy-Walton in https://github.com/RoleModel/optics/pull/368
|
|
29
|
+
- A new `optics-oklch.css` build (and one per icon set, such as `optics-oklch+lucide_icons.css`) defines every color token with `oklch()`. To switch, replace `optics` with `optics-oklch` in your import. The HSL build stays the default and is unchanged, and `core/tokens/base_tokens.css` still includes the color tokens for apps that import it directly. Apps can also run the new `optics-check-contrast` command in CI to check their theme's text contrast. See [OKLCH Colors](https://docs.optics.rolemodel.design/?path=/docs/overview-oklch-colors--docs) and [Contrast Checker](https://docs.optics.rolemodel.design/?path=/docs/tools-contrast-checker--docs)
|
|
30
|
+
|
|
31
|
+
### Dependencies
|
|
32
|
+
|
|
33
|
+
- Update transitive dependencies to resolve Dependabot alerts by @Jeremy-Walton in https://github.com/RoleModel/optics/pull/367
|
|
34
|
+
- Development dependencies were updated in the lockfile. It does not affect the shipped CSS.
|
|
35
|
+
|
|
36
|
+
### Repository Changes
|
|
37
|
+
|
|
38
|
+
- Add an opt-in OKLCH color build by @Jeremy-Walton in https://github.com/RoleModel/optics/pull/368
|
|
39
|
+
- Added tests for the contrast checker, which `yarn test` and the Linting CI workflow now run. The docs build now creates the llms docs before Storybook.
|
|
40
|
+
|
|
41
|
+
### Documentation Changes
|
|
42
|
+
|
|
43
|
+
- Add an opt-in OKLCH color build by @Jeremy-Walton in https://github.com/RoleModel/optics/pull/368
|
|
44
|
+
- Added an [OKLCH Colors](https://docs.optics.rolemodel.design/?path=/docs/overview-oklch-colors--docs) page, a Tools section with the [Contrast Checker](https://docs.optics.rolemodel.design/?path=/docs/tools-contrast-checker--docs) page, an HSL / OKLCH toggle in the documentation site toolbar, and an OKLCH template on the Color Scale page.
|
|
45
|
+
|
|
46
|
+
**Full Changelog**: https://github.com/RoleModel/optics/compare/v2.5.1...v2.6.0
|
|
47
|
+
|
|
7
48
|
## [2.5.1] - 2026-10-01
|
|
8
49
|
|
|
9
50
|
### Component Changes
|
package/README.md
CHANGED
|
@@ -40,6 +40,8 @@ You can add this import to the top of your root level `css` file.
|
|
|
40
40
|
@import '@rolemodel/optics/dist/css/optics.min.css'; /* If you want a single file with all the styles in it. */
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
An OKLCH build is also available. See [OKLCH Colors](https://docs.optics.rolemodel.design/?path=/docs/overview-oklch-colors--docs).
|
|
44
|
+
|
|
43
45
|
### Importing without a compiler
|
|
44
46
|
|
|
45
47
|
To use Optics without compilation, use a CDN like [jsDelivr](https://www.jsdelivr.com/) or [unpkg](https://unpkg.com/).
|
|
@@ -58,6 +60,20 @@ Add a link in your HTML head or an `@import` to the top of your root level `css`
|
|
|
58
60
|
|
|
59
61
|
Note: You can use this method to use Optics with [CodePen](https://codepen.io/). In a CodePen project, go to `Settings > CSS`, find the section for adding external stylesheets, and add the CDN link as a resource.
|
|
60
62
|
|
|
63
|
+
### Checking theme contrast
|
|
64
|
+
|
|
65
|
+
After customizing your theme, add `optics-check-contrast` to your CI to check that text on every color scale step passes WCAG AA:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"scripts": {
|
|
70
|
+
"check-contrast": "optics-check-contrast app/assets/stylesheets/theme.css"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
See [Contrast Checker](https://docs.optics.rolemodel.design/?path=/docs/tools-contrast-checker--docs) for options.
|
|
76
|
+
|
|
61
77
|
## Documentation
|
|
62
78
|
|
|
63
79
|
We use [Storybook](https://storybook.js.org/docs/html/get-started/introduction) as a way to provide informative and interactive documentation.
|
package/build_token_json.js
CHANGED
|
@@ -132,7 +132,8 @@ try {
|
|
|
132
132
|
.filter((directoryEntry) => directoryEntry.isFile() && directoryEntry.name !== 'index.css')
|
|
133
133
|
.forEach((directoryEntry) => {
|
|
134
134
|
const fileContents = fs.readFileSync(`${source}/${directoryEntry.name}`)
|
|
135
|
-
|
|
135
|
+
// Import-only files like base_tokens.css declare no variables.
|
|
136
|
+
const matches = fileContents.toString().match(/^\s*--.*?(?=;)/gm) ?? []
|
|
136
137
|
matches.forEach((match) => {
|
|
137
138
|
const [key, value] = match.split(':')
|
|
138
139
|
variables = addToJson(splitKey(key.trim()), variables, value.trim())
|
package/dist/README.md
CHANGED
|
@@ -40,6 +40,8 @@ You can add this import to the top of your root level `css` file.
|
|
|
40
40
|
@import '@rolemodel/optics/dist/css/optics.min.css'; /* If you want a single file with all the styles in it. */
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
An OKLCH build is also available. See [OKLCH Colors](https://docs.optics.rolemodel.design/?path=/docs/overview-oklch-colors--docs).
|
|
44
|
+
|
|
43
45
|
### Importing without a compiler
|
|
44
46
|
|
|
45
47
|
To use Optics without compilation, use a CDN like [jsDelivr](https://www.jsdelivr.com/) or [unpkg](https://unpkg.com/).
|
|
@@ -58,6 +60,20 @@ Add a link in your HTML head or an `@import` to the top of your root level `css`
|
|
|
58
60
|
|
|
59
61
|
Note: You can use this method to use Optics with [CodePen](https://codepen.io/). In a CodePen project, go to `Settings > CSS`, find the section for adding external stylesheets, and add the CDN link as a resource.
|
|
60
62
|
|
|
63
|
+
### Checking theme contrast
|
|
64
|
+
|
|
65
|
+
After customizing your theme, add `optics-check-contrast` to your CI to check that text on every color scale step passes WCAG AA:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"scripts": {
|
|
70
|
+
"check-contrast": "optics-check-contrast app/assets/stylesheets/theme.css"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
See [Contrast Checker](https://docs.optics.rolemodel.design/?path=/docs/tools-contrast-checker--docs) for options.
|
|
76
|
+
|
|
61
77
|
## Documentation
|
|
62
78
|
|
|
63
79
|
We use [Storybook](https://storybook.js.org/docs/html/get-started/introduction) as a way to provide informative and interactive documentation.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Color HSLs
|
|
3
|
+
A theme comprised of a primary, neutral, warning, danger, info, and notice colors.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* Basic Colors */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @tokens Basic Colors
|
|
10
|
+
* @presenter Color
|
|
11
|
+
*/
|
|
12
|
+
--op-color-white: hsl(0deg 100% 100%);
|
|
13
|
+
--op-color-black: hsl(0deg 0% 0%);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @tokens Primary Colors
|
|
17
|
+
* @presenter Color
|
|
18
|
+
*/
|
|
19
|
+
--op-color-primary-h: 216;
|
|
20
|
+
--op-color-primary-s: 58%;
|
|
21
|
+
--op-color-primary-l: 48%;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @tokens Neutral Colors
|
|
25
|
+
* @presenter Color
|
|
26
|
+
*/
|
|
27
|
+
--op-color-neutral-h: var(--op-color-primary-h);
|
|
28
|
+
--op-color-neutral-s: 4%;
|
|
29
|
+
--op-color-neutral-l: var(--op-color-primary-l);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @tokens Alerts Warning Colors
|
|
33
|
+
* @presenter Color
|
|
34
|
+
*/
|
|
35
|
+
--op-color-alerts-warning-h: 47;
|
|
36
|
+
--op-color-alerts-warning-s: 100%;
|
|
37
|
+
--op-color-alerts-warning-l: 61%;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @tokens Alerts Danger Colors
|
|
41
|
+
* @presenter Color
|
|
42
|
+
*/
|
|
43
|
+
--op-color-alerts-danger-h: 0;
|
|
44
|
+
--op-color-alerts-danger-s: 99%;
|
|
45
|
+
--op-color-alerts-danger-l: 76%;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @tokens Alerts Info Colors
|
|
49
|
+
* @presenter Color
|
|
50
|
+
*/
|
|
51
|
+
--op-color-alerts-info-h: 216;
|
|
52
|
+
--op-color-alerts-info-s: 58%;
|
|
53
|
+
--op-color-alerts-info-l: 48%;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @tokens Alerts Notice Colors
|
|
57
|
+
* @presenter Color
|
|
58
|
+
*/
|
|
59
|
+
--op-color-alerts-notice-h: 130;
|
|
60
|
+
--op-color-alerts-notice-s: 61%;
|
|
61
|
+
--op-color-alerts-notice-l: 64%;
|
|
62
|
+
|
|
63
|
+
/* Shadows */
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @tokens Shadows
|
|
67
|
+
* @presenter Shadow
|
|
68
|
+
*/
|
|
69
|
+
--op-shadow-x-small: 0 1px 2px hsl(0deg 0% 0% / 3%), 0 1px 3px hsl(0deg 0% 0% / 15%);
|
|
70
|
+
--op-shadow-small: 0 1px 2px hsl(0deg 0% 0% / 3%), 0 2px 6px hsl(0deg 0% 0% / 15%);
|
|
71
|
+
--op-shadow-medium: 0 4px 8px hsl(0deg 0% 0% / 15%), 0 1px 3px hsl(0deg 0% 0% / 3%);
|
|
72
|
+
--op-shadow-large: 0 6px 10px hsl(0deg 0% 0% / 15%), 0 2px 3px hsl(0deg 0% 0% / 3%);
|
|
73
|
+
--op-shadow-x-large: 0 8px 12px hsl(0deg 0% 0% / 15%), 0 4px 4px hsl(0deg 0% 0% / 3%);
|
|
74
|
+
}
|
|
@@ -1,345 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/* Basic Colors */
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @tokens Basic Colors
|
|
10
|
-
* @presenter Color
|
|
11
|
-
*/
|
|
12
|
-
--op-color-white: hsl(0deg 100% 100%);
|
|
13
|
-
--op-color-black: hsl(0deg 0% 0%);
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @tokens Primary Colors
|
|
17
|
-
* @presenter Color
|
|
18
|
-
*/
|
|
19
|
-
--op-color-primary-h: 216;
|
|
20
|
-
--op-color-primary-s: 58%;
|
|
21
|
-
--op-color-primary-l: 48%;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @tokens Neutral Colors
|
|
25
|
-
* @presenter Color
|
|
26
|
-
*/
|
|
27
|
-
--op-color-neutral-h: var(--op-color-primary-h);
|
|
28
|
-
--op-color-neutral-s: 4%;
|
|
29
|
-
--op-color-neutral-l: var(--op-color-primary-l);
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @tokens Alerts Warning Colors
|
|
33
|
-
* @presenter Color
|
|
34
|
-
*/
|
|
35
|
-
--op-color-alerts-warning-h: 47;
|
|
36
|
-
--op-color-alerts-warning-s: 100%;
|
|
37
|
-
--op-color-alerts-warning-l: 61%;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @tokens Alerts Danger Colors
|
|
41
|
-
* @presenter Color
|
|
42
|
-
*/
|
|
43
|
-
--op-color-alerts-danger-h: 0;
|
|
44
|
-
--op-color-alerts-danger-s: 99%;
|
|
45
|
-
--op-color-alerts-danger-l: 76%;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @tokens Alerts Info Colors
|
|
49
|
-
* @presenter Color
|
|
50
|
-
*/
|
|
51
|
-
--op-color-alerts-info-h: 216;
|
|
52
|
-
--op-color-alerts-info-s: 58%;
|
|
53
|
-
--op-color-alerts-info-l: 48%;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @tokens Alerts Notice Colors
|
|
57
|
-
* @presenter Color
|
|
58
|
-
*/
|
|
59
|
-
--op-color-alerts-notice-h: 130;
|
|
60
|
-
--op-color-alerts-notice-s: 61%;
|
|
61
|
-
--op-color-alerts-notice-l: 64%;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @tokens Opacities
|
|
65
|
-
* @presenter Opacity
|
|
66
|
-
*/
|
|
67
|
-
--op-opacity-none: 0;
|
|
68
|
-
--op-opacity-overlay: 0.2;
|
|
69
|
-
--op-opacity-disabled: 0.4;
|
|
70
|
-
--op-opacity-half: 0.5;
|
|
71
|
-
--op-opacity-full: 1;
|
|
72
|
-
|
|
73
|
-
/*
|
|
74
|
-
Breakpoints
|
|
75
|
-
CSS does not support using variables within @media or @container queries. Environment variables are drafted but likely to not be implemented soon.
|
|
76
|
-
https://drafts.csswg.org/css-env-1/
|
|
77
|
-
https://bholmes.dev/blog/alternative-to-css-variable-media-queries/
|
|
78
|
-
|
|
79
|
-
Here is a list of breakpoints used throughout Optics:
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @tokens Breakpoints
|
|
84
|
-
* @presenter Spacing
|
|
85
|
-
*/
|
|
86
|
-
--op-breakpoint-x-small: 512px; /* vertical phone */
|
|
87
|
-
--op-breakpoint-small: 768px; /* vertical ipad */
|
|
88
|
-
--op-breakpoint-medium: 1024px; /* landscape ipad */
|
|
89
|
-
--op-breakpoint-large: 1280px; /* small laptop */
|
|
90
|
-
--op-breakpoint-x-large: 1440px; /* medium laptop */
|
|
91
|
-
|
|
92
|
-
/* Border */
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* @tokens Border Radius
|
|
96
|
-
* @presenter BorderRadius
|
|
97
|
-
*/
|
|
98
|
-
--op-radius-small: 2px;
|
|
99
|
-
--op-radius-medium: 4px;
|
|
100
|
-
--op-radius-large: 8px;
|
|
101
|
-
--op-radius-x-large: 12px;
|
|
102
|
-
--op-radius-2x-large: 16px;
|
|
103
|
-
--op-radius-circle: 50%;
|
|
104
|
-
--op-radius-pill: 9999px;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @tokens Border Width
|
|
108
|
-
* @presenter Spacing
|
|
109
|
-
*/
|
|
110
|
-
--op-border-width: 1px;
|
|
111
|
-
--op-border-width-large: 2px;
|
|
112
|
-
--op-border-width-x-large: 4px;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @tokens Border Color
|
|
116
|
-
* @presenter Color
|
|
117
|
-
*/
|
|
118
|
-
--op-color-border: var(--op-color-neutral-plus-five);
|
|
119
|
-
|
|
120
|
-
/* E.G. box-shadow: var(--op-border-top) var(--op-color-border); */
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* @tokens Border Shadow
|
|
124
|
-
* @presenter Shadow
|
|
125
|
-
*/
|
|
126
|
-
--op-border-none: 0 0 0 0;
|
|
127
|
-
--op-border-all: 0 0 0 var(--op-border-width);
|
|
128
|
-
--op-border-top: 0 calc(-1 * var(--op-border-width)) 0 0;
|
|
129
|
-
--op-border-right: var(--op-border-width) 0 0 0;
|
|
130
|
-
--op-border-bottom: 0 var(--op-border-width) 0 0;
|
|
131
|
-
--op-border-left: calc(-1 * var(--op-border-width)) 0 0 0;
|
|
132
|
-
--op-border-y: var(--op-border-top) var(--op-color-border), var(--op-border-bottom) var(--op-color-border);
|
|
133
|
-
--op-border-x: var(--op-border-left) var(--op-color-border), var(--op-border-right) var(--op-color-border);
|
|
134
|
-
|
|
135
|
-
/* Font */
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* @tokens Font Scale
|
|
139
|
-
* @presenter FontSize
|
|
140
|
-
*/
|
|
141
|
-
--op-font-scale-unit: 1rem; /* 10px; */
|
|
142
|
-
--op-font-2x-small: calc(var(--op-font-scale-unit) * 1); /* 10px */
|
|
143
|
-
--op-font-x-small: calc(var(--op-font-scale-unit) * 1.2); /* 12px */
|
|
144
|
-
--op-font-small: calc(var(--op-font-scale-unit) * 1.4); /* 14px */
|
|
145
|
-
--op-font-medium: calc(var(--op-font-scale-unit) * 1.6); /* 16px */
|
|
146
|
-
--op-font-large: calc(var(--op-font-scale-unit) * 1.8); /* 18px */
|
|
147
|
-
--op-font-x-large: calc(var(--op-font-scale-unit) * 2); /* 20px */
|
|
148
|
-
--op-font-2x-large: calc(var(--op-font-scale-unit) * 2.4); /* 24px */
|
|
149
|
-
--op-font-3x-large: calc(var(--op-font-scale-unit) * 2.8); /* 28px */
|
|
150
|
-
--op-font-4x-large: calc(var(--op-font-scale-unit) * 3.2); /* 32px */
|
|
151
|
-
--op-font-5x-large: calc(var(--op-font-scale-unit) * 3.6); /* 36px */
|
|
152
|
-
--op-font-6x-large: calc(var(--op-font-scale-unit) * 4.8); /* 48px */
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* @tokens Font Weight
|
|
156
|
-
* @presenter FontWeight
|
|
157
|
-
*/
|
|
158
|
-
--op-font-weight-thin: 100;
|
|
159
|
-
--op-font-weight-extra-light: 200;
|
|
160
|
-
--op-font-weight-light: 300;
|
|
161
|
-
--op-font-weight-normal: 400;
|
|
162
|
-
--op-font-weight-medium: 500;
|
|
163
|
-
--op-font-weight-semi-bold: 600;
|
|
164
|
-
--op-font-weight-bold: 700;
|
|
165
|
-
--op-font-weight-extra-bold: 800;
|
|
166
|
-
--op-font-weight-black: 900;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* @tokens Font Family
|
|
170
|
-
* @presenter FontFamily
|
|
171
|
-
*/
|
|
172
|
-
--op-font-family: 'Noto Sans', sans-serif;
|
|
173
|
-
--op-font-family-alt: 'Noto Serif', serif;
|
|
174
|
-
|
|
175
|
-
/* Text */
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* @tokens Line Height
|
|
179
|
-
* @presenter LineHeight
|
|
180
|
-
*/
|
|
181
|
-
--op-line-height-none: 0;
|
|
182
|
-
--op-line-height-densest: 1;
|
|
183
|
-
--op-line-height-denser: 1.15;
|
|
184
|
-
--op-line-height-dense: 1.3;
|
|
185
|
-
--op-line-height-base: 1.5;
|
|
186
|
-
--op-line-height-loose: 1.6;
|
|
187
|
-
--op-line-height-looser: 1.7;
|
|
188
|
-
--op-line-height-loosest: 1.8;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @tokens Letter Spacing
|
|
192
|
-
* @presenter LetterSpacing
|
|
193
|
-
*/
|
|
194
|
-
--op-letter-spacing-navigation: 0.01rem;
|
|
195
|
-
--op-letter-spacing-label: 0.04rem;
|
|
196
|
-
|
|
197
|
-
/* Transitions and Animations */
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* @tokens Transition
|
|
201
|
-
*/
|
|
202
|
-
--op-transition-accordion: rotate 120ms ease-in;
|
|
203
|
-
--op-transition-accordion-content: height 300ms ease, content-visibility 300ms ease allow-discrete;
|
|
204
|
-
--op-transition-input: all 120ms ease-in;
|
|
205
|
-
--op-transition-sidebar: all 200ms ease-in-out;
|
|
206
|
-
--op-transition-modal-time: 300ms;
|
|
207
|
-
--op-transition-modal: all var(--op-transition-modal-time) ease-in;
|
|
208
|
-
--op-transition-panel: right 400ms ease-in;
|
|
209
|
-
--op-transition-tooltip: all 300ms ease-in 300ms;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* @tokens Animation
|
|
213
|
-
* @presenter Animation
|
|
214
|
-
*/
|
|
215
|
-
--op-animation-flash: rm-slide-in-out-flash 5s normal forwards;
|
|
216
|
-
|
|
217
|
-
/* Encoded Images */
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* @tokens Encoded Images
|
|
221
|
-
*/
|
|
222
|
-
--op-encoded-images-dropdown-arrow-width: calc(
|
|
223
|
-
1.2 * var(--op-space-scale-unit)
|
|
224
|
-
); /* 12px No way to string interpolate */
|
|
225
|
-
|
|
226
|
-
--op-encoded-images-dropdown-arrow: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDEyIDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik02IDguMzc1MDFMMCAyLjM3NTAxTDEuNCAwLjk3NTAwNkw2IDUuNTc1MDFMMTAuNiAwLjk3NTAwNkwxMiAyLjM3NTAxTDYgOC4zNzUwMVoiIGZpbGw9IiMwQTBBMEIiLz4KPC9zdmc+Cg==');
|
|
227
|
-
|
|
228
|
-
/* Spacing */
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* @tokens Size Scale
|
|
232
|
-
* @presenter Spacing
|
|
233
|
-
*/
|
|
234
|
-
--op-size-unit: 0.4rem; /* 4px */
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* @tokens Space Scale
|
|
238
|
-
* @presenter Spacing
|
|
239
|
-
*/
|
|
240
|
-
--op-space-scale-unit: 1rem; /* 10px; */
|
|
241
|
-
--op-space-3x-small: calc(var(--op-space-scale-unit) * 0.2); /* 2px */
|
|
242
|
-
--op-space-2x-small: calc(var(--op-space-scale-unit) * 0.4); /* 4px */
|
|
243
|
-
--op-space-x-small: calc(var(--op-space-scale-unit) * 0.8); /* 8px */
|
|
244
|
-
--op-space-small: calc(var(--op-space-scale-unit) * 1.2); /* 12px */
|
|
245
|
-
--op-space-medium: calc(var(--op-space-scale-unit) * 1.6); /* 16px */
|
|
246
|
-
--op-space-large: calc(var(--op-space-scale-unit) * 2); /* 20px */
|
|
247
|
-
--op-space-x-large: calc(var(--op-space-scale-unit) * 2.4); /* 24px */
|
|
248
|
-
--op-space-2x-large: calc(var(--op-space-scale-unit) * 2.8); /* 28px */
|
|
249
|
-
--op-space-3x-large: calc(var(--op-space-scale-unit) * 4); /* 40px */
|
|
250
|
-
--op-space-4x-large: calc(var(--op-space-scale-unit) * 8); /* 80px */
|
|
251
|
-
|
|
252
|
-
/* Shadows */
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* @tokens Shadows
|
|
256
|
-
* @presenter Shadow
|
|
257
|
-
*/
|
|
258
|
-
--op-shadow-x-small: 0 1px 2px hsl(0deg 0% 0% / 3%), 0 1px 3px hsl(0deg 0% 0% / 15%);
|
|
259
|
-
--op-shadow-small: 0 1px 2px hsl(0deg 0% 0% / 3%), 0 2px 6px hsl(0deg 0% 0% / 15%);
|
|
260
|
-
--op-shadow-medium: 0 4px 8px hsl(0deg 0% 0% / 15%), 0 1px 3px hsl(0deg 0% 0% / 3%);
|
|
261
|
-
--op-shadow-large: 0 6px 10px hsl(0deg 0% 0% / 15%), 0 2px 3px hsl(0deg 0% 0% / 3%);
|
|
262
|
-
--op-shadow-x-large: 0 8px 12px hsl(0deg 0% 0% / 15%), 0 4px 4px hsl(0deg 0% 0% / 3%);
|
|
263
|
-
|
|
264
|
-
/* Z Index */
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* @tokens Z-Index
|
|
268
|
-
*/
|
|
269
|
-
--op-z-index-header: 500;
|
|
270
|
-
--op-z-index-footer: 500;
|
|
271
|
-
--op-z-index-sidebar: 700;
|
|
272
|
-
--op-z-index-dialog: 800;
|
|
273
|
-
--op-z-index-dialog-backdrop: 801;
|
|
274
|
-
--op-z-index-dialog-content: 802;
|
|
275
|
-
--op-z-index-dropdown: 900;
|
|
276
|
-
--op-z-index-alert-group: 950;
|
|
277
|
-
--op-z-index-tooltip: 1000;
|
|
278
|
-
|
|
279
|
-
/* Inputs */
|
|
280
|
-
|
|
281
|
-
/*
|
|
282
|
-
This should follow multiples of 4
|
|
283
|
-
https: //uxdesign.cc/baseline-grids-design-systems-ae23b5af8cec See example 8
|
|
284
|
-
*/
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* @tokens Input Heights
|
|
288
|
-
* @presenter Spacing
|
|
289
|
-
*/
|
|
290
|
-
--op-input-height-small: 2.8rem; /* 28px */
|
|
291
|
-
--op-input-height-medium: 3.6rem; /* 36px */
|
|
292
|
-
--op-input-height-large: 4rem; /* 40px */
|
|
293
|
-
--op-input-height-x-large: 8.4rem; /* 84px */
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* @tokens Input Focus
|
|
297
|
-
* @presenter Shadow
|
|
298
|
-
*/
|
|
299
|
-
--op-input-inner-focus: inset 0 0 0 var(--op-border-width-large);
|
|
300
|
-
--op-input-outer-focus: 0 0 0 var(--op-border-width-x-large);
|
|
301
|
-
--op-input-focus-primary:
|
|
302
|
-
var(--op-input-inner-focus) var(--op-color-primary-plus-two),
|
|
303
|
-
var(--op-input-outer-focus) var(--op-color-primary-plus-five);
|
|
304
|
-
--op-input-focus-neutral:
|
|
305
|
-
var(--op-input-inner-focus) var(--op-color-neutral-plus-two),
|
|
306
|
-
var(--op-input-outer-focus) var(--op-color-neutral-plus-five);
|
|
307
|
-
--op-input-focus-danger:
|
|
308
|
-
var(--op-input-inner-focus) var(--op-color-alerts-danger-plus-two),
|
|
309
|
-
var(--op-input-outer-focus) var(--op-color-alerts-danger-plus-five);
|
|
310
|
-
--op-input-focus-warning:
|
|
311
|
-
var(--op-input-inner-focus) var(--op-color-alerts-warning-plus-two),
|
|
312
|
-
var(--op-input-outer-focus) var(--op-color-alerts-warning-plus-five);
|
|
313
|
-
--op-input-focus-info:
|
|
314
|
-
var(--op-input-inner-focus) var(--op-color-alerts-info-plus-two),
|
|
315
|
-
var(--op-input-outer-focus) var(--op-color-alerts-info-plus-five);
|
|
316
|
-
--op-input-focus-notice:
|
|
317
|
-
var(--op-input-inner-focus) var(--op-color-alerts-notice-plus-two),
|
|
318
|
-
var(--op-input-outer-focus) var(--op-color-alerts-notice-plus-five);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/* Animations */
|
|
322
|
-
@keyframes rm-slide-in-out-flash {
|
|
323
|
-
/*
|
|
324
|
-
If an duration of 5s is set:
|
|
325
|
-
Start off the Screen
|
|
326
|
-
*/
|
|
327
|
-
0% {
|
|
328
|
-
inset-inline-end: -100%;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/* Animate onto the screen for 0.5s */
|
|
332
|
-
10% {
|
|
333
|
-
inset-inline-end: var(--op-space-large);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/* Stay on the screen for 3s */
|
|
337
|
-
70% {
|
|
338
|
-
inset-inline-end: var(--op-space-large);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/* Animate off the screen for 1.5s */
|
|
342
|
-
100% {
|
|
343
|
-
inset-inline-end: -100%;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
1
|
+
/* Kept so apps that import this file directly still get the HSL color tokens and shadows. */
|
|
2
|
+
@import 'shared_tokens.css';
|
|
3
|
+
@import 'base_color_tokens.css';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Color OKLCH values
|
|
3
|
+
A theme comprised of a primary, neutral, warning, danger, info, and notice colors.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* Basic Colors */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @tokens Basic Colors
|
|
10
|
+
* @presenter Color
|
|
11
|
+
*/
|
|
12
|
+
--op-color-white: oklch(100% 0 0);
|
|
13
|
+
--op-color-black: oklch(0% 0 0);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @tokens Primary Colors
|
|
17
|
+
* @presenter Color
|
|
18
|
+
*/
|
|
19
|
+
--op-color-primary-h: 258.5;
|
|
20
|
+
--op-color-primary-c: 0.146;
|
|
21
|
+
--op-color-primary-l: 53.9%;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @tokens Neutral Colors
|
|
25
|
+
* @presenter Color
|
|
26
|
+
*/
|
|
27
|
+
--op-color-neutral-h: var(--op-color-primary-h);
|
|
28
|
+
--op-color-neutral-c: 0.01;
|
|
29
|
+
--op-color-neutral-l: var(--op-color-primary-l);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @tokens Alerts Warning Colors
|
|
33
|
+
* @presenter Color
|
|
34
|
+
*/
|
|
35
|
+
--op-color-alerts-warning-h: 92.3;
|
|
36
|
+
--op-color-alerts-warning-c: 0.166;
|
|
37
|
+
--op-color-alerts-warning-l: 88.2%;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @tokens Alerts Danger Colors
|
|
41
|
+
* @presenter Color
|
|
42
|
+
*/
|
|
43
|
+
--op-color-alerts-danger-h: 21.2;
|
|
44
|
+
--op-color-alerts-danger-c: 0.148;
|
|
45
|
+
--op-color-alerts-danger-l: 75.2%;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @tokens Alerts Info Colors
|
|
49
|
+
* @presenter Color
|
|
50
|
+
*/
|
|
51
|
+
--op-color-alerts-info-h: 258.5;
|
|
52
|
+
--op-color-alerts-info-c: 0.146;
|
|
53
|
+
--op-color-alerts-info-l: 53.9%;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @tokens Alerts Notice Colors
|
|
57
|
+
* @presenter Color
|
|
58
|
+
*/
|
|
59
|
+
--op-color-alerts-notice-h: 147.4;
|
|
60
|
+
--op-color-alerts-notice-c: 0.166;
|
|
61
|
+
--op-color-alerts-notice-l: 80.4%;
|
|
62
|
+
|
|
63
|
+
/* Shadows */
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @tokens Shadows
|
|
67
|
+
* @presenter Shadow
|
|
68
|
+
*/
|
|
69
|
+
--op-shadow-x-small: 0 1px 2px oklch(0% 0 0 / 3%), 0 1px 3px oklch(0% 0 0 / 15%);
|
|
70
|
+
--op-shadow-small: 0 1px 2px oklch(0% 0 0 / 3%), 0 2px 6px oklch(0% 0 0 / 15%);
|
|
71
|
+
--op-shadow-medium: 0 4px 8px oklch(0% 0 0 / 15%), 0 1px 3px oklch(0% 0 0 / 3%);
|
|
72
|
+
--op-shadow-large: 0 6px 10px oklch(0% 0 0 / 15%), 0 2px 3px oklch(0% 0 0 / 3%);
|
|
73
|
+
--op-shadow-x-large: 0 8px 12px oklch(0% 0 0 / 15%), 0 4px 4px oklch(0% 0 0 / 3%);
|
|
74
|
+
}
|