Namespace all selectors and styles using BEM conventions
I have been using your awesome library recently and have run into some issues with how the selectors architected. Classes like .button can cause a mess when you also have a standard .button component in your style sheet.
I propose to namespace all selectors for this library appropriately using BEM conventions. The root element should be .selectric and all other elements as .selectric__element-name. This would also require changes to the stylesheet.
Would you be interested in this contribution? I would be happy to take the time to put together a PR if it would be considered.
Yes! I'm really interested in that.
I haven't done this myself yet because I don't have time at the moment.
We have to be a little careful though, since there's legacy options to switch classes cases. Take a look at jquery.selectric.js for example. I don't know what the behaviour would be in this case. Maybe remove this functionality all together?
Yea, this would be a backwards-incompatible change, requiring a major version # bump.
It looks like most of the selectors are covered using the prefix option, however even if you use that option .button, .label, .selected, and .last are hardcoded classnames that float in the global namespace.
I would recommend removing that functionality, I don't think it is integral to this lib.
All for this. I'm about to implement this on a project - are these revisions underway? Odds of being completed in a few days? If not no big deal, just would like to not do it twice because I missed it by a day or two ha!
I have not started on this, I was waiting to hear back on whether breaking backwards compat was a no no...
Ah ok - thanks for the info!
We ship it on v2.
It's ok to not be backwards compatible.