News for hackers. Stuff that matters.
Re:Style like a BOSS. New css preprocessor. by lvivski on Tuesday October 02, 2012 @03:52AM (#4600975)
BOSS is compatible with standard CSS selector syntax, you don't have to use BEM features if you don't want to.
Re:Style like a BOSS. New css preprocessor. by catshirt on Tuesday October 02, 2012 @03:55AM (#4600979)
your statement on compatibility is only a half truth.

the problem is not incompatibility with CSS. the problem is that its incompatible with the way anyone actually uses CSS. to be particular- the way it treats the nesting of selectors by relying on underscore separation instead of standard cascading.

to be clear, i don't take offense with BOSS. if you're using BEM, BOSS seems like a fine solution. i do however take offense to BEM directly, and as an extension, comparing BOSS to LESS or SASS.

Re:Style like a BOSS. New css preprocessor. by lvivski on Tuesday October 02, 2012 @04:06AM (#4601003)
You are partially right. I've added a test with simple selectors: classnames, pseudo.

BOSS expands nesting with underscore separation only in case of BEM selectors (Blocks, Elements, Modifiers)

But it uses cascading with all other selectors, see "test/standard.boss" and "test/standard.css"

Re:Style like a BOSS. New css preprocessor. by catshirt on Tuesday October 02, 2012 @04:16AM (#4601035)
thanks for clearing that up. for what it's worth the readme fails to explain this, and now i'm actually left with more questions. if a selector with no preceding notation is reserved for BEM blocks- how would i reference an element by tag?
Re:Style like a BOSS. New css preprocessor. by lvivski on Tuesday October 02, 2012 @04:25AM (#4601055)
there is a list off all HTML tags, if a tag with that name exists, it will be treated as a TAG, if it doesn't, it will be treated as a BEM block. That simple.

This gives some restrictions to Blocks' names, but it's not a big problem, cause normally you won't give block a name which matches existing HTML tag.

The same restrictions are for Modifiers (pseudo-selectors) if it exists, then pseudo, else Modifier.

Re:Style like a BOSS. New css preprocessor. by roryokane on Tuesday October 02, 2012 @04:10AM (#4601015)
BOSS’s ‘&’ operator’s underscore-adding feature is useful only if you use BEM. BOSS’s other features, such as block nesting and the “darken” function, already exist in other CSS preprocessors. Thus, if you’re not going to use BEM, you have no reason to use BOSS – you should use Stylus or LESS, since they have the same features but have bigger ecosystems.
Re:Style like a BOSS. New css preprocessor. by lvivski on Tuesday October 02, 2012 @04:17AM (#4601038)
In simple cases `&` is just replaces by parent selector (Like in SASS or LESS), only some cases are treated as BEM nesting (pseudo-selector that doesn't exist, etc).

If you use SASS or LESS and happy with them, you don't need BOSS. But you may take a look at it, 'cause it has simpler syntax for mixins and variables, which is more CSSy.

So BOSS is more like a superset to SASS and LESS, their features + some new stuff + simpler syntax.