Skip to content

Conversation

@martijnrusschen
Copy link
Member

Summary

  • Moved the sr-only comment from above the .react-datepicker__sr-only selector to inside it
  • This prevents Sass from generating an empty :global {} block in the CSS modules output when compiling datepicker-cssmodules.scss
  • Fixes build failures when using Rolldown Vite with Lightning CSS minification, which throws "SyntaxError: Invalid empty selector"

Root Cause

When the /* sr-only utility class for accessibility */ comment was placed as a standalone comment before the .react-datepicker__sr-only class, Sass would wrap it in its own :global {} block in the CSS modules output:

:global {
  /* sr-only utility class for accessibility */
}

Since a comment doesn't count as actual CSS content, this resulted in an empty selector block that Lightning CSS rejects.

Test plan

  • Verified yarn build completes successfully
  • Verified no empty :global {} blocks in generated CSS modules files
  • All 1448 tests pass

Fixes #5989

🤖 Generated with Claude Code

Moved the sr-only comment from above the selector to inside it to prevent
Sass from generating an empty `:global {}` block in the CSS modules output.
This fixes build failures when using Rolldown Vite with Lightning CSS
minification, which throws "SyntaxError: Invalid empty selector".

Fixes #5989

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.26%. Comparing base (be38873) to head (6b82ecc).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6165   +/-   ##
=======================================
  Coverage   99.26%   99.26%           
=======================================
  Files          30       30           
  Lines        3792     3792           
  Branches     1631     1648   +17     
=======================================
  Hits         3764     3764           
  Misses         27       27           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martijnrusschen martijnrusschen merged commit 40aaff2 into main Dec 18, 2025
6 checks passed
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.

Build fails in Rolldown Vite / Lightning CSS when importing css file

2 participants