I'm sharing my oocss file. Just want to know your opinion
--
You received this message because you are subscribed to the Google Groups "Object Oriented CSS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/object-oriented-css/-/DRIpdIyAPnAJ.
To post to this group, send email to object-or...@googlegroups.com.
To unsubscribe from this group, send email to object-oriented...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/object-oriented-css?hl=en.
.button.admin
Besides, you don't really need to be that specific as you're only
using .admin to extend button. If you're worried that .admin may be
used for something else then it could be safer to, "namespace" your
class:
.button{padding:5px 10px;white-space:nowrap}
/*extend button */
.button-admin{background-color:#A52A2A;color:white}
Then your html can be like this:
<a class="button button-admin" href="">Admin</a>
or
<button class="button button-admin" type="submit">Admin</button>
Murray.
On Wed, Sep 21, 2011 at 10:06 AM, Martin Petrov <m.p.p...@gmail.com> wrote:
> I'm sharing my oocss file. Just want to know your opinion
> https://gist.github.com/1230501
>
@Murray Nuttall
I don't support IE6 so multiple class selectors are ok.
About namespacing - thanks for the suggestion, I will use it. I did
".button.admin' because there is another '.admin' used for applying
color to links. Such duplication of class names is not good..
Martin
I personally like the namespacing better than the multiple class selectors because not only is it supported by one of the best browsers around now, Internet Explorer 6, it just seems like the safest bet where nothing will conflict. A fun but totally legitimate example would be, .button.pal { border-radius: 5px } I have namespaced this button with a multi class selector and named it ".button.pal," because it is the friendliest button I know. If you didn't notice, "pal" is used in the OOCSS framework to to pad all sides on an element, which will then apply to this button. There is many cases where this can happen, it's why developers hate the global namespace! So I will be sticking with OOCSS's method of namespacing :) |