You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While attempting to use @layers with Vanilla Extract and [email protected] (pages dir), ordering of initial @layers seems to be unstable, defeating the purpose of the cascade layers.
The code in the minimal repro was my initial attempt to add 3 layers, and assign them to my reset, component framework, and a third layer (dummy in the repro, so I could observe what's happening) as it made sense to me.
I have followed this logic
Created layers.css.ts to define the layer ordering and exported them as suggested by the docs
Imported the reset layer to the reset.css.ts and added it to the reset styles
Imported the framework layer and added it to the styles for the framework components
While working under next dev, everything seemed fine, as there is a separate style tag containing the contents of layers.css.ts with proper ordering, and then separate style tags which contain contents of other css.ts files.
Running next build and next start, the layer order is broken, as the layers.css.ts and reset.css.ts seem to be combined in a single file resulting in the @layer reset being removed from the initial order. To me, it seems like it's being deduplicated in favor of the declaration in the reset.css.ts, resulting in out of order layers.
I've also tried and observed the following:
Importing layers.css.ts explicitly in _app.tsx before the reset.css.ts
No effect
Importing reset.css.ts in the page, instead of the _app.tsx.
Layers are "deduplicated" and ordered depending on the import order. Also unpractical.
Using layer instead of globalLayer
No effect
Created some dummy styles within layers.css.ts for each layer
Describe the bug
While attempting to use
@layer
s with Vanilla Extract and[email protected]
(pages dir), ordering of initial@layer
s seems to be unstable, defeating the purpose of the cascade layers.The code in the minimal repro was my initial attempt to add 3 layers, and assign them to my reset, component framework, and a third layer (
dummy
in the repro, so I could observe what's happening) as it made sense to me.I have followed this logic
layers.css.ts
to define the layer ordering and exported them as suggested by the docsreset
layer to thereset.css.ts
and added it to the reset stylesframework
layer and added it to the styles for the framework componentsWhile working under
next dev
, everything seemed fine, as there is a separatestyle
tag containing the contents oflayers.css.ts
with proper ordering, and then separatestyle
tags which contain contents of othercss.ts
files.Running
next build
andnext start
, the layer order is broken, as thelayers.css.ts
andreset.css.ts
seem to be combined in a single file resulting in the@layer reset
being removed from the initial order. To me, it seems like it's being deduplicated in favor of the declaration in thereset.css.ts
, resulting in out of order layers.I've also tried and observed the following:
layers.css.ts
explicitly in_app.tsx
before thereset.css.ts
reset.css.ts
in the page, instead of the_app.tsx
.layer
instead ofglobalLayer
layers.css.ts
for each layer@layer <layer>
declarations are "deduplicated"Reproduction
https://github.com/Tenga/ve-layers-repro
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: