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.module.css (and system.module-rtl.css)
Comment | File | Size | Author |
---|---|---|---|
#22 | 1663170-clean-system-module-21.patch | 4.76 KB | LewisNyman |
#20 | 1663170-clean-system-module-20.patch | 1.53 KB | LewisNyman |
#20 | interdiff.txt | 1.53 KB | LewisNyman |
Comments
Comment #1
Lebby CreditAttribution: Lebby commentedI've removed some input related useless class
I've switched from id autoremove to class autoremove and modified related files ( autocomplete.js ).
This file needs more work!
Comment #2
Manuel Garcia CreditAttribution: Manuel Garcia commentedI'm not sure we should just blindly throw away the id in favour of a class because of csslint, at least in this case. Selecting an ID with jQuery is way faster than a class.
Comment #3
droplet CreditAttribution: droplet commented+1 #2.
also all of these will be removed. #675446: Use jQuery UI Autocomplete
Comment #4
Lebby CreditAttribution: Lebby commentedYou're right, it's more fast than using class.
BUT
I think that if you are develop a tool you could use class instead of Id ... why?
- Id must be unique, it's difficult to use an id that doesn't create conflicts.
- class is more flexible than id
- avoiding id is more easy to use from a site developer: add an id on a tag and customize it by css, that use a more classes because he can't modify a previous id
- class is correct abstraction to underline a feature or a behavior
- Using id doesn't allow to use it on more than one element.
All my previous observations are acceptable only considering frameworks/tools ...
Of course, this is my opinion ...
Comment #5
ZenDoodles CreditAttribution: ZenDoodles commentedLooks like there is more to do, but lets see what the bot has to say so far...
@Manuel Garcia please see #1190252: [573] Use csslint as a weapon to beat the crappy CSS out of Drupal core to discuss the relative merits of csslint.
Comment #6
oresh CreditAttribution: oresh commentedI've also replaced the id with class in the css, but i added the class to the js and did not delete the id.
Also cleaned some styles, the html5 elements discription moved to top page (it shouldn't be at the bottom)
All the css is sorted with CSS Comb, and i went through the Lint and fixed thous issues, which didn't cause any styling break.
Comment #7
oresh CreditAttribution: oresh commentedA little bit more clean up. Didn't add them in previous comment.
Comment #8
droplet CreditAttribution: droplet commentedeither one seems like redundant rule.
2 same selector, but ONE has LTR, another hasn't.
Comment #9
droplet CreditAttribution: droplet commentedAlso,
about the autocomplete, it always has ONE div and should be only ONE. theoretically and ideally it should be #id
Comment #10
oresh CreditAttribution: oresh commented@droplet,
- list-style-image:none was there before, and as I know it's a fix for IE8 which doesn't like just list-style: none;
- autocomplete changed back to ID;
- LTR added
Thank you for testing!
Comment #11
oresh CreditAttribution: oresh commented#10: 1663170-base_css_partial_cleanup_related_input_and_autocomplete_id6-3.patch queued for re-testing.
Comment #12
Liam MorlandThis has probably been superseded by #1921610: [Meta] Architect our CSS.
Comment #13
LewisNymanComment #14
rteijeiro CreditAttribution: rteijeiro commentedWorking on this :)
Comment #15
rteijeiro CreditAttribution: rteijeiro commentedComment #16
rteijeiro CreditAttribution: rteijeiro commentedFixed a few CSSLint errors. Still some background errors remaining but not sure how to fix them. Any ideas?
Comment #20
LewisNymanThe documentation for the multiple background image rule is here: https://github.com/CSSLint/csslint/wiki/Disallow-duplicate-background-im...
I manage to remove all the errors apart from the throbber image being used multiple times. I don't think we want to follow the rule in this situation as it's not possible to add custom classes to jQuery UI elements I think. Let's leave it as is and maybe we can revisit if we want to follow this rule later on.
We need some screenshots of the affected elements, especially the full screen throbber (Views UI)
Comment #22
LewisNymanI messed up the patch
Comment #23
idebr CreditAttribution: idebr commentedI haven't checked the autocomplete and table hierarchy yet, but here are some pointers:
This changes the size of the drag handle.
This selector no longer applies to the intended element, since the markup is
<tr class="draggable tabledrag-leaf drag">
Comment no longer applies when !important is removed
This breaks the contextual link selector, as its markup is
should be
Should be
Comment #24
LewisNymanPostponed on #2395853: Split system.module.css and system.theme.css files into SMACSS style components
Comment #25
mgiffordComment #28
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? :)