On 5 Aug 2015, at 13:25, Tom Livingston <[email protected]> wrote:
> IMHO, with regards to the original question, if you are going to use
> the .visuallyhidden rule, you'll probably need to over ride all of
> that, so your "off" rule is needed (as always, it's based on each use
> case). There isn't a 'master off-switch' - although, it would be nice
> wouldn't it? ;-)
Yes, it would!
I've trimmed my rules down as follows (shown as the SASS mixins that they
actually are):
/* MIXINS FOR HIDING
======================================================= */
/* HIDDEN -- Hide from visual AND speaking browsers */
@mixin hidden {
visibility : hidden;
display : none;
}
/* INVISIBLE -- Hide from visual AND speaking browsers but maintain layout */
@mixin invisible {
visibility : hidden;
}
/* VISUALLYHIDDEN -- Hidden, but available to speaking browsers */
@mixin visuallyhidden {
position: absolute;
clip: rect(1px 1px 1px 1px); // for IE
clip: rect(1px, 1px, 1px, 1px);
/* add a '.focusable' class to make VisuallyHidden elements focusable with
keyboard */
&.focusable {
&:active,
&:focus {
@include visuallyunhidden;
}
}
}
/* MIXINS FOR RE-SHOWING
======================================================= */
/* UNHIDDEN -- Reverses the effects of 'hidden' */
@mixin unhidden($display_style: block) {
visibility : visible;
display : $display_style;
}
/* VISUALLYUNHIDDEN -- Reverses the effects of 'visuallyhidden' */
@mixin visuallyunhidden {
position : static;
clip : auto;
}
I did consider adding an opacity:0.1 declaration to visuallyhidden, since the
clipping technique does leave a 1px square visible, but since opacity < 1
introduces a new stacking context I figured it was too much faff.
> Otherwise, you'll need to assess your stance on hiding
> visually/completely based on this discussion and use of ARIA etc. and
> see if you are ready to change your whole philosophy on hiding.
My 'philosophy' on hiding, as you put it, is simply one of 'I don't know'. One
or two people who's views I consider authoritative have said one thing, and one
or two equally authoritative people have said the opposite. I'm really just
poking at the issue to see if I can get enough people to voice an opinion that
maybe a consensus will appear. :-)
--
Rick Lecoat
Designer. Coder. Writer. Curmudgeon.
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/