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
User interface changes
None. There should be no visual differences.
Please post before/after screenshots and make sure they look the same.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Screen Shot 2023-03-13 at 12.28.27 PM.png | 228.12 KB | smustgrave |
| #13 | Screen Shot 2023-03-13 at 12.28.17 PM.png | 183.15 KB | smustgrave |
| #12 | interdiff-9_12.txt | 4.34 KB | gauravvvv |
| #12 | 3332419-12.patch | 9.36 KB | gauravvvv |
| #9 | Screenshot 2023-03-01 at 11.54.55 AM.png | 379.63 KB | gauravvvv |
Issue fork drupal-3332419
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 #4
gauravvvv commentedComment #5
smustgrave commentedAppears to have issues in the MR.
Comment #6
gauravvvv commentedComment #7
gauravvvv commentedComment #8
smustgrave commentedthink more nesting could be done here.
Comment #9
gauravvvv commentedAddressed #8, make few more changes. Attached patch, interdiff and after patch screenshot. please review
After patch

Comment #10
smustgrave commentedNesting seems good now
Comment #11
lauriiiThis would probably be easier to read if we combined these with the similar selectors few lines above to something like this:
Comment #12
gauravvvv commentedAddressed #11, attached patch and interdiff for same. please review
Comment #13
smustgrave commentedHere's a few screenshots but appears everything is still functional
Comment #15
nod_Comment #16
nod_Works fine for RTL, keeping @nest is ok. As explained by mherchel, there will be an automated way to move to the new syntax.
Committed 7cb4919 and pushed to 10.1.x. Thanks!
Comment #18
gauravvvv commentedUpdating status. Still showing RTBC.