Excellent article. I have been using the attribute selectors rather extensively in the last few projects we’ve been doing and have extolled around DC a bit about their awesome power (mini-REGEX).
Glad to see you did a speed test as well and came to some good conclusions.
One thing people should be aware of is when you write:
[class*=“pod”] it will choose both .pod-heading as well as .podium. Basically, you need to be pretty sharp on your naming conventions. To combat this, I’ve started namespacing using something like: [class*=“pod—”] (two dashes) to ensure it only picks up the right namespace.
Excellent article. I have been using the attribute selectors rather extensively in the last few projects we’ve been doing and have extolled around DC a bit about their awesome power (mini-REGEX).
Glad to see you did a speed test as well and came to some good conclusions.
One thing people should be aware of is when you write:
[class*=“pod”] it will choose both .pod-heading as well as .podium. Basically, you need to be pretty sharp on your naming conventions. To combat this, I’ve started namespacing using something like: [class*=“pod—”] (two dashes) to ensure it only picks up the right namespace.
Thanks for the article!