Problem/Motivation
This is a child of #3324398: [META] Update Claro CSS with new coding standards and part of #3254529: [PLAN] Drupal CSS Modernization Initiative.
Steps to reproduce
The stylesheet at https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/themes/clar... needs to be refactored to make use of modern CSS and Drupal core's PostCSS tooling.
@todo: Add clear testing instructions to test this manually on the UI.
Proposed resolution
- Use CSS Logical Properties where appropriate.
- Use CSS nesting where appropriate.
- Use existing variables (
variables.pcss.css) where appropriate. Follow the proposed Drupal CSS coding standards to name the variables. - Add a comment when there's a value where there is not a variable like
font-size: 1.23rem; /* @todo One off value. */ - When possible, set variables at the root of the component and then map them to global theme variables:
.entity-meta { --entity-meta-title-font-size: var(--font-size-h5); ... more style } .entity-meta__title { font-size: var(--entity-meta-title-font-size); }
Out of scope
- Changing CSS classes
- Drupal 9 patches
Remaining tasks
Manual testing, see #12.
User interface changes
None. There should be no visual differences.
Please post before/after screenshots and make sure they look the same.
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #42 | 3332683-nr-bot.txt | 90 bytes | needs-review-queue-bot |
| #40 | 3332683-nr-bot.txt | 1.62 KB | needs-review-queue-bot |
| #37 | 3332683-nr-bot.txt | 90 bytes | needs-review-queue-bot |
| #36 | Screenshot 2024-03-07 at 3.50.48 pm.png | 134.84 KB | psebborn |
| #35 | Capture d’écran du 2024-03-05 08-08-08.png | 34.09 KB | nod_ |
Issue fork drupal-3332683
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bspeare commentedComment #5
gauravvvv commentedI have added before/after screenshots for reference. please review
Before patch

After patch

Comment #6
smustgrave commentedThink some more nesting could be done. Especially with the tree classes.
Comment #7
gauravvvv commentedComment #8
smustgrave commentedReran the tests and it seemed to be a random failure.
Nesting looks good
Comment #9
nod_@nest needs to be removed
Comment #12
mherchelI did some additional significant refactoring. This stylesheet is a pain because tabledrag is a pain.
When we test this, we need to be extremely thorough. When testing in Safari (16.1 but also verified in 16.4), I noticed a pre-existing issue where the table rows are overly large. This patch fixes this too.
In regards to the
@nestcomments above with @nod_, we're having a discussion at https://drupal.slack.com/archives/C1BMUQ9U6/p1681135929045969 on whether we should be using it.Still setting to NR since it definitely needs additional testing.
Comment #13
pradipmodh13 commentedApplied Patch. It's working fine.
For ref attached screenshot.
Comment #14
smustgrave commentedSeems rebase failed to apply.
Comment #15
mherchelJust merged 10.1.x into the branch, and didn't have any conflicts.
Comment #16
smustgrave commentedNow it looks good.
Comment #19
lauriiiThere's still a regression on Safari where the table rows have a lot of extra padding after row has been moved:
Comment #20
psebborn commentedPicking this up as part of the Claro Contribution day
Comment #21
psebborn commentedComment #22
psebborn commentedPushed a fix up for this to the existing MR, ready for review now.
Comment #23
psebborn commentedComment #25
smustgrave commentedThanks
Seems to have an order issue
themes/claro/css/components/tabledrag.css
266:3 ✖ Expected "float" to come before "flex-direction" order/properties-order
themes/claro/css/components/tabledrag.pcss.css
244:5 ✖ Expected "float" to come before "flex-direction" order/properties-order
2 problems (2 errors, 0 warnings)
Comment #26
psebborn commentedAh, my mistake. For some reason those errors weren't showing when running `yarn lint:css`. Fixed now and passing checks.
Comment #27
smustgrave commentedThanks for fixing that!
Comment #28
quietone commentedI'm triaging RTBC issues. I read the IS and the comments. I didn't find any unanswered questions or other work to do.
That is from #12. I see some test results in #19 but no other indication that this change has been thoroughly tested. Therefore, I am tagging for manual testing. I had to restore the standard issue template so I could add testing as a remaining task. Setting to Needs review for testing.
There are two MRs here. Can someone add to the issue summary which one is to be reviewed and hopefully close the other one. Thanks.
Comment #29
shweta__sharma commentedBoth the MR has same code the difference is one for against branch 10.1.x ( MR3517 ) and the other one for branch 11.x ( MR5829 )
Comment #31
smustgrave commentedSo I tested using the Table Drag test module in core.
Altered the route tabledrag_test.test_form to use the claro theme.
Everything appears to be lined up correctly.
I'm able to drag rows around without issue.
Highlighting appears to be the same with/without the MR.
Comment #32
nod_There is change in the th alignement with this patch see screenshot, suggestion in MR
Comment #33
gauravvvv commentedAddressed #32, Padding-inline-start: 0; was missing on draggable td,th.
Comment #34
smustgrave commentedBelieve I'm seeing the issue reported in #32 has been addressed.
Comment #35
nod_hierarchical indicator looks broken
Comment #36
psebborn commentedReplicated this issue in Firefox.
Fixed this and pushed it to the MR branch.
Tested in Firefox, Safari, Chrome (on Mac, don't have access to another machine right now)
Comment #37
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #39
mithun sAdded a rebase and resolved the merge conflicts. Please review.
Comment #40
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #41
vladimirausComment #42
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #43
quietone commentedComment #45
vladimirausComment #46
smustgrave commentedRebase seems good.
Comment #49
nod_Committed f1769fa and pushed to 11.x. Thanks!