Sub-issue of #1190252: [573] Use csslint as a weapon to beat the crappy CSS out of Drupal core
Inline with the CSS cleanup efforts of the HTML5 initiative, using CSSLint at http://csslint.net provides a quick way to code-sniff our css and tweak styles.
- Copy and paste the the stylesheet(s) below into the css lint tool at http://csslint.net and test.
- Fix any warnings or errors the tool finds.
- Patch Drupal 8 locally and make sure the css changes have not broken anything visually.
- Create patch and upload for the testbot.
Files:modules/system/system.theme.css
| Comment | File | Size | Author |
|---|---|---|---|
| #52 | system_theme_css_cleanup-1663184-52.patch | 14.39 KB | jofitz |
| #46 | interdiff-system_theme_css_cleanup-1663184-46.txt | 14.55 KB | hog |
| #46 | system_theme_css_cleanup-1663184-46.patch | 14.39 KB | hog |
| #40 | clean-up-system-theme-css-1663184-40.patch | 6.05 KB | maninders |
| #2 | system_theme_css_cleanup-1663184-2.patch | 3.11 KB | albert volkman |
Comments
Comment #1
robloachhttps://gist.github.com/3006391#L3648
Comment #2
albert volkman commentedFirst pass. Still some outstanding issues that I'm not entirely sure how to address.
Comment #3
oresh commented#2 patch is no longer executable - the code has changed a lot.
Cleared some styles with CSS Lint, sorted them with CSS Comb
Also changed some dimensions from px to em (as in most of the css)
Patch applies both for system.theme.css and system.theme-rtl.css
Comment #4
oresh commented#3: system_theme_css_cleanup-1663184-3.patch queued for re-testing.
Comment #5
enhdless commentedUpon testing the patch:
Patch should be rerolled.
Comment #6
ckrinaStarting with the reroll.
Comment #7
ckrinaRerolled.
Comment #10
lewisnymanSorry this now needs a reroll. I will try and review it soon after it is posted next time. Also I'm not sure if we should run the CSS through CSS comb here, we aren't doing that anywhere else? We should probably run every CSS file through it in one patch for consistency.
Comment #11
lewisnymanComment #12
emma.mariaComment #13
lewisnymanComment #14
sumeetjaggi commentedPatch Re rolled!
Comment #15
lewisnymanBah! Looks like this got knocked out on the same day by #2372023: Description of display settings takes too much space
Comment #16
emma.mariaComment #17
emma.mariaRerolled.
Comment #18
idebr commentedPatch no longer applies after #2417705: Autocomplete suggestions visual regression after modal and jQuery UI update was committed.
Comment #19
rteijeiro commentedRe-rolled and fixed a few CSSLint errors. Still needs some word in
tabs__taband progress bars. Working on it.Comment #20
pwieck commentedComment #21
mortendk commentedComment #22
idebr commentedNot sure on the attribute shuffling, we don't use CSS comb anywhere else. It also doesn't help the review process or make the code any more readable than before. It also doesn't throw any warnings on CSS Lint. @LewisNyman do you think we can remove this part of the patch?
The concatenated selector was introduced in #162047: .container-inline class overridden by system.theme.css; also not working with .form-actions to fix the display of .container-inline on #type => 'action' form elements. This pattern is still in use for example on the 'Recent log messages' page so this line should not be removed.
Comment #23
lewisnymanIf we need it then I guess we need it, it's going to be hard to fix every error in this issue without having to focus on an individual component, so let's try and fix the easy wins here and maybe introduce follow ups to deal with tricky components
Comment #24
lewisnymanComment #25
Karmen commentedComment #26
Karmen commentedReroll made and fixed some warnings in CSS Lint.
Comment #27
lewisnymanComment #28
rteijeiro commentedRemove extra space before
/* LTR */Comment #29
keopxReroll and I removed extra space before /* LTR */
Comment #30
keopxComment #31
lewisnymanI found three errors when I ran it though csslint:
According to caniuse data, we no longer need the -moz- and -o- prefixes
We don't need any of these vendor prefixes according to caniuse data
It looks like we don't add the margin-right where we should for RTL
Can we keep these values as they are? I think these now round to uneven pixel units
Comment #32
Karmen commentedIs it fine?
Thanks!
Comment #33
rteijeiro commentedComment #34
Karmen commentedUpload an interdiff. Sorry!
Comment #35
lewisnymanThanks, this definitely needs regression testing.
I am worried that these classes are too generic and will cause issues in other, unintended places.
I'm tempted to postpone this on #2395853: Split system.module.css and system.theme.css files into SMACSS style components, what do other people think?
Comment #36
ti2m commentedI ran the patch through siteeffect and I found a lot of regressions, especially related to lists and tabs. See the gif as an example, it's taken from /admin/appearance/settings/seven
Comment #37
rteijeiro commentedComment #38
rteijeiro commented+1 to postpone as Lewis suggested in #35
Comment #39
maninders commentedComment #40
maninders commentedPlease find the attached patch which removed all the csslint issues.
Comment #41
lewisnymanPostponed on #2395853: Split system.module.css and system.theme.css files into SMACSS style components
Comment #42
mgiffordComment #45
lewisnymanCan we replace these issues with individual issues for each file? It would make it easier to work on. Does anyone want to create the issues? :)
Comment #46
hog commentedComment #48
maninders commentedUpdate the issue summary. system.theme.css is not available in core/modules/system/
Comment #49
manjit.singh@Maninders yeah right !!! All the css (system.theme.css) has moved to the seven as it is backend theme so rather we have to close this issue or need to update the issue summary.
Comment #51
wturrell commentedUnable to apply patch against 8.2.x for ajax-progress.module.css and progress.module.css
Comment #52
jofitzRe-roll.
Comment #63
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.
Some of the changes of the patch appear to have already landed but not all.
Also this was tagged for visual regression testing and issue summary update that still needs to happen.
Comment #65
mstrelan commentedThe parent issue #1190252: [573] Use csslint as a weapon to beat the crappy CSS out of Drupal core was closed in favour of #2865971: Use stylelint as opposed to csslint in core. I suspect that means the steps in the issue summary are no longer applicable. Can we close this one?
Comment #66
smustgrave commentedSince there's been no follow up going to assume we can close this one.
Comment #67
smustgrave commented