vanilla-extract-css / vanilla-extract

Zero-runtime Stylesheets-in-TypeScript

Home Page:https://vanilla-extract.style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty layer definition duplicated

levrik opened this issue · comments

Describe the bug

Empty layer definitions not only get added for globalLayer(...) but also when using them inside style(...).

At first I thought that this will change the order of layers but after refreshing my knowledge only the first occurence defines the order so that's okay. Still this behavior is unexpected and I would only expect the empty declarations to be created by globalLayer(...) and not implicitly by style(...) as well.

It does not happen when globalLayer(...) and the usage of the layer inside style(...) are in the same file.

Reproduction

https://codesandbox.io/p/devbox/funny-shtern-95ykmj?file=%2Fdist%2Fmain.css&workspaceId=cf852eb1-d673-4ef5-b3db-9b4a4bbf8155

System Info

System:
  OS: macOS 13.6.4
  CPU: (8) arm64 Apple M1 Pro
  Memory: 65.86 MB / 16.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 18.19.0 - /opt/homebrew/opt/node@18/bin/node
  Yarn: 1.22.19 - /opt/homebrew/bin/yarn
  npm: 10.2.3 - /opt/homebrew/opt/node@18/bin/npm
  pnpm: 8.15.4 - ~/Library/pnpm/pnpm
Browsers:
  Safari: 17.3.1
npmPackages:
  @vanilla-extract/css: 1.14.1 => 1.14.1 
  @vanilla-extract/recipes: 0.5.1 => 0.5.1 
  @vanilla-extract/webpack-plugin: 2.3.6 => 2.3.6

Used Package Manager

pnpm

Logs

No response

Validations