mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Add RTL support to Discourse CSS pre-processing using the RTLit gem and configurable via discourse.conf
This commit is contained in:
parent
c1cbf1b269
commit
557af8b8bd
4 changed files with 15 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue