Last active
August 29, 2015 14:02
-
-
Save davestacey/d6299d0c27ed97f4713e to your computer and use it in GitHub Desktop.
Scss Visible & invisible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide elements visually, but keep them available for screen-readers. | |
// | |
// Used for information required for screen-reader users to understand and use | |
// the site where visual display is undesirable. Information provided in this | |
// manner should be kept concise, to avoid unnecessary burden on the user. | |
// "!important" is used to prevent unintentional overrides. | |
@mixin element-invisible { | |
position: absolute !important; | |
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ | |
clip: rect(1px, 1px, 1px, 1px); | |
overflow: hidden; | |
height: 1px; | |
} | |
%element-invisible { | |
@include element-invisible; | |
} | |
.invisible { | |
@extend %element-invisible; | |
} | |
// Reverts 'element-invisible'. | |
@mixin element-visible { | |
position: inherit !important; | |
clip: inherit; | |
overflow: inherit; | |
height: inherit; | |
} | |
%element-visible { | |
@include element-visible; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment