Follow-up to #2422377: elements.css css lint fix
Problem/Motivation
fix css lint issues:
Line Column Message
53 1 Heading (h1) has already been defined.
57 1 Heading (h2) has already been defined.
61 1 Heading (h3) has already been defined.
65 1 Heading (h4) has already been defined.
69 1 Heading (h5) has already been defined.
73 1 Heading (h6) has already been defined.
undefined undefined You have 2 h1s, 2 h2s, 2 h3s, 2 h4s, 2 h5s, 2 h6s defined in this stylesheet.
Proposed resolution
rewrite the h1-h6 selectors
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| csslint-elements-css-bartik.diff | 1.14 KB | mortendk |
Comments
Comment #1
joelpittetThis seems a bit wasteful to me... maybe don't believe all csslint's recommendations? Judgement call on this one needed.
With the duplicate properties, there is more chance of inconsistencies.
Comment #2
mortendk commentedIm a fan of playing hardball here, and follow hard csslints recommendations.
* It makes it clear for everybody whats expected.
* we dont end up with "messy css", where we try to be extra smart on sharing properties & then have repeating selectors.
If we dont go with the hardcore way, we should create our own version of the lint tool, so we can automate it.
Im for going all hardcore on this, it also remove any kind of bikeshedding ;)
Comment #3
lewisnymanWe are able to pick and choose which CSSLint rules we follow, see the patch in #2222049: Add a .csslintrc file that's in line with our CSS standards
The question is less "do we agree with this rule" and more "is this rule fit with our CSS standards".
My understanding of the relevant area of SMACSS is not to duplicate the CSS selectors in multiple places, so we know we have one place to look to see all the CSS that affects that element. In other situations we've been removing the files that have long lists of selectors with one or two sahred properties in so we can maybe the code easier to find for each element. eg. #2398447: Remove the "typography" CSS file in Bartik
Happy to go into this in more detail if people want to, but my instinct is to follow the direction of the csslint rule here.
Comment #4
mortendk commentedim +1 for the "csslint is the law"
If we dont create our own ruleset, or we dont follow csslint strict, then we end up with potential loopholes. + it would be sweet to have a "lint trap" on all submitted css, its gonna make it a pita to add that with potential loopholes.
yes im a css-nazi ;)
Comment #5
joelpittetJust recommending against this because duplication of the properties on the grouping (all header elements), makes it easy to create mistakes when changing things. #maintenance.
Comment #6
joelpittetActually I've got a change of heart here.
Comment #7
webchickCommitted and pushed to 8.0.x. Thanks!