@seyuna/postcss 0.0.1-dev.7 → 0.0.1-dev.8

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.
@@ -0,0 +1,4 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
4
+ }
@@ -1,2 +1,2 @@
1
- import type { AtRule } from "postcss";
1
+ import { type AtRule } from "postcss";
2
2
  export default function dark(atRule: AtRule): void;
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = dark;
4
+ const postcss_1 = require("postcss");
4
5
  function dark(atRule) {
5
- const nestRule = atRule.clone({
6
- name: "nest",
7
- params: `[data-mode="dark"] &`,
6
+ // Create a new nested rule: [data-mode="dark"] & { ... }
7
+ const nestedRule = new postcss_1.Rule({
8
+ selector: `[data-mode="dark"] &`,
9
+ nodes: atRule.nodes, // move children inside
8
10
  });
9
- atRule.replaceWith(nestRule);
11
+ // Replace @dark atRule with the new nested rule
12
+ atRule.replaceWith(nestedRule);
10
13
  }
@@ -1,2 +1,2 @@
1
- import type { AtRule } from "postcss";
1
+ import { type AtRule } from "postcss";
2
2
  export default function light(atRule: AtRule): void;
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = light;
4
+ const postcss_1 = require("postcss");
4
5
  function light(atRule) {
5
- const nestRule = atRule.clone({
6
- name: "nest",
7
- params: `[data-mode="light"] &`,
6
+ // Create a new nested rule: [data-mode="light"] & { ... }
7
+ const nestedRule = new postcss_1.Rule({
8
+ selector: `[data-mode="light"] &`,
9
+ nodes: atRule.nodes, // move children inside
8
10
  });
9
- atRule.replaceWith(nestRule);
11
+ // Replace @light atRule with the new nested rule
12
+ atRule.replaceWith(nestedRule);
10
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seyuna/postcss",
3
- "version": "0.0.1-dev.7",
3
+ "version": "0.0.1-dev.8",
4
4
  "description": "Seyuna UI's postcss plugin",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,9 +1,12 @@
1
- import type { AtRule } from "postcss";
1
+ import { Rule, type AtRule } from "postcss";
2
2
 
3
3
  export default function dark(atRule: AtRule) {
4
- const nestRule = atRule.clone({
5
- name: "nest",
6
- params: `[data-mode="dark"] &`,
4
+ // Create a new nested rule: [data-mode="dark"] & { ... }
5
+ const nestedRule = new Rule({
6
+ selector: `[data-mode="dark"] &`,
7
+ nodes: atRule.nodes, // move children inside
7
8
  });
8
- atRule.replaceWith(nestRule);
9
+
10
+ // Replace @dark atRule with the new nested rule
11
+ atRule.replaceWith(nestedRule);
9
12
  }
@@ -1,9 +1,12 @@
1
- import type { AtRule } from "postcss";
1
+ import { Rule, type AtRule } from "postcss";
2
2
 
3
3
  export default function light(atRule: AtRule) {
4
- const nestRule = atRule.clone({
5
- name: "nest",
6
- params: `[data-mode="light"] &`,
4
+ // Create a new nested rule: [data-mode="light"] & { ... }
5
+ const nestedRule = new Rule({
6
+ selector: `[data-mode="light"] &`,
7
+ nodes: atRule.nodes, // move children inside
7
8
  });
8
- atRule.replaceWith(nestRule);
9
+
10
+ // Replace @light atRule with the new nested rule
11
+ atRule.replaceWith(nestedRule);
9
12
  }