mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add RTL support to Discourse CSS pre-processing using the RTLit gem and configurable via discourse.conf
This commit is contained in:
@@ -49,7 +49,7 @@ class DiscourseSassCompiler
|
||||
style: :expanded
|
||||
}
|
||||
|
||||
::Sass::Engine.new(@scss, {
|
||||
css = ::Sass::Engine.new(@scss, {
|
||||
syntax: :scss,
|
||||
cache: false,
|
||||
read_cache: false,
|
||||
@@ -60,6 +60,14 @@ class DiscourseSassCompiler
|
||||
environment: context.environment
|
||||
}
|
||||
}.merge(debug_opts)).render
|
||||
|
||||
# Check if CSS needs to be RTLed after compilation
|
||||
# and run RTLit gem on compiled CSS if true and RTLit gem is available
|
||||
if GlobalSetting.rtl_css && defined?(RTLit)
|
||||
RTLit::Converter.to_rtl(css)
|
||||
else
|
||||
css
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user