--
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/-/NFClFalm3pYJ.
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.
Plus, if you need IE 6 compatibility (yes some people still do) it's the only way to go - you can't class chain in IE6
--
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/-/WH1nS6wIAs4J.
Can you give us an example of .btn.green and .alert.green "done properly".Unless you're in complete control of the entire project, until the end of its life, I can't see how you can avoid cross pollination of styles. I'm interested to see how you do it.Also OOCSS is supposed to be cross browser compatible, so there is value in taking ie6 into account when discussing things like this.
Regards, Murray
Why would you even use a use case like 'success'? Wouldn't a button class be more apt in this situation?Let's take another situation: Assume I have a button and I want an alert button, a success button, warning button, so on. They all share styles (border-radius, cross-browser stuff, what have you). Now I don't know about you, but maintaining a mini library (aka multiple selector) of all the buttons I have is a tad silly(e.g. .btn-success,.btn-alert,.button-warning { border-radius: 5px; }).What I do is throw default styles on a button class (.btn) and then you can namespace with stacked classes to keep class names simple and reduce possible conflicts within a very big system (.btn.green / .alert.green will never conflict if used properly.. this is a huge gain in terms of simplicity, readability, etc) and you avoid doing .btn-green / .alert-green... and that's not even taking into account how you're going to handle implementing DRY for that).--As far as the article goes, the base can stand for anything.... ideally in your CSS there is explanation on how to use the classes, what sort of markup is needed.You can either choose to have a default or not (.... smart defaults anyone? This is OOCSS right? This is always what Nicole Sullivan has advocated) for instance if I just use .btn, maybe I make a certain style default, but maybe not. It depends on what works for your site... at my job we use both in different situations when it makes sense. If you don't choose to use a default, then the stacked class should always be used with another class. As far as reusing it with other modules... just build out a reusable class to do just that. If you find that you want to use .btn-success on some other sort of item other than a button, then it was an architecture problem in the first place.... rename it to something that makes sense, and make it reusable.Let's not forget that even though we use classes for reusability, when we make skins, the styling inside the skins are using descendant selectors... it's not like everything is ia global class that can be mixed-matched ad-infinitum. That would get very messy, very fast. It might make sense for the simply designed Twitter / Bootstrap, but many large sites would probably be better suited with the stacked classes in certain situations.Rick, I think IE6 support is it's own separate thing that shouldn't be grouped in. If you're among the unfortunate that still have to support IE6, this obviously not might work well for you. If you don't however, I think it's perfectly fine to use stacked classes, just not in the way perpetrated in the example given.On Monday, March 5, 2012 9:33:13 PM UTC-5, Arunan Skanthan wrote:I practically find that .btn .btn-alert seems a good alternative to .btn.alert (having used the latter style in a recent project and found that I had to create a different class name instead of .alert)Any thoughts on this?
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/-/WH1nS6wIAs4J.
To post to this group, send email to object-oriented-css@googlegroups.com.
To unsubscribe from this group, send email to object-oriented-css+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/object-oriented-css/-/eBOYliHivusJ.
To post to this group, send email to object-or...@googlegroups.com.
To unsubscribe from this group, send email to object-oriented...@googlegroups.com.
Six of one, half a dozen of another. There are so many factors at play here, some of which have already been mentioned: template engine, framework organization, preprocessor, ie6 support, etc. I don't see either approach being decisively better. In my case we use SASS with @extend and prefixed classes so you can get away with class="btn-success". But again, this is completely dependant on many other factors in our organization and approach.
--
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/-/NFClFalm3pYJ.
Six of one, half a dozen of another. There are so many factors at play here, some of which have already been mentioned: template engine, framework organization, preprocessor, ie6 support, etc. I don't see either approach being decisively better. In my case we use SASS with @extend and prefixed classes so you can get away with class="btn-success". But again, this is completely dependant on many other factors in our organization and approach.
On Mar 5, 2012 8:33 PM, "Arunan Skanthan" <****@gmail.com> wrote:
I practically find that .btn .btn-alert seems a good alternative to .btn.alert (having used the latter style in a recent project and found that I had to create a different class name instead of .alert)Any thoughts on this?--
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/-/NFClFalm3pYJ.
To post to this group, send email to object-oriented-css@googlegroups.com.
To unsubscribe from this group, send email to object-oriented-css+unsub...@googlegroups.com.
Yep. We only use @extend in a very limited and controlled basis. Everything you say is true plus it can make your stylesheets huge very quickly if you're not careful. What you describe - reusing classes as mixins - sounds like the approach LESS takes.
To view this discussion on the web visit https://groups.google.com/d/msg/object-oriented-css/-/QFYZCrs4iA0J.
To post to this group, send email to object-or...@googlegroups.com.
To unsubscribe from this group, send email to object-oriented...@googlegroups.com.