HubSpot / messenger

Growl-style alerts and messages for your app. #hubspot-open-source
http://github.hubspot.com/messenger/
MIT License
4.02k stars 406 forks source link

Add $prefix in SASS to allow scoping of CSS #4

Closed mrchess closed 11 years ago

mrchess commented 11 years ago

It would be useful if the SASS had a "prefix" option where I could specify the prefix for all the CSS classes.

More discussion the value of a $prefix could be found here: https://github.com/twitter/bootstrap/issues/1287

zackbloom commented 11 years ago

Makes sense to me, it will also be necessary to add the ability to pass that prefix into the javascript, so it can reference the classes appropriately.

mrchess commented 11 years ago

I guess .messenger is really the prefix already by design. I ended up replacing all messenger in the CSS into a $prefix, and for JS I added a baseCSSPrefix global which has the same prefix the swapped out messenger with #{baseCSSPrefix} in the templates -- similar to Ext 4s method for their Sandbox Mode. (http://dev.sencha.com/deploy/ext-4.0.0/overview/index.html)

zackbloom commented 11 years ago

PR?

mrchess commented 11 years ago

I'll send one up soon. I realized I wasn't sure if it is a good idea to merge it in since in a way it adds some overhead as you meed to type

{prefix} all the time which can get kind of annoying in practice.