it works fine, but as you might imagine, focusable elements will confuse users (particularly keyboard usesr who like to tab around as a crazy rabbit). Drupal solves it like this:
I like the solution, although i don't like non-semantic classes and I definitely *hate* !important declarations. I thought this would be nice to port to Compass. Feedback?
I dislike !important too. However, in this case, it is being used correctly. We want an "invisible" element to have absolute positioning no matter what CSS is applied to that same element in different rules. Since ".element-invisible" has a very low specificity, almost any CSS rule setting position on that element will break the invisibility.
Also, "element-invisible" _is_ semantic. We're trying to make an HTML element invisible to sighted users, but not make it inaccessible. What would you suggest as a better name?
> it works fine, but as you might imagine, focusable elements will confuse users (particularly keyboard usesr who like to tab around as a crazy rabbit). Drupal solves it like this:
> I like the solution, although i don't like non-semantic classes and I definitely hate !important declarations. I thought this would be nice to port to Compass. Feedback?
> -- > You received this message because you are subscribed to the Google Groups "Compass" group. > To view this discussion on the web visit https://groups.google.com/d/msg/compass-users/-/Dw6JeF_NKRAJ. > To post to this group, send email to compass-users@googlegroups.com. > To unsubscribe from this group, send email to compass-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.
I agree this should be in Compass; I keep ending up copy/pasting the
same mixin to all our projects.
!important would definitely be wise to include, specially for those
who have to "fix" legacy projects in which they have little control
over other selectors used. It isn't pretty, but it gets the job done
in a way that "just works". We don't have to care about semantics for
class names: if the mixin is called "hide" (like we have "hide-text")
that's within Compass' naming pattern and you can include it in any
class name you want.
On Feb 3, 12:25 pm, John Albin Wilkins <johnalbinwilk...@gmail.com>
wrote:
> I dislike !important too. However, in this case, it is being used correctly. We want an "invisible" element to have absolute positioning no matter what CSS is applied to that same element in different rules. Since ".element-invisible" has a very low specificity, almost any CSS rule setting position on that element will break the invisibility.
> Also, "element-invisible" _is_ semantic. We're trying to make an HTML element invisible to sighted users, but not make it inaccessible. What would you suggest as a better name?
> > it works fine, but as you might imagine, focusable elements will confuse users (particularly keyboard usesr who like to tab around as a crazy rabbit). Drupal solves it like this:
> > I like the solution, although i don't like non-semantic classes and I definitely hate !important declarations. I thought this would be nice to port to Compass. Feedback?
> > --
> > You received this message because you are subscribed to the Google Groups "Compass" group.
> > To view this discussion on the web visithttps://groups.google.com/d/msg/compass-users/-/Dw6JeF_NKRAJ.
> > To post to this group, send email to compass-users@googlegroups.com.
> > To unsubscribe from this group, send email to compass-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/compass-users?hl=en.
On Thu, Feb 9, 2012 at 11:34 PM, Roy Tomeij <r...@tomeij.net> wrote: > I agree this should be in Compass; I keep ending up copy/pasting the > same mixin to all our projects.
> !important would definitely be wise to include, specially for those > who have to "fix" legacy projects in which they have little control > over other selectors used. It isn't pretty, but it gets the job done > in a way that "just works". We don't have to care about semantics for > class names: if the mixin is called "hide" (like we have "hide-text") > that's within Compass' naming pattern and you can include it in any > class name you want.
> On Feb 3, 12:25 pm, John Albin Wilkins <johnalbinwilk...@gmail.com> > wrote: > > Hi Capi!
> > I dislike !important too. However, in this case, it is being used > correctly. We want an "invisible" element to have absolute positioning no > matter what CSS is applied to that same element in different rules. Since > ".element-invisible" has a very low specificity, almost any CSS rule > setting position on that element will break the invisibility.
> > Also, "element-invisible" _is_ semantic. We're trying to make an HTML > element invisible to sighted users, but not make it inaccessible. What > would you suggest as a better name?
> > > it works fine, but as you might imagine, focusable elements will > confuse users (particularly keyboard usesr who like to tab around as a > crazy rabbit). Drupal solves it like this:
> > > I like the solution, although i don't like non-semantic classes and I > definitely hate !important declarations. I thought this would be nice to > port to Compass. Feedback?
> > > -- > > > You received this message because you are subscribed to the Google > Groups "Compass" group. > > > To view this discussion on the web visithttps:// > groups.google.com/d/msg/compass-users/-/Dw6JeF_NKRAJ. > > > To post to this group, send email to compass-users@googlegroups.com. > > > To unsubscribe from this group, send email to > compass-users+unsubscribe@googlegroups.com. > > > For more options, visit this group athttp:// > groups.google.com/group/compass-users?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "Compass" group. > To post to this group, send email to compass-users@googlegroups.com. > To unsubscribe from this group, send email to > compass-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/compass-users?hl=en.
> On Thu, Feb 9, 2012 at 11:34 PM, Roy Tomeij <r...@tomeij.net> wrote:
>> I agree this should be in Compass; I keep ending up copy/pasting the >> same mixin to all our projects.
>> !important would definitely be wise to include, specially for those >> who have to "fix" legacy projects in which they have little control >> over other selectors used. It isn't pretty, but it gets the job done >> in a way that "just works". We don't have to care about semantics for >> class names: if the mixin is called "hide" (like we have "hide-text") >> that's within Compass' naming pattern and you can include it in any >> class name you want.
>> On Feb 3, 12:25 pm, John Albin Wilkins <johnalbinwilk...@gmail.com> >> wrote: >> > Hi Capi!
>> > I dislike !important too. However, in this case, it is being used >> correctly. We want an "invisible" element to have absolute positioning no >> matter what CSS is applied to that same element in different rules. Since >> ".element-invisible" has a very low specificity, almost any CSS rule >> setting position on that element will break the invisibility.
>> > Also, "element-invisible" _is_ semantic. We're trying to make an HTML >> element invisible to sighted users, but not make it inaccessible. What >> would you suggest as a better name?
>> > > it works fine, but as you might imagine, focusable elements will >> confuse users (particularly keyboard usesr who like to tab around as a >> crazy rabbit). Drupal solves it like this:
>> > > I like the solution, although i don't like non-semantic classes and I >> definitely hate !important declarations. I thought this would be nice to >> port to Compass. Feedback?
>> > > -- >> > > You received this message because you are subscribed to the Google >> Groups "Compass" group. >> > > To view this discussion on the web visithttps:// >> groups.google.com/d/msg/compass-users/-/Dw6JeF_NKRAJ. >> > > To post to this group, send email to compass-users@googlegroups.com. >> > > To unsubscribe from this group, send email to >> compass-users+unsubscribe@googlegroups.com. >> > > For more options, visit this group athttp:// >> groups.google.com/group/compass-users?hl=en.
>> -- >> You received this message because you are subscribed to the Google Groups >> "Compass" group. >> To post to this group, send email to compass-users@googlegroups.com. >> To unsubscribe from this group, send email to >> compass-users+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/compass-users?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "Compass" group. > To post to this group, send email to compass-users@googlegroups.com. > To unsubscribe from this group, send email to > compass-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/compass-users?hl=en.
The point, John, is not whether it is a semantic classes, but if it is semantic to use a class at all. I can use a dummy selector to hold my 'hide-element' properties:
.-drupal-hide-element {
}
And then whenever I need to hide an element, I'd just extend that class:
nav .title { @extend .-drupal-hide-element;
}
Of course, there is a reason Drupal uses a class: to allow PHP developers to hide elements. It is handy, although non semantic. And Compass users shouldn't deal with the class, just with the mixins :)