|
|
|
|
|
by moron4hire
4887 days ago
|
|
CSS has a mechanism for defining rules in such a way to abrogate the need for variables. I see far too many people using CSS classes to refer to one or only a handful of things, by a strict hierarchy of the layout of their page. In that case, you're almost always going to run into problems with extremely verbose CSS that repeats itself. But it's completely wrong, it's not how CSS is supposed to be done. If you need a bunch of objects to, say, have the same background color, that's why you can chain selectors. Your common background color would then only be defined in one place. CSS doesn't have to be complex to get complex results. I would call a CSS file any longer than 200 lines a bad code smell. As for browser-specific rules, in my mind they just plain don't exist. Add in an intelligent reset rule-set at the beginning of the file (and no, not one that destroys the margin, padding, and display rules of every single element, but only resets things as needed) then you can easily make completely cross-browser UIs. |
|