react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

@charset rule in CSS causes warning in Vite

Open danieldunderfelt opened this issue 3 years ago • 0 comments

Describe the bug When I import the CSS in my Vite project, it causes a warning about the @charset rule needing to precede all other statements.

To Reproduce Steps to reproduce the behavior:

  1. Start a Vite project
  2. Install React-Datepicker
  3. Render a datepicker and import the CSS file
  4. If the CSS file is not imported as the first thing, Vite throws the warning.

Expected behavior No warning in Vite. It would probably be best to remove the @charset rule since it is unnecessary.

Screenshots image

Additional context The warning points to an unrelated part of our styles, and does not make any sense. It took some time to figure out what the warning was about and track down the @charset rule and where it comes from. This is of course not React-datepicker's problem, just additional context.

I am using Vite 3.0.9, and React-Datepicker is imported through our internal component library. It is thus hard to ensure that the React-datepicker are imported as the absolute first thing.

danieldunderfelt avatar Aug 31 '22 06:08 danieldunderfelt