@rokkit/core 1.11.1 → 1.12.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/dist/theme.d.ts +2 -0
- package/package.json +2 -2
- package/src/theme.ts +5 -1
package/dist/theme.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export declare function themeRules(mapping?: Mapping, colors?: Colors, colorSpac
|
|
|
36
36
|
*
|
|
37
37
|
* - `text-on-{name}` → readable text on a z5+ fill
|
|
38
38
|
* - `text-on-{name}-muted` → same on-color (kept for back-compat callers)
|
|
39
|
+
* - `text-on-{name}-soft` → readable text on the role's `-soft` tint: the role darkened toward
|
|
40
|
+
* black (base/message.css's status copy), since the tint stays light in both modes
|
|
39
41
|
*
|
|
40
42
|
* @param {string} name - Color name (e.g., 'primary', 'accent', 'danger')
|
|
41
43
|
* @param {string} [onColor='#fafafa'] - resolved on-color hex for this role
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rokkit/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Contains core utility functions and classes that can be used in various components.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
"ramda": "^0.32.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@rokkit/icons": "1.
|
|
50
|
+
"@rokkit/icons": "1.12.0"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/src/theme.ts
CHANGED
|
@@ -100,6 +100,8 @@ export function themeRules(
|
|
|
100
100
|
*
|
|
101
101
|
* - `text-on-{name}` → readable text on a z5+ fill
|
|
102
102
|
* - `text-on-{name}-muted` → same on-color (kept for back-compat callers)
|
|
103
|
+
* - `text-on-{name}-soft` → readable text on the role's `-soft` tint: the role darkened toward
|
|
104
|
+
* black (base/message.css's status copy), since the tint stays light in both modes
|
|
103
105
|
*
|
|
104
106
|
* @param {string} name - Color name (e.g., 'primary', 'accent', 'danger')
|
|
105
107
|
* @param {string} [onColor='#fafafa'] - resolved on-color hex for this role
|
|
@@ -112,10 +114,12 @@ export function contrastShortcuts(name: string, onColor = '#fafafa') {
|
|
|
112
114
|
// @unocss-skip-start
|
|
113
115
|
const text = ([, end]: string[]) =>
|
|
114
116
|
end ? `text-[color-mix(in_srgb,${color}_${end.slice(1)}%,transparent)]` : `text-[${color}]`
|
|
117
|
+
const onSoft = () => `text-[color-mix(in_oklch,var(--${name})_55%,black)]`
|
|
115
118
|
// @unocss-skip-end
|
|
116
119
|
return [
|
|
117
120
|
[new RegExp(`^text-on-${name}(\\/\\d+)?$`), text],
|
|
118
|
-
[new RegExp(`^text-on-${name}-muted(\\/\\d+)?$`), text]
|
|
121
|
+
[new RegExp(`^text-on-${name}-muted(\\/\\d+)?$`), text],
|
|
122
|
+
[new RegExp(`^text-on-${name}-soft$`), onSoft]
|
|
119
123
|
]
|
|
120
124
|
}
|
|
121
125
|
|