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 CreditAttribution: Gauravvvv at Axelerant for Drupal India Association commentedComment #5
smustgrave CreditAttribution: smustgrave at Mobomo commentedAppears to have issues in the MR.
Comment #6
Gauravvvv CreditAttribution: Gauravvvv at Axelerant for Drupal India Association commentedComment #7
Gauravvvv CreditAttribution: Gauravvvv at Axelerant for Drupal India Association commentedComment #8
smustgrave CreditAttribution: smustgrave at Mobomo commentedthink more nesting could be done here.
Comment #9
Gauravvvv CreditAttribution: Gauravvvv at Axelerant for Drupal India Association commentedAddressed #8, make few more changes. Attached patch, interdiff and after patch screenshot. please review
After patch
Comment #10
smustgrave CreditAttribution: smustgrave at Mobomo 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 CreditAttribution: Gauravvvv at Axelerant for Drupal India Association commentedAddressed #11, attached patch and interdiff for same. please review
Comment #13
smustgrave CreditAttribution: smustgrave at Mobomo 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 CreditAttribution: Gauravvvv at Axelerant for Drupal India Association commentedUpdating status. Still showing RTBC.