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 |
|---|---|---|---|
| #12 | Screenshot 2023-02-23 at 10.52.49 AM.png | 315.91 KB | gauravvvv |
| #5 | Screenshot 2023-02-15 at 4.49.27 PM.png | 390.59 KB | gauravvvv |
| #5 | Screenshot 2023-02-15 at 4.49.04 PM.png | 392.06 KB | gauravvvv |
Issue fork drupal-3332469
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 commentedThere should be no visual differences. here is the before and after patch screenshot. Please review
Before patch:
After patch:
Comment #6
smustgrave commentedhaha like you knew I was going to ask for screenshots!
Everything looks good.
Nesting seems correct and I don't see any hardcoded values
Comment #7
lauriiiPosted some feedback on the MR. Thank you for working on these issues! 😊
Comment #8
gauravvvv commentedComment #9
smustgrave commentedAppears the changes requested have been implemented.
Comment #10
lauriiiThere are some styles RTL styles that are depending on #3332461: Refactor Claro's system-admin--status-report stylesheet. I'm wondering if we should merge these two issues so that we can make sure everything works as expected?
Comment #11
smustgrave commentedClosed #3332461: Refactor Claro's system-admin--status-report stylesheet so work there should be combined here. Didn't need to move credit as they are already here.
Comment #12
gauravvvv commentedMerged
system-admin--status-report.cssandsystem-status-report.cssPlease reviewAfter patch

Comment #13
smustgrave commentedThanks for the quick turnaround!
Comment #14
nod_need rebasing
Comment #16
rassoni commentedRebase the branch. Please review.
Comment #17
smustgrave commentedRebase look good.
Comment #19
nod_Patch fixes some layout issues in RTL, nice.
Committed 2f8c703 and pushed to 10.1.x. Thanks!