@pairdraw/dom-css 0.16.1 → 0.17.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/chunks/behaviours/states/layers.js +8 -1
- package/dist/chunks/behaviours/states/layers.js.map +1 -1
- package/dist/chunks/behaviours/states/tailwind.js +16 -3
- package/dist/chunks/behaviours/states/tailwind.js.map +1 -1
- package/dist/chunks/browser.js +28 -2
- package/dist/chunks/browser.js.map +1 -1
- package/dist/chunks/export/bundle.js +7 -1
- package/dist/chunks/export/bundle.js.map +1 -1
- package/dist/chunks/import/html.js +103 -44
- package/dist/chunks/import/html.js.map +1 -1
- package/package.json +3 -3
- package/src/export/bundle.ts +7 -1
- package/src/export/html.ts +19 -2
- package/src/import/jsx/core.ts +30 -5
- package/src/import/scene-graph.ts +2 -1
- package/src/runtime/headless/styles.ts +142 -64
- package/src/tokens/stylesheet.ts +9 -1
|
@@ -476,8 +476,15 @@ function modeValue(variable, value, modeId, names, variables) {
|
|
|
476
476
|
function block(selector, declarations, indent = "") {
|
|
477
477
|
return `${indent}${selector} {\n${declarations.map(({ name, value }) => `${indent} --${name}: ${value};`).join("\n")}\n${indent}}`;
|
|
478
478
|
}
|
|
479
|
+
/**
|
|
480
|
+
* A comment naming `text`. Collection and mode names are the person's own text, so a `*` before
|
|
481
|
+
* a `/` in them is spaced apart, which keeps a name from ending the comment and writing rules.
|
|
482
|
+
*/
|
|
483
|
+
function cssComment(text) {
|
|
484
|
+
return `/* ${text.replaceAll("*/", "* /")} */`;
|
|
485
|
+
}
|
|
479
486
|
function modeBlock(scope) {
|
|
480
|
-
const comment =
|
|
487
|
+
const comment = cssComment(`${scope.collection.name}: ${scope.mode.name}`);
|
|
481
488
|
if (!isAtRuleCondition(scope.condition)) return `${comment}\n${block(scope.condition, scope.declarations)}`;
|
|
482
489
|
return `${comment}\n${scope.condition} {\n${block(":root", scope.declarations, " ")}\n}`;
|
|
483
490
|
}
|