UX: make 404 page look better on dark theme

This commit is contained in:
Arpit Jalan 2017-08-15 12:15:56 +05:30
parent dd665c62f2
commit 7e9b2289bd
1 changed files with 4 additions and 11 deletions

View File

@ -77,27 +77,20 @@ module CategoryBadge
description = category.description_text ? "title='#{category.description_text.html_safe}'" : ''
category_url = opts[:absolute_url] ? "#{Discourse.base_url_no_prefix}#{category.url}" : category.url
text_color =
if (SiteSetting.category_style || :box).to_sym == :box
"##{category.text_color}"
else
"#222222"
end
extra_span_classes =
if opts[:inline_style]
case (SiteSetting.category_style || :box).to_sym
when :bar
'padding: 3px; vertical-align: text-top; margin-top: -3px; display: inline-block;'
'color: #222222; padding: 3px; vertical-align: text-top; margin-top: -3px; display: inline-block;'
when :box
"#{show_parent ? 'margin-left: 5px; ' : ''} position: relative; padding: 0 5px; margin-top: 2px;"
"color: #{category.text_color}; #{show_parent ? 'margin-left: 5px; ' : ''} position: relative; padding: 0 5px; margin-top: 2px;"
when :bullet
'vertical-align: text-top; line-height: 1; margin-left: 4px; padding-left: 2px; display: inline;'
'color: #222222; vertical-align: text-top; line-height: 1; margin-left: 4px; padding-left: 2px; display: inline;'
end + 'max-width: 150px; overflow: hidden; text-overflow: ellipsis;'
else
''
end
result << "<span style='color: #{text_color};#{extra_span_classes}' data-drop-close='true' class='#{class_names}'
result << "<span style='#{extra_span_classes}' data-drop-close='true' class='#{class_names}'
#{description}>"
result << category.name.html_safe << '</span>'