unnestcss
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

unnestcss

Unnest CSS.

import { unnest } from "unnestcss";

unnest(`
.a {
  --a: A;
  .b {
    --b: B;
  }
}
`);
/* 
  Chrome 120+= (keep nesting)
  .a {
    --a: A;
    .b {
      --b: B;
    }
  }

  Chrome 120- (unnest)
  .a {
    --a:A;
   }
  .a .b{
    --b:B;
  }
*/

unnest(`
p {
  color: bisque;
  & {
    color: aqua;
  }
} 
`,false)
/* 
  p {
    color: bisque;
  }
  p:is(p) {
    color: aqua;
  }
*/

[MDN] Using CSS nesting

[MDN] Browser Compatibility

Package Sidebar

Install

npm i unnestcss

Weekly Downloads

1

Version

0.0.6

License

MIT

Unpacked Size

15.5 kB

Total Files

16

Last publish

Collaborators

  • startracex