Closed aweiu closed 8 months ago
input:
/* no theme */ :root { --bgColor: red; } /* light theme */ @media (prefers-color-scheme: light) { :root { --bgColor: yellow; } } /* dark theme */ @media (prefers-color-scheme: dark) { :root { --bgColor: blue; } }
expect output:
/* no theme */ :root { --bgColor: red; } /* light theme */ :root[data-theme="light"] { --bgColor: yellow; } /* dark theme */ :root[data-theme="light"] { --bgColor: yellow; }
real output:
/* no theme */ :root { --bgColor: red; } /* light theme */ @media (prefers-color-scheme: light) { :root { --bgColor: yellow; } } /* dark theme */ @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bgColor: blue; } } :root[data-theme="dark"] { --bgColor: blue; }
Good idea! Can you send a pull request to save your name in the project history?
input:
expect output:
real output: