mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 11:21:41 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user