comark-colors 0.8.0 → 0.8.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/dist/client.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as css } from "./styles-
|
|
2
|
-
import { t as addStyles } from "./client-
|
|
1
|
+
import { t as css } from "./styles-B1MZYd1F.mjs";
|
|
2
|
+
import { t as addStyles } from "./client-BoNiDu4Z.mjs";
|
|
3
3
|
export { addStyles, css };
|
package/dist/html.mjs
CHANGED
package/dist/react.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as src_default, t as isColor } from "./src-CGLpBNQy.mjs";
|
|
2
|
-
import { t as addStyles } from "./client-
|
|
2
|
+
import { t as addStyles } from "./client-BoNiDu4Z.mjs";
|
|
3
3
|
import { createElement, useEffect } from "react";
|
|
4
4
|
//#region src/react.ts
|
|
5
5
|
/** A color in inline code, or a line of a `::palette`, for `@comark/react`. */
|
|
@@ -74,6 +74,29 @@ const groups = {
|
|
|
74
74
|
"#60a5fa"
|
|
75
75
|
]
|
|
76
76
|
}),
|
|
77
|
+
primary: [
|
|
78
|
+
[
|
|
79
|
+
"primary",
|
|
80
|
+
"ui-primary",
|
|
81
|
+
"primary",
|
|
82
|
+
"var(--_comark-foreground)",
|
|
83
|
+
"var(--_comark-foreground)"
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
"primary-foreground",
|
|
87
|
+
"ui-text-inverted",
|
|
88
|
+
"primary-foreground",
|
|
89
|
+
"var(--_comark-background)",
|
|
90
|
+
"var(--_comark-background)"
|
|
91
|
+
],
|
|
92
|
+
[
|
|
93
|
+
"secondary",
|
|
94
|
+
"ui-secondary",
|
|
95
|
+
"",
|
|
96
|
+
"var(--_comark-muted)",
|
|
97
|
+
"var(--_comark-muted)"
|
|
98
|
+
]
|
|
99
|
+
],
|
|
77
100
|
shadow: [[
|
|
78
101
|
"shadow",
|
|
79
102
|
"",
|
|
@@ -94,14 +117,16 @@ const resolve = (list, scheme) => list.map((token) => `--_comark-${token[0]}:${c
|
|
|
94
117
|
* They resolve on the component rather than `:root`, so a `.dark` class anywhere above it switches the theme, and a
|
|
95
118
|
* `--comark-*` set on any ancestor still inherits down. `:where()` keeps them at zero specificity.
|
|
96
119
|
*
|
|
97
|
-
* Every block gets the core tokens. Name `"status"` for `--comark-success`, `-danger`, `-warning`, and `-info`,
|
|
98
|
-
* `"
|
|
120
|
+
* Every block gets the core tokens. Name `"status"` for `--comark-success`, `-danger`, `-warning`, and `-info`,
|
|
121
|
+
* `"primary"` for `--comark-primary`, `-primary-foreground`, and `-secondary`, and `"shadow"` for `--comark-shadow`, so
|
|
122
|
+
* a block that never draws them doesn't carry them.
|
|
99
123
|
*/
|
|
100
124
|
function theme(selector, ...extras) {
|
|
101
125
|
const where = `:where(${selector})`;
|
|
102
126
|
const added = extras.flatMap((name) => groups[name]);
|
|
103
127
|
const list = [...tokens, ...added];
|
|
104
|
-
const
|
|
128
|
+
const schemed = added.filter((token) => token[3] !== token[4]);
|
|
129
|
+
const classes = schemed.length ? `:where(.light,.light *)${where}{${resolve(schemed, 3)}}:where(.dark,.dark *)${where}{${resolve(schemed, 4)}}` : "";
|
|
105
130
|
return `${where}{${resolve(list, 3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,calc(var(--radius,.625rem)/2))*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}@media (prefers-color-scheme:dark){${where}{${resolve(list, 4)}}}` + classes;
|
|
106
131
|
}
|
|
107
132
|
//#endregion
|
package/dist/vue.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as src_default, t as isColor } from "./src-CGLpBNQy.mjs";
|
|
2
|
-
import { t as addStyles } from "./client-
|
|
2
|
+
import { t as addStyles } from "./client-BoNiDu4Z.mjs";
|
|
3
3
|
import { defineComponent, h, onMounted } from "vue";
|
|
4
4
|
//#region src/vue.ts
|
|
5
5
|
/** A color in inline code, or a line of a `::palette`, for `@comark/vue`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comark-colors",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Color swatches next to inline code that holds a color, like GitLab, and ::palette grids of named colors. A Comark plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"color",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react-dom": "^19.3.1",
|
|
57
57
|
"svelte": "^5.57.2",
|
|
58
58
|
"vue": "^3.5.44",
|
|
59
|
-
"comark-zoom": "0.8.
|
|
59
|
+
"comark-zoom": "0.8.1"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@comark/html": "^0.8.0",
|