Skip to content

Turn on cascade layers for the one target that can take them - #1176

Draft
schickling-assistant wants to merge 1 commit into
schickling-assistant/2026-09-01-pilot-driftfrom
schickling-assistant/2026-09-01-css-layers
Draft

Turn on cascade layers for the one target that can take them#1176
schickling-assistant wants to merge 1 commit into
schickling-assistant/2026-09-01-pilot-driftfrom
schickling-assistant/2026-09-01-css-layers

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Turns cascade layers on for the one target that can take them.

Why this is a per-target option and not a flat flip

Unlayered output was never a preference — it is what lets converted code beat a
utility framework's layered utilities without any ordering work. So
createStylexVitePlugins gains useCSSLayers, defaulting OFF, and only
effect-schema-form-aria's three configs opt in.

This is a correctness constraint, not taste: the factory is shared through the
megarepo pin, so a flat flip inside it would turn layers on for the other consuming repos
which still carry Tailwind and where layered output loses.

The audit, in full

  • Utility framework: none. No package.json in the repo names one.
  • StyleX consumers: exactly one — @overeng/effect-schema-form-aria — plus
    the token package itself.
  • Global stylesheets: five CSS files. Three belong to notion-react, which
    does not use StyleX and never shares a document with it here. One
    (effect-schema-form-aria/src/styles.css) only re-exports the fifth. The
    fifth is @overeng/stylex-tokens/preflight.css.

"Tailwind-free" turned out not to be sufficient, and that is the finding.
The reset was unlayered and sets box-sizing, margin, padding and border
on *. Layered CSS loses to any unlayered CSS, so flipping layers on alone
hands those four properties to the reset on every component — silently, and in
exactly the direction this migration exists to prevent. The general rule the
flip actually needs is that every unlayered global stylesheet in the graph
is layered and ordered; being free of a utility framework says nothing about it.

Evidence that the layered output still wins where it must

Both runs against baseline ff33f7b1b:

  • Negative control — reset left unlayered, layers on: the gate fails
    sixteen stories with DIMENSION mismatches. Components lose their padding
    and borders and collapse. This is the regression the audit caught.
  • Shipped state — reset declared in overeng.reset, named in the compiler's
    before list: 39 compared, 39/39 passed at baseline, 0 changed. The
    layered output renders identically to the unlayered output it replaces.

Ordering is fixed by declaration, not by luck

Naming the reset in before makes the compiler emit
@layer overeng.reset, priority1, ...; ahead of its rules, so the reset sits
below every StyleX priority regardless of which stylesheet the browser parses
first. That is the same "do not depend on bundler injection order" rule the
token layer already follows — this is not another injection-order dependency.

Posted on behalf of @schickling
field value
agent_identity dev3.direct.omp.6xjdfab7
session dev3.6xjdfab7
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.0.11
agent_runtime OMP 18.0.11
tooling_profile dotfiles@5a8d579-dirty

@schickling-assistant schickling-assistant changed the title schickling assistant/2026 09 01 css layers Turn on cascade layers for the one target that can take them Sep 1, 2026
… them

Unlayered output was never a preference. It is what lets converted code beat a
utility framework's layered utilities without any ordering work, which is the
property a migrating target depends on. So `useCSSLayers` is a per-target option
that defaults OFF, and this turns it on for `effect-schema-form-aria` only.
Nothing outside this repo changes, and the other repos must not take this flip
while they still carry Tailwind.

The audit, in full, because it did not come back the way "effect-utils is
Tailwind-free" suggests. No package in the repo declares a utility framework.
Exactly one package uses StyleX, plus the token package itself. Five CSS files
exist: three belong to `notion-react`, which does not use StyleX and never
shares a document with it here; one is a re-export; and the fifth is
`@overeng/stylex-tokens/preflight.css`.

That fifth file is the finding. It was unlayered and it sets `box-sizing`,
`margin`, `padding` and `border` on `*`. Layered CSS loses to ANY unlayered CSS,
so flipping layers on without touching it hands those four properties to the
reset on every component in the package — the exact silent regression the
migration exists to prevent, arriving through the change meant to clean the
cascade up.

Measured rather than argued. With the reset left unlayered, the gate fails
sixteen stories with DIMENSION mismatches — every component loses its padding
and borders and collapses. With the reset declared in `overeng.reset` and named
in the compiler's `before` list, the gate is 39 compared, 39/39 passed at
baseline, 0 changed: the layered output renders identically to the unlayered
output it replaces.

The ordering is fixed by declaration, not by luck. Naming the reset in `before`
makes the compiler emit `@layer overeng.reset, priority1, ...;` ahead of its
rules, so the reset sits below every StyleX priority regardless of which
stylesheet the browser parses first — the same rule the token layer already
follows, and the reason this is not another bundler-injection-order dependency.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Storybook Previews

Subject Status Report Details Updated
react-inspector success react-inspector preview deployed Preview is ready 2026-09-01 22:10 UTC
effect-react success effect-react preview deployed Preview is ready 2026-09-01 22:10 UTC
notion-md success notion-md preview deployed Preview is ready 2026-09-01 22:10 UTC
genie success genie preview deployed Preview is ready 2026-09-01 22:10 UTC
effect-schema-form-aria success effect-schema-form-aria preview deployed Preview is ready 2026-09-01 22:10 UTC
tui-react success tui-react preview deployed Preview is ready 2026-09-01 22:10 UTC
notion-cli success notion-cli preview deployed Preview is ready 2026-09-01 22:10 UTC
notion-react success notion-react preview deployed Preview is ready 2026-09-01 22:10 UTC
megarepo success megarepo preview deployed Preview is ready 2026-09-01 22:10 UTC
Report history

PR 1176 · 2026-09-01 22:12 UTC

Subject Status Report Details Updated
react-inspector success react-inspector preview deployed Preview is ready 2026-09-01 22:10 UTC
effect-react success effect-react preview deployed Preview is ready 2026-09-01 22:10 UTC
notion-md success notion-md preview deployed Preview is ready 2026-09-01 22:10 UTC
genie success genie preview deployed Preview is ready 2026-09-01 22:10 UTC
effect-schema-form-aria success effect-schema-form-aria preview deployed Preview is ready 2026-09-01 22:10 UTC
tui-react success tui-react preview deployed Preview is ready 2026-09-01 22:10 UTC
notion-cli success notion-cli preview deployed Preview is ready 2026-09-01 22:10 UTC
notion-react success notion-react preview deployed Preview is ready 2026-09-01 22:10 UTC
megarepo success megarepo preview deployed Preview is ready 2026-09-01 22:10 UTC

PR 1176 · 2026-09-01 22:05 UTC

Subject Status Report Details Updated
genie success genie preview deployed Preview is ready 2026-09-01 22:04 UTC
react-inspector success react-inspector preview deployed Preview is ready 2026-09-01 22:04 UTC
effect-react success effect-react preview deployed Preview is ready 2026-09-01 22:04 UTC
effect-schema-form-aria success effect-schema-form-aria preview deployed Preview is ready 2026-09-01 22:04 UTC
notion-cli success notion-cli preview deployed Preview is ready 2026-09-01 22:04 UTC
notion-md success notion-md preview deployed Preview is ready 2026-09-01 22:04 UTC
tui-react success tui-react preview deployed Preview is ready 2026-09-01 22:04 UTC
notion-react success notion-react preview deployed Preview is ready 2026-09-01 22:04 UTC
megarepo success megarepo preview deployed Preview is ready 2026-09-01 22:04 UTC

@schickling-assistant
schickling-assistant force-pushed the schickling-assistant/2026-09-01-css-layers branch from 9c518c1 to 01dc4c2 Compare September 1, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant