@pandacss/generator 0.0.0-dev-20240226232256 → 0.0.0-dev-20240227104754

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/index.js CHANGED
@@ -3636,8 +3636,13 @@ var import_core3 = require("@pandacss/core");
3636
3636
  var import_shared4 = require("@pandacss/shared");
3637
3637
  function generateResetCss(ctx, sheet) {
3638
3638
  const { preflight } = ctx.config;
3639
- const scope = (0, import_shared4.isObject)(preflight) ? preflight.scope : void 0;
3640
- const selector = scope ? `${scope} ` : "";
3639
+ const { scope = "", level = "parent" } = (0, import_shared4.isObject)(preflight) ? preflight : {};
3640
+ let selector = "";
3641
+ if (scope && level === "parent") {
3642
+ selector = `${scope} `;
3643
+ } else if (scope && level === "element") {
3644
+ selector = `&${scope}`;
3645
+ }
3641
3646
  const scoped = {
3642
3647
  "*": { margin: "0px", padding: "0px", font: "inherit" },
3643
3648
  "*, *::before, *::after": {
@@ -3728,7 +3733,10 @@ function generateResetCss(ctx, sheet) {
3728
3733
  fontFamily: "var(--global-font-body, var(--font-fallback))"
3729
3734
  }
3730
3735
  };
3731
- if (selector) {
3736
+ if (level === "element") {
3737
+ const modified = (0, import_shared4.mapEntries)(scoped, (k, v) => [k, { [selector]: v }]);
3738
+ Object.assign(reset, modified);
3739
+ } else if (selector) {
3732
3740
  reset[selector] = scoped;
3733
3741
  } else {
3734
3742
  Object.assign(reset, scoped);
package/dist/index.mjs CHANGED
@@ -3597,11 +3597,16 @@ var generateParserCss = (ctx, decoder) => {
3597
3597
 
3598
3598
  // src/artifacts/css/reset-css.ts
3599
3599
  import "@pandacss/core";
3600
- import { isObject } from "@pandacss/shared";
3600
+ import { isObject, mapEntries } from "@pandacss/shared";
3601
3601
  function generateResetCss(ctx, sheet) {
3602
3602
  const { preflight } = ctx.config;
3603
- const scope = isObject(preflight) ? preflight.scope : void 0;
3604
- const selector = scope ? `${scope} ` : "";
3603
+ const { scope = "", level = "parent" } = isObject(preflight) ? preflight : {};
3604
+ let selector = "";
3605
+ if (scope && level === "parent") {
3606
+ selector = `${scope} `;
3607
+ } else if (scope && level === "element") {
3608
+ selector = `&${scope}`;
3609
+ }
3605
3610
  const scoped = {
3606
3611
  "*": { margin: "0px", padding: "0px", font: "inherit" },
3607
3612
  "*, *::before, *::after": {
@@ -3692,7 +3697,10 @@ function generateResetCss(ctx, sheet) {
3692
3697
  fontFamily: "var(--global-font-body, var(--font-fallback))"
3693
3698
  }
3694
3699
  };
3695
- if (selector) {
3700
+ if (level === "element") {
3701
+ const modified = mapEntries(scoped, (k, v) => [k, { [selector]: v }]);
3702
+ Object.assign(reset, modified);
3703
+ } else if (selector) {
3696
3704
  reset[selector] = scoped;
3697
3705
  } else {
3698
3706
  Object.assign(reset, scoped);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "0.0.0-dev-20240226232256",
3
+ "version": "0.0.0-dev-20240227104754",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -37,12 +37,12 @@
37
37
  "pluralize": "8.0.0",
38
38
  "postcss": "8.4.35",
39
39
  "ts-pattern": "5.0.8",
40
- "@pandacss/core": "0.0.0-dev-20240226232256",
41
- "@pandacss/is-valid-prop": "^0.0.0-dev-20240226232256",
42
- "@pandacss/logger": "0.0.0-dev-20240226232256",
43
- "@pandacss/shared": "0.0.0-dev-20240226232256",
44
- "@pandacss/token-dictionary": "0.0.0-dev-20240226232256",
45
- "@pandacss/types": "0.0.0-dev-20240226232256"
40
+ "@pandacss/core": "0.0.0-dev-20240227104754",
41
+ "@pandacss/is-valid-prop": "^0.0.0-dev-20240227104754",
42
+ "@pandacss/logger": "0.0.0-dev-20240227104754",
43
+ "@pandacss/shared": "0.0.0-dev-20240227104754",
44
+ "@pandacss/token-dictionary": "0.0.0-dev-20240227104754",
45
+ "@pandacss/types": "0.0.0-dev-20240227104754"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/pluralize": "0.0.33"