smacss

Are SMACSS, BEM and OOCSS not as portable?

南笙酒味 提交于 2019-12-22 03:56:38
问题 SO I have a problem with OOCSS. It is supposed to be more portable but compared to how I usually do things, I'm finding it less so. My example: I have a widget testimonial. In the main content body (which has a white background) the testimonial has a black font. But in the footer (which has a blue background) the testimonial needs a white font. Before OOCSS, I would do something like this: #main-content .testominial { color: #000000; } #footer .testominial { color: #FFFFFF; } With this "old"

SASS change nested elements class naming style

梦想的初衷 提交于 2019-12-13 06:40:30
问题 I'd like to use SMACSS naming system with SASS. Expect following SASS code: nav ul margin: 0 padding: 0 list-style: none as output i'll get nav ul { margin: 0; padding: 0; list-style: none; } but according to the SMACSS methodology class naming should looks like this: nav-ul { margin: 0; padding: 0; list-style: none; } Could you please advice how to change class naming style in SASS to reach this goal? 回答1: You can write it like this: nav &-ul margin: 0 padding: 0 list-style: none result: nav

Are SMACSS, BEM and OOCSS not as portable?

安稳与你 提交于 2019-12-05 01:13:01
SO I have a problem with OOCSS. It is supposed to be more portable but compared to how I usually do things, I'm finding it less so. My example: I have a widget testimonial. In the main content body (which has a white background) the testimonial has a black font. But in the footer (which has a blue background) the testimonial needs a white font. Before OOCSS, I would do something like this: #main-content .testominial { color: #000000; } #footer .testominial { color: #FFFFFF; } With this "old" approach, I could drag my widget from the content area to the footer and the colours would simply work