3 ms·
This makes perfect sense for classes like ".article51_footer_wrapper_margin50", look up the rule, and sure enough it looks like `.article51_footer_wrapper_margi
by blowski 11y ago
This makes perfect sense for classes like ".article51_footer_wrapper_margin50", look up the rule, and sure enough it looks like `.article51_footer_wrapper_margin50 { margin-bottom: 50px; }`
Seriously, just inline rules like that. If it is only applied in one specific place across the entire site either because it cannot or does not need to be made more general, then inlining it is easier to maintain and understand.
- deleted 11y ago[deleted]
- rimantas 11y agoExcept that class does not make sense. What happens when design changes and margin is now 40px?
- fhd2 11y agoNote that TFA is about using a style tag rather than a separate CSS file. It actually discourages the style attribute.
- oneeyedpigeon 11y agoBut TFA justifies avoiding the attribute because it "often leads to unnecessary code duplication" which is irrelevant "if it is only applied in one specific place across the entire site". It also mentions CSP as a reason to avoid the style attribute; can anyone explain what this means? Is this actually going to have a practical effect, and what does an inline style attribute have to do with security policy?