✨ feat(theme-switcher): hide button if JS is disabled
This commit is contained in:
parent
a4e48b48fd
commit
113a7f4e5d
1
static/no_js.css
Normal file
1
static/no_js.css
Normal file
@ -0,0 +1 @@
|
|||||||
|
.js{display:none}
|
@ -110,6 +110,8 @@
|
|||||||
{%- endif -%}">
|
{%- endif -%}">
|
||||||
|
|
||||||
{%- if config.extra.theme_switcher and config.extra.theme_switcher == true -%}
|
{%- if config.extra.theme_switcher and config.extra.theme_switcher == true -%}
|
||||||
|
{# If JavaScript is disabled, hide the button. #}
|
||||||
|
<noscript><link rel="stylesheet" href="{{ get_url(path='no_js.css') | safe }}"/></noscript>
|
||||||
<script type="text/javascript" src="{{ get_url(path='js/initializeTheme.min.js') | safe }}"></script>
|
<script type="text/javascript" src="{{ get_url(path='js/initializeTheme.min.js') | safe }}"></script>
|
||||||
<script defer src="{{ get_url(path='js/themeSwitcher.min.js', trailing_slash=false) | safe }}"/></script>
|
<script defer src="{{ get_url(path='js/themeSwitcher.min.js', trailing_slash=false) | safe }}"/></script>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
{# Theme switcher #}
|
{# Theme switcher #}
|
||||||
{%- if config.extra.theme_switcher and config.extra.theme_switcher == true -%}
|
{%- if config.extra.theme_switcher and config.extra.theme_switcher == true -%}
|
||||||
<li class="theme-switcher-wrapper">
|
<li class="theme-switcher-wrapper js">
|
||||||
<div class="theme-switcher"></div>
|
<div class="theme-switcher"></div>
|
||||||
</li>
|
</li>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user