transform: translate($horizontal,$vertical)
}
+// @mixins
+//
+// Makes an element visually hidden, but accessible.
+// @see http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
+@mixin element-invisible {
+ position: absolute !important;
+ height: 1px;
+ width: 1px;
+ overflow: hidden;
+ clip: rect(1px, 1px, 1px, 1px);
+}
+
+// @mixins
+//
+// Turns off the element-invisible effect.
+@mixin element-invisible-off {
+ position: static !important;
+ height: auto;
+ width: auto;
+ overflow: visible;
+ clip: auto;
+}
+
// We use these to control various global styles
$body-bg: #fff !default;
$body-font-color: #222 !default;
$topbar-sticky-class: ".sticky" !default;
$topbar-arrows: true !default; //Set false to remove the triangle icon from the menu item
+// Accessibility mixins for hiding and showing the menu dropdown items
+@mixin topbar-hide-dropdown {
+ // Makes an element visually hidden by default, but visible when focused.
+ display: block;
+ @include element-invisible();
+}
+
+@mixin topbar-show-dropdown {
+ display: block;
+ @include element-invisible-off();
+ position: absolute !important; // Reset the position from static to absolute
+}
+
@include exports("top-bar") {
// Used to provide media query values for javascript components.
// This class is generated despite the value of $include-html-top-bar-classes
&.moved { position: static;
& > .dropdown {
- display: block;
+ @include topbar-show-dropdown();
+ width: 100%;
}
& > a:after {
display: none;
position: absolute;
#{$default-float}: 100%;
top: 0;
- display: none;
z-index: 99;
+ @include topbar-hide-dropdown();
li {
width: 100%;
}
&.moved { position: relative;
- & > .dropdown { display: none; }
+ & > .dropdown {
+ @include topbar-hide-dropdown();
+ }
}
&.hover, &.not-click:hover {
& > .dropdown {
- display: block;
+ @include topbar-show-dropdown();
}
}
border: none;
content: "\00bb";
top: 1rem;
- margin-top: -2px;
+ margin-top: -7px;
#{$opposite-direction}: 5px;
line-height: 1.2;
}
.has-dropdown {
&:hover {
& > .dropdown {
- display: block;
+ @include topbar-show-dropdown();
}
}
}