@pandacss/core
Advanced tools
Comparing version 0.0.0-dev-20221219112004 to 0.0.0-dev-20221219162854
@@ -592,2 +592,4 @@ "use strict"; | ||
var import_postcss_discard_duplicates = __toESM(require("postcss-discard-duplicates")); | ||
var import_postcss_discard_empty = __toESM(require("postcss-discard-empty")); | ||
var import_postcss_merge_rules = __toESM(require("postcss-merge-rules")); | ||
var import_postcss_nested2 = __toESM(require("postcss-nested")); | ||
@@ -613,2 +615,24 @@ var import_postcss_normalize_whitespace = __toESM(require("postcss-normalize-whitespace")); | ||
// src/plugins/prettify.ts | ||
function prettifyNode(node, indent = 0) { | ||
node.each && node.each((child, i) => { | ||
if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes("\n")) { | ||
child.raws.before = ` | ||
${node.type !== "rule" && i > 0 ? "\n" : ""}${" ".repeat(indent)}`; | ||
} | ||
child.raws.after = ` | ||
${" ".repeat(indent)}`; | ||
prettifyNode(child, indent + 1); | ||
}); | ||
} | ||
function prettify() { | ||
return (root) => { | ||
prettifyNode(root); | ||
if (root.first) { | ||
root.first.raws.before = ""; | ||
} | ||
}; | ||
} | ||
prettify.postcssPlugin = "panda-prettify"; | ||
// src/plugins/sort-mq.ts | ||
@@ -646,24 +670,2 @@ var import_sort_css_media_queries = __toESM(require("sort-css-media-queries")); | ||
// src/plugins/prettify.ts | ||
function prettifyNode(node, indent = 0) { | ||
node.each && node.each((child, i) => { | ||
if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes("\n")) { | ||
child.raws.before = ` | ||
${node.type !== "rule" && i > 0 ? "\n" : ""}${" ".repeat(indent)}`; | ||
} | ||
child.raws.after = ` | ||
${" ".repeat(indent)}`; | ||
prettifyNode(child, indent + 1); | ||
}); | ||
} | ||
function prettify() { | ||
return (root) => { | ||
prettifyNode(root); | ||
if (root.first) { | ||
root.first.raws.before = ""; | ||
} | ||
}; | ||
} | ||
prettify.postcssPlugin = "panda-prettify"; | ||
// src/optimize.ts | ||
@@ -676,2 +678,4 @@ function optimizeCss(code, { minify = false } = {}) { | ||
(0, import_postcss_discard_duplicates.default)(), | ||
(0, import_postcss_merge_rules.default)(), | ||
(0, import_postcss_discard_empty.default)(), | ||
minify ? (0, import_postcss_normalize_whitespace.default)() : prettify() | ||
@@ -1163,3 +1167,3 @@ ]).process(code); | ||
Object.entries(rule.properties).forEach(([property, values]) => { | ||
const computedValues = typeof values === "boolean" ? ctx.getPropertyKeys(property) : values; | ||
const computedValues = values.flatMap((value) => value === "*" ? ctx.getPropertyKeys(property) : value); | ||
computedValues.forEach((value) => { | ||
@@ -1190,3 +1194,4 @@ const conditionalValues = conditions.reduce( | ||
return; | ||
values.forEach((value) => { | ||
const computedValues = values.flatMap((value) => value === "*" ? ctx.getRecipeKeys(recipe)[variant] : value); | ||
computedValues.forEach((value) => { | ||
const conditionalValues = conditions.reduce( | ||
@@ -1193,0 +1198,0 @@ (acc, condition) => ({ |
{ | ||
"name": "@pandacss/core", | ||
"version": "0.0.0-dev-20221219112004", | ||
"version": "0.0.0-dev-20221219162854", | ||
"description": "core functions for extract-it", | ||
@@ -21,16 +21,18 @@ "main": "dist/index.js", | ||
"sort-css-media-queries": "^2.1.0", | ||
"postcss-discard-empty": "^5.1.1", | ||
"postcss-normalize-whitespace": "^5.1.1", | ||
"postcss-discard-duplicates": "^5.1.0", | ||
"postcss-merge-rules": "^5.1.3", | ||
"autoprefixer": "10.4.13", | ||
"ts-pattern": "4.0.6", | ||
"lodash.merge": "4.6.2", | ||
"@pandacss/error": "0.0.0-dev-20221219112004", | ||
"@pandacss/types": "0.0.0-dev-20221219112004", | ||
"@pandacss/shared": "0.0.0-dev-20221219112004", | ||
"@pandacss/logger": "0.0.0-dev-20221219112004", | ||
"@pandacss/token-dictionary": "0.0.0-dev-20221219112004" | ||
"@pandacss/error": "0.0.0-dev-20221219162854", | ||
"@pandacss/types": "0.0.0-dev-20221219162854", | ||
"@pandacss/shared": "0.0.0-dev-20221219162854", | ||
"@pandacss/logger": "0.0.0-dev-20221219162854", | ||
"@pandacss/token-dictionary": "0.0.0-dev-20221219162854" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash.merge": "4.6.7", | ||
"@pandacss/fixture": "0.0.0-dev-20221219112004" | ||
"@pandacss/fixture": "0.0.0-dev-20221219162854" | ||
}, | ||
@@ -37,0 +39,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
80201
2611
16
+ Addedpostcss-discard-empty@^5.1.1
+ Addedpostcss-merge-rules@^5.1.3
+ Added@pandacss/error@0.0.0-dev-20221219162854(transitive)
+ Added@pandacss/logger@0.0.0-dev-20221219162854(transitive)
+ Added@pandacss/shared@0.0.0-dev-20221219162854(transitive)
+ Added@pandacss/token-dictionary@0.0.0-dev-20221219162854(transitive)
+ Added@pandacss/types@0.0.0-dev-20221219162854(transitive)
+ Addedcaniuse-api@3.0.0(transitive)
+ Addedcssnano-utils@3.1.0(transitive)
+ Addedlodash.memoize@4.1.2(transitive)
+ Addedlodash.uniq@4.5.0(transitive)
+ Addedpostcss-discard-empty@5.1.1(transitive)
+ Addedpostcss-merge-rules@5.1.4(transitive)
- Removed@pandacss/error@0.0.0-dev-20221219112004(transitive)
- Removed@pandacss/logger@0.0.0-dev-20221219112004(transitive)
- Removed@pandacss/shared@0.0.0-dev-20221219112004(transitive)
- Removed@pandacss/token-dictionary@0.0.0-dev-20221219112004(transitive)
- Removed@pandacss/types@0.0.0-dev-20221219112004(transitive)