2 ms·
Maybe inline is an extreme example - but suppose we didn't allow the selector syntax, only a simplified form of CSS where the only selector is a single class, a
by lmm 12y ago
Maybe inline is an extreme example - but suppose we didn't allow the selector syntax, only a simplified form of CSS where the only selector is a single class, and only allowed one class per element? Then the browser could share everything it can share today - it still needs to compute the final style for every element on the page, so the only way it can reuse styling information is if two elements come out with exactly the same style - but it would be much easier to see why any given element was styled the way it was, the browser implementation could be simpler, and our programmatic frameworks for styling components on the page would still be able to help us avoid repeating ourselves.