Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
- Rewrite the classes inline with our CSS standards
- Patch Drupal 8 locally and make sure the css changes have not broken anything visually.
- Create patch and upload for the testbot.
Files: modules/update/update.css (and update-rtl.css)
Suggested new classes names
project-updates__title
project-updates__details
project-updates__version-link
project-updates__version-date
project-updates__operations
project-updates__release-notes-link
project-updates__download-link
Comment | File | Size | Author |
---|---|---|---|
#36 | update_update_admin_css-1663206-36.patch | 16.56 KB | pakmanlh |
#32 | Screenshot 2015-03-13 16.20.57.jpg | 446.28 KB | LewisNyman |
#31 | update_update_admin_css-1663206-31.patch | 14.71 KB | LewisNyman |
#31 | interdiff.txt | 16.45 KB | LewisNyman |
#19 | after-patch.png | 93.67 KB | aliyakhan |
Comments
Comment #1
RobLoachFrom the CSSLint node report of Drupal 8:
Comment #2
Manuel Garcia CreditAttribution: Manuel Garcia commentedOnly one warning left: Beware of broken box size Using width with padding-left can sometimes make elements larger than you expect.
padding-left: 1em; /* LTR */
But we need it for LTR so it's ok to leave it as is imho.
Comment #3
droplet CreditAttribution: droplet commentedThat means this syntax has RTL style. so you have to hack both stylesheets :)
Comment #4
LewisNymanComment #5
brahmjeet789 CreditAttribution: brahmjeet789 commentedI have n't see any update.css in the module/update/css/ but instead of that i found the update.admin.css in which all the theme changes has been done so it is fixed now so that why i just closed this one.
Comment #6
brahmjeet789 CreditAttribution: brahmjeet789 commentedComment #7
LewisNymanUpdate.admin.css needs improving still.
Comment #8
rteijeiro CreditAttribution: rteijeiro commentedRe-rolled and fixed all CSSLint errors.
Comment #9
mortendk CreditAttribution: mortendk commentedComment #10
jwilson3needs before after screenshots. particularly, would be useful to show that by removing the tr from tr.even / tr.odd, no knock-on effect will override the background color/border etc, by having those "tr"s still referenced elsewhere.
Comment #11
jwilson3Comment #12
LewisNymanI looked into this CSS, and it doesn't do anything. There is no border set for it to unset. We can remove it completely.
These class names are really generic and not inline with our CSS standards. There is also a lot of redundant CSS here in this file. Do we really want to only fix the CSS lint errors here? I'm not sure if it makes sense to have two cleanup issues with #2408499: Rewrite update components inline with our CSS standards also fixing the same problems.
Comment #13
idebr CreditAttribution: idebr commented@LewisNyman #2408499: Rewrite update components inline with our CSS standards has the same goal, but it has no patches attached. Let's close it in favor of this issue and broaden the scope of this issue to also clean up the selectors.
Comment #14
LewisNymanOk, closing #2408499: Rewrite update components inline with our CSS standards, See DickJohnson's recommendations here: https://www.drupal.org/node/2408499#comment-9585565
Comment #15
aliyakhan CreditAttribution: aliyakhan commentedHad worked on a patch for unused css and linting. Will take a look at recommendations now
Comment #16
aliyakhan CreditAttribution: aliyakhan commentedComment #18
mortendk CreditAttribution: mortendk commentedI would love to review this, but can somebody point me to a quick way in d8 to find modules for all the instances - cause it needs screeenshots just so were sure its not gonna create trouble later on.
A quiction should the file be
update.admin.theme.css
or do i put to much into the theme part ?the file is pure colors ?
Comment #19
aliyakhan CreditAttribution: aliyakhan commentedThere was unused css in the file as mentioned by Lewis #12. Little alignment fixed in user interface. Attaching shots.
Comment #20
aliyakhan CreditAttribution: aliyakhan commentedAlso i think this make sense -> update.admin.theme.css. And file is all about the interface in screenshots.
Comment #21
mortendk CreditAttribution: mortendk commented@aliyakhan yup lets go with that, gonna make it easy for the themer then to see whats actually goes on when looking at all the css
uploaded new patch with interdiff
Comment #22
aliyakhan CreditAttribution: aliyakhan commentedHey @mortendk, style filename name needs to be modified -> update.admin.theme.css
Is missing now.
Comment #23
aliyakhan CreditAttribution: aliyakhan commentedComment #24
mortendk CreditAttribution: mortendk commented@aliyakhan aaaah ups wrong patch uploaded lets try this again ;)
Comment #25
aliyakhan CreditAttribution: aliyakhan commentedPerfect @mortendk. Attached shots
Comment #26
LewisNymanLooking good, we still haven't rewritten the classes to match our standards, see the examples here: https://www.drupal.org/node/1887918#sub-components
Also see DickJohnson's suggestion from #2408499: Rewrite update components inline with our CSS standards:
I think these still need some feedback and improvements
Comment #27
LewisNymanupdate__version-links__release-notes
I don't think it's best to include two double underscores in a selector, why not just
update__release-notes
IMO the word
update
as the container component doesn't make sense, it's just the name of the module, I think maybe.project-update
would be a better name? That could replace the.update .project
selector. I don't think we need a wrapper class for the listing.Comment #28
mortendk CreditAttribution: mortendk commented@levis So would there be an idea in using the word "drupal" as a prefix here for the container, im thinking something in the lines of
.drupal-project-update
or something like that, even that the name is way to long.One of the things that i hope we will achive in D8 is a themer would be able to navigate the css only on the classes? - maybe project-update is more than enough, just thinking in the big scheme of things, that would set a policy that we added drupal to a lot of "machine" things in Drupal though + would require an update to the css docs.
... i probably set a new record in scrope creep here ;)
Comment #29
jwilson3I think classes like this would make sense:
project-updates__title
project-updates__details
project-updates__version-link
project-updates__version-date
project-updates__operations
project-updates__release-notes-link
project-updates__download-link
The "drupal-" prefix seems out of scope for cleanup of just this issue.
Comment #30
LewisNyman@jwilson3 Your class suggestions look good, I've added them to the issue summary.
@mortendk Take that nonsense into a policy issue ;-)
Comment #31
LewisNymanOK so I gave a go implementing @jwilson3's suggestions. I ended up changing a lot, because there was a lot wrong with our current implementation. There were some classes I could replace with reuseable color/layout classes, we were also using tables for layout, so I removed them.
The design has been tweaked a little to be more consistent, and quite a few classes have been removed that weren't being used, so this will need a lot of regression testing.
Comment #32
LewisNymanHere is a screenshot:
Comment #34
LewisNymanComment #35
pakmanlhWorkin on it.
Comment #36
pakmanlhI rerolled the patch to apply it and I fixed the tests.
Comment #37
LewisNymanI applied the patch with no problems. I manually tested the patch and I couldn't fine any problems
Comment #38
Manuel Garcia CreditAttribution: Manuel Garcia commentedLooks good to me!
Comment #39
webchickCommitted and pushed to 8.0.x. Thanks!