mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Replace R2 gem with rtlcss for generating RTL CSS (#19636)
We've had a couple of problems with the R2 gem where it generated a broken RTL CSS bundle that caused a badly broken layout when Discourse is used in an RTL language, see a3ce93b and 5926386. For this reason, we're replacing R2 with `rtlcss` that can handle modern CSS features better than R2 does. `rltcss` is written in JS and available as an npm package. Calling the `rltcss` from rubyland is done via the `rtlcss_wrapper` gem which contains a distributable copy of the `rtlcss` package and loads/calls it with Mini Racer. See https://github.com/discourse/rtlcss_wrapper for more details. Internal topic: t/76263.
This commit is contained in:
@ -214,4 +214,11 @@ RSpec.describe Stylesheet::Compiler do
|
||||
expect(refs).to eq([])
|
||||
end
|
||||
end
|
||||
|
||||
describe ".compile" do
|
||||
it "produces RTL CSS when rtl option is given" do
|
||||
css, _ = Stylesheet::Compiler.compile("a{right:1px}", "test.scss", rtl: true)
|
||||
expect(css).to eq("a{left:1px}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user