Skip to content

test: update v4 test expectations to match Tailwind's documented CSS flattening - #18

Merged
heidkaemper merged 1 commit into
heidkaemper:mainfrom
andreas-fahrecker:fix-tests
Sep 6, 2026
Merged

heidkaemper merged 1 commit into
heidkaemper:mainfrom
andreas-fahrecker:fix-tests

Conversation

@andreas-fahrecker

Copy link
Copy Markdown
Contributor

Summary

Updates the expected CSS strings in the import directive and
plugin directive test suites (v4) to match Tailwind's documented
selector-flattening behavior. These 4 tests were failing on
unmodified main, unrelated to any other changes.

What was happening

The tests expected nested output, e.g.:

.intersect\:opacity-50 { &:not([no-intersect]) { opacity: 50%; } }

but Tailwind actually produces flat selectors:

.intersect\:opacity-50:not([no-intersect]) { opacity: 50%; }

Per the Tailwind docs on nesting,
Tailwind uses Lightning CSS to flatten nested CSS into flat selectors
so it's understood by all modern browsers, this is expected,
documented behavior, deviating from the expected strings in the tests.

Changes

  • Updated the 4 expected strings in import directive / plugin directive (should add variants, should add arbitrary values)
    to the flat-selector shape Tailwind actually produces.
  • No changes to the test harness, plugin source, or package.json.

Testing

All 6 tests (2 legacy v3, 4 v4) pass locally after this change.

@heidkaemper heidkaemper self-assigned this Sep 6, 2026
@heidkaemper
heidkaemper merged commit ed20c16 into heidkaemper:main Sep 6, 2026
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.

2 participants