danielguillan / bem-constructor

A Sass library for building immutable and namespaced BEM CSS objects
MIT License
541 stars 32 forks source link

Immediate child selector in modifies-element mixin #23

Closed schuma7 closed 8 years ago

schuma7 commented 8 years ago

Hi Daniel,

thank you very much for your work on this lib, it’s a really neat implementation and I really dig its expressiveness. I currently just have one open question before I decide to use it for my next project.

What I currently don’t understand is why the modified-element mixin makes use of the immediate child selector > instead of the more general descendant one? This seems to make a strong assumption about the structure of the underlying markup and kind of prevents the arbitrary nesting of elements.

I guess you had your reasons for this decision and I'd appreciate if you could shed some light on this.

Best, Sven

danielguillan commented 8 years ago

Hey Sven,

Thank you for the nice words! Glad you find BEM constructor useful.

I've always made a strong assumption about the structure of the markup, and it has worked for me (most of the time), but you're totally right, this is a wrong approach. I'll update the lib to remove direct descendant selectors and release a new version.

Thank you very much for your feedback!

schuma7 commented 8 years ago

Hi Daniel,

thanks for your quick response, I'm glad to hear that you agree that opening the selector up will improve the usefulness of your library. I'm looking forward to your update, would be cool to be able to pull it in through npm. I hope you find the time for a new release soon.

Kind regards, Sven

danielguillan commented 8 years ago

Done! Thanks again for your feedback @schuma7!

iamravenous commented 8 years ago

I have been using BEM Constructor in my last projects and it's really useful, but this was the only thing I didn't understand. I even thought about making a fork and fix it, but your feedback was very fast.

I'm glad you have already solved, congratulations on such a good library. 👏

danielguillan commented 8 years ago

Thanks @iamravenous! 😄

muneef commented 8 years ago

Thanks @danielguillan for the fix! 👍 Looks like this is not reflected in the dist file