Skip to content
Snippets Groups Projects
Commit ebe86093 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Add js or no-js class to html tag.

parent 0a5950c0
No related branches found
No related tags found
No related merge requests found
......@@ -104,8 +104,8 @@
}
};
// remove no-js class if js is enabled
document.querySelector('html').classList.remove('no-js');
// Replace no-js with js class if js is enabled.
document.querySelector('html').classList.replace('no-js', 'js');
$(MobileMenu.selector()).each((index, el) => {
new MobileMenu($(el), $('.js-mobile-menu-close'), $('.header__menus--mobile'), $('.header__search'));
......
......@@ -80,6 +80,20 @@ ol {
display: none;
}
.js-hidden,
%js-hidden {
html.js & {
@extend %is-hidden;
}
}
.no-js-hidden,
%no-js-hidden {
html.nojs & {
@extend %is-hidden;
}
}
.is-unhidden,
%is-unhidden {
display: block;
......
......@@ -74,11 +74,26 @@ ol {
transition: opacity, z-index, $transition;
}
.hidden,
.is-hidden,
%is-hidden {
display: none;
}
.js-hidden,
%js-hidden {
html.js & {
@extend %is-hidden;
}
}
.no-js-hidden,
%no-js-hidden {
html.nojs & {
@extend %is-hidden;
}
}
.is-unhidden,
%is-unhidden {
display: block;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment