DEV: Introduce postcss for autoprefix and light-dark() polyfill (#31393)

Introduces PostCSS at the end of our CSS compilation pipeline. For now,
just adds autoprefixer and light-dark polyfill.
This commit is contained in:
David Taylor
2025-02-20 14:40:27 +00:00
committed by GitHub
parent 1b33a9900f
commit 087e8e4bdb
11 changed files with 273 additions and 44 deletions

View File

@ -231,5 +231,19 @@ RSpec.describe Stylesheet::Compiler do
css, _ = Stylesheet::Compiler.compile("a{right:1px}", "test.scss", rtl: true)
expect(css).to eq("a{left:1px}")
end
it "runs through postcss" do
css, map = Stylesheet::Compiler.compile(<<~SCSS, "test.scss")
@media (min-resolution: 2dppx) {
body {
background-color: light-dark(white, black);
}
}
SCSS
expect(css).to include("-webkit-min-device-pixel-ratio")
expect(css).to include("csstools-light-dark-toggle")
expect(map.size).to be > 10
end
end
end