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 |
|---|---|---|---|
| #10 | Screenshot 2023-04-13 at 12.18.25 PM.png | 153.56 KB | santosh_verma |
| #10 | Screenshot 2023-04-13 at 12.17.49 PM.png | 355.82 KB | santosh_verma |
| #8 | interdiff-2_8.txt | 2.31 KB | gauravvvv |
| #8 | 3332737-8.patch | 3.99 KB | gauravvvv |
| #4 | Screen Shot 2023-02-28 at 12.39.35 PM.png | 497.53 KB | smustgrave |
Comments
Comment #2
gauravvvv commentedI have refactored the
views_ui.admin.pcss.cssfile. I have improved nesting in the file.Output: In the CSS file
views_ui.admin.cssthere is only small change that too re-positioning on some CSS. Please reviewComment #3
bspeare commentedComment #4
smustgrave commentedReviewed #2
Change for nesting looks good. Attaching views ui screenshot to show nothing appears broken.
Comment #6
smustgrave commentedRandom failure 1) Drupal\Tests\media\FunctionalJavascript\MediaSourceFileTest::testMediaFileSource
Comment #7
nod_Nesting looks good, can we use logical properties? seems like it would help here
Comment #8
gauravvvv commentedUpdated patch with logical properties. Attached interdiff for same.
Comment #9
gauravvvv commentedComment #10
santosh_verma commentedTested the Patch #8,
Nesting and logical properties both are looking good to me.
patch applied cleanly, tested the UI manually nothing look like broken.
RTBC +
Comment #11
nod_If you feel it's RTBC you can change the issues status to RTBC :)
Comment #13
nod_Committed d4ddbd2 and pushed to 10.1.x. Thanks!