mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: WCAG compliant color schemes (#10882)
Co-authored-by: Kris <kris.aubuchon@discourse.org>
This commit is contained in:
@@ -22,6 +22,7 @@ module Stylesheet
|
||||
|
||||
if asset.to_s == Stylesheet::Manager::COLOR_SCHEME_STYLESHEET
|
||||
file += Stylesheet::Importer.import_color_definitions(options[:theme_id])
|
||||
file += Stylesheet::Importer.import_wcag_overrides(options[:color_scheme_id])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -191,6 +191,13 @@ module Stylesheet
|
||||
contents
|
||||
end
|
||||
|
||||
def self.import_wcag_overrides(color_scheme_id)
|
||||
if color_scheme_id && ColorScheme.find_by_id(color_scheme_id)&.is_wcag?
|
||||
return "@import \"wcag\";"
|
||||
end
|
||||
""
|
||||
end
|
||||
|
||||
def initialize(options)
|
||||
@theme = options[:theme]
|
||||
@theme_id = options[:theme_id]
|
||||
|
||||
Reference in New Issue
Block a user