diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 14 | ||||
-rwxr-xr-x | app/views/layouts/application.html.haml | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 327901e4e..9eb042938 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -27,11 +27,6 @@ module ApplicationHelper Setting.open_deletion end - def add_rtl_body_class(other_classes) - other_classes = "#{other_classes} rtl" if locale_direction == 'rtl' - other_classes - end - def locale_direction if [:ar, :fa, :he].include?(I18n.locale) 'rtl' @@ -77,4 +72,13 @@ module ApplicationHelper def react_component(name, props = {}) content_tag(:div, nil, data: { component: name.to_s.camelcase, props: Oj.dump(props) }) end + + def body_classes + output = (@body_classes || '').split(' ') + output << "theme-#{current_theme.parameterize}" + output << 'system-font' if current_account&.user&.setting_system_font_ui + output << current_account&.user&.setting_reduce_motion ? 'reduce-motion' : 'no-reduce-motion' + output << 'rtl' if locale_direction == 'rtl' + output.reject(&:blank?).join(' ') + end end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 68a903197..436864237 100755 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -24,9 +24,5 @@ = yield :header_tags - - body_classes ||= @body_classes || '' - - body_classes += ' system-font' if current_account&.user&.setting_system_font_ui - - body_classes += current_account&.user&.setting_reduce_motion ? ' reduce-motion' : ' no-reduce-motion' - - %body{ class: add_rtl_body_class(body_classes) } + %body{ class: body_classes } = content_for?(:content) ? yield(:content) : yield |