Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
See: #1190252: [573] Use csslint as a weapon to beat the crappy CSS out of Drupal core
[13:32:44] 1 error found in /Library/WebServer/Documents/core/modules/node/css/node.module.css
[13:32:44] [L24:C5] Using width with padding-right can sometimes make elements larger than you expect. Don't use width or height when using padding or border. (box-model)
[13:32:44] 2 errors found in /Library/WebServer/Documents/core/modules/node/css/node.preview.css
[13:32:44] [L10:C3] Using width with padding can sometimes make elements larger than you expect. Don't use width or height when using padding or border. (box-model)
[13:32:44] [L19:C18] Values of 0 shouldn't have units specified. You don't need to specify units when a value is 0. (zero-units)
Proposed resolution
Fix the errors, review the patch.
Remaining tasks
Write a patch to fix the suggestions
Run CSSlint against the new CSS
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#6 | Remove-CSSlint-errors-from-node-2485505-3.patch | 897 bytes | Manjit.Singh |
#2 | Remove-CSSlint-errors-from-node-2485505-2.patch | 971 bytes | Manjit.Singh |
Comments
Comment #1
LewisNyman CreditAttribution: LewisNyman at Wunder commentedComment #2
Manjit.Singh1. Removing padding from
core/modules/node/css/node.module.css
2. Minimize the width of
.node-preview-container
.Little bit confuse in node preview bar... We have already added css in bartik then why we adding the same in node module.
1. CSS in node module
2. CSS in Bartik
/core/themes/bartik/css/components/node-preview.css
Lewis can you please check it.
Comment #3
Manjit.SinghComment #4
LewisNyman CreditAttribution: LewisNyman at Wunder commentedI guess someone just copied the CSS and added some styles? We should clean this up in #2384169: The node preview bar is not usable without Bartik
Comment #5
LewisNyman CreditAttribution: LewisNyman at Wunder commentedI think that this will change the layout of the page and produce inconsistent results at different screen sizes. I think we can just use
box-sizing: border-box
here instead https://github.com/CSSLint/csslint/wiki/Beware-of-box-model-sizeSame situation here
Comment #6
Manjit.Singh@lewis Adding box-sizing as suggested by you
Also regarding cleanup css for node-preview bar, we will follow #2384169: The node preview bar is not usable without Bartik this only.
Comment #7
LewisNyman CreditAttribution: LewisNyman at Wunder commentedOk I manually tested the patch for any visual regressions, I can also confirm that there aren't any more CSSlint errors in these files. Thanks!
Comment #8
alexpottCSS only change - passes beta evaluation. Committed 9a36faf and pushed to 8.0.x. Thanks!