now that title must have made you wonder what the heck the two have to do with each other.
Im developing a widget, so it is essential that my css does not contradict with other people's css on the site.
so basically i need to change
h1 {
color:purple;
font-size:28px;
}
to
#thediviamin h1 {
color:purple;
font-size:28px;
}
This limits the scope and prevents me from harming other people's beautiful headings.
There is just one problem, my widget will be templatable. Not just by me, but by whoever decided to use it on their site. Asking them to kindly prepend the #thediviamin would not really have much hope.
Since I am already gzipping, compressing and caching my css on the fly I thought it would be a nice idea to use a regular expression to add the #thediviamin automatically
I am wondering, did anyone did this before me? (I sure hope they did and blogged about it 🙂)