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.
See: #1995272: [Meta] Refactor module CSS files inline with our CSS standards
Remaining tasks
Review the current CSS — What to look for when reviewing CSS
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#7 | reports-updates.png | 103.66 KB | DickJohnson |
#7 | security-update-needed.png | 38.91 KB | DickJohnson |
#7 | major-upgrade-needed.png | 58.79 KB | DickJohnson |
#1 | update.admin_.css_.txt | 2.65 KB | LewisNyman |
Comments
Comment #1
LewisNymanComment #2
LewisNymanComment #3
DickJohnson CreditAttribution: DickJohnson commentedTook a quick look to this one.
We have 4 templates affecting css mentioned in issue description: update-last-check.html.twig, update-version.html.twig, update-project-status.html.twig, update-report.status.html.twig
Most of them are outputting classes that are not consistent with parts we have already renewed.
Starting to look through these.
update-version.html.twig
Current:
Proposed:
But it feels like update__version-links__download and update__version-links__release-notes are a bit long classes.
Update.report.html.twig
Current:
Proposed:
update.last.check.html.twig
Current:
Proposed:
Last of the four is so large that I will check it on another day.
Comment #4
DickJohnson CreditAttribution: DickJohnson commentedIt looks like a lot of classes of he css-file are coming from places such as core/modules/update/src/Form/UpdateManagerUpdate.php. It looks like we will need a lot of work to get this inline with our standards.
Comment #5
LewisNymanMaybe we should work on the Classy issue to more files into the templates first?
Comment #6
DickJohnson CreditAttribution: DickJohnson commentedYeah.
I also want to mention that testing this issue is actually quite hard. Installed new Drupal 8 and few contribs like restui, date and omega theme.
The only line from update.admin.css that got triggered on Bartik, Stark, Classy and Seven was line 163:
But I'm pretty sure some css gets triggered if we have correct kind of updates available.
Comment #7
DickJohnson CreditAttribution: DickJohnson commentedOk, managed to figure out what this is actually doing. It seems that I have a lot to do on trying to explain things (pointing to IRC discussion with @lewisnyman).
Difficult thing on testing this issue and what our CSS and templates are currently doing is that we are working for example on admin/modules/update -page and it's output is related on what kind of modules OR core we have in need of update/upgrade.
Options are:
1. Major update
2. Security patch needed
3. Module not supported anymore
4. Update information unknown
5. We have a valid version
There is different CSS for every scenario
As we're working on 8.0.x branch, we don't have any (or do we?) options on modules that are in need of security patch nor which are not supported anymore. Also upgrade from 8.0.x to 8.0.0-beta-6 is not considered as major.
So, we need to actually hack core a bit to see if templates and CSS is working properly (or this was the easiest way for me to do it). To get "major update needed" text and it's styles visible:
You need to change line #139 from core/modules/update/src/Form/UpdateManagerUpdate.php from
to
(^^or that is the easiest way I managed to do it)
To test the CSS on other scenarios (=security patch needed, not supported anymore or update information unknown -part) you need to make similar kind of hack to same file to switch sentence starting from line #163.
But I can also assure that CSS related to this is currently working and there's no extra lines, so we just need to check that CSS is written with coding standards and document it, as the few lines we're using on /admin/modules/update are splitted all over the CSS-file.
Other things
update.admin.css is also being triggered on /admin/reports/updates, /admin/reports/updates/settings, /admin/update/ready and /admin/theme/install
Same issues on testing the current (or modified) CSS are also here than what we have on admin/modules/update. We should have modules OR core in need for updates for different reasons to see that everything is being triggered as it should. With similar kind of hacks I checked the current CSS and it looks like it's pretty clear and there isn't at least much stuff that is not being triggered.
Clean up
When our CSS-file is full of things like
It's highly unclear if that is used in /admin/modules/update or /admin/reports/update or somewhere else (or at all). I do know that we don't want to increase the amount of CSS or CSS-files in core as, so the CSS file should be documented well.
Comment #8
LewisNymanMaybe we can check through the twig files for classes that match, then we can add some comments to separate them per twig file?
Yeah, it's entirely possible that some of this CSS isn't being needed anymore. The majority of this CSS was added in 2007 in #94154: update.module in core (formerly known as update_status). Other design change issues are: #165638: Usability improvements: add padding and ()s for the "Check manually" link, #217771: Prevent wrapping of release dates, #431148: Make it easier to visually distinguish security updates on Updates report, #538660: Move update manager upgrade process into new authorize.php file (and make it actually work), and #934148: Colors for security updates on available updates report are wrong.
Comment #9
DickJohnson CreditAttribution: DickJohnson commentedTwig files are not enough as some of the classes are coming from core/modules/update/src/Form/UpdateManagerUpdate.php and I think that some are coming from core/modules/update/update.compare.inc. I think that some of the table related things are still coming from somewhere else, but didn't have enough time to figure it out, yet.
Comment #10
LewisNymanIt feels like we didn't finish the job in #2329829: Move update classes from preprocess to templates, let's postpone this, do you want to create a follow up with your findings here?
Comment #11
LewisNymanThis can now be unpostponed, also see: #1663206: Update update.admin.css inline with our CSS standards
Comment #12
LewisNymanClosing in favour of #1663206: Update update.admin.css inline with our CSS standards