mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add css classes to stylesheet link elements (#10598)
Adding these classes to the stylesheet link elements in order to toggle dark/light schemes via this theme-component. Eventually this theme-component could possible be merged into core.
This commit is contained in:
parent
726bae8f0c
commit
e73ff68f75
@ -135,7 +135,10 @@ class Stylesheet::Manager
|
|||||||
return '' if !stylesheet
|
return '' if !stylesheet
|
||||||
|
|
||||||
href = stylesheet[:new_href]
|
href = stylesheet[:new_href]
|
||||||
%[<link href="#{href}" media="#{media}" rel="stylesheet"/>].html_safe
|
|
||||||
|
css_class = media == 'all' ? "light-scheme" : "dark-scheme"
|
||||||
|
|
||||||
|
%[<link href="#{href}" media="#{media}" rel="stylesheet" class="#{css_class}"/>].html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.color_scheme_cache_key(color_scheme, theme_id = nil)
|
def self.color_scheme_cache_key(color_scheme, theme_id = nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user