
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.
Issue fork drupal-3332701
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 CreditAttribution: bspeare commentedComment #3
royalpinto007Comment #5
royalpinto007Changes done:
- Replaced physical properties (left, right, etc.) with their logical equivalents (inline-start, inline-end, etc.)
- Combined multiple tablesort classes into one
If you have any feedback or questions, please let me know.
I would also like to contribute further by solving additional issues to align with the latest coding standards, if this works.
Comment #6
royalpinto007Comment #7
royalpinto007Please review the latest commit with the original file.
Comment #9
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedFixed CCF in #6, and refactored the code.
Comment #10
smustgrave CreditAttribution: smustgrave commentedSince this changes the .css file can we please get some before/after screenshots.
Thanks!
Comment #11
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedAdded before and after patch screenshots. Please review

Before patch:
After patch:

Comment #12
royalpinto007Comment #13
smustgrave CreditAttribution: smustgrave commentedThanks @Gauravvv
Comment #14
lauriiiLeft a comment on the MR. This should be manually tested on RTL too since there's some CSS specific to RTL.
Comment #15
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedAddressed feedback over MR.
Attached after patch screenshot for RTL. Please review
Comment #16
smustgrave CreditAttribution: smustgrave commentedThanks!
Comment #17
nod_The specificity of the selector is changed, there is no need to prefix the rules with
.tablesort
Comment #19
sourabhjainRemoved unused . tablesort class.
Comment #20
nod_another question in the MR
Comment #21
smustgrave CreditAttribution: smustgrave commentedSeems background-color was changed back so should be good now.
Comment #22
nod_Need someone to test on windows in high contrast mode with a LTR and a RTL language to make sure the changes here work as intended.
Comment #23
nod_With screenshots too
Comment #24
mherchelGood catch asking to check this. Because of the specificity of the
[dir="rtl]
, the background image is showing above themask-image
in forced colors mode, making the arrow look kinda weird (as they're superimposed).I'll push some code shortly.

Comment #25
mherchelPushed a fix by flipping the
.tablesort
element. This also has the benefit of no longer needing the RTL version of the icon.Comment #26
smustgrave CreditAttribution: smustgrave commentedUploading some screenshots
Everything looks good to me.
Comment #28
amber himes matzThe MR is currently blocked and needs to be rebased. Also, the version on the issue is 11.x-dev but the target branch on the MR is 10.1.x, so maybe the target branch on the MR needs to be updated as well? Just a bit of git-related cleanup required before this can be reviewed by a committer. Thank you!
Comment #29
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedI have added patch for 11.x. Also I have made changes in
core/themes/claro/css/components/tables.pcss.css
file, as we have renamed the sort-inactive icon. I have updated the name here as well. please reviewComment #30
amber himes matz@Gauravvvv Thanks for your attention to the “Needs reroll” tag, but this issue appears to be using an MR-based workflow, not a patch workflow. I realize that the “Needs reroll” tag could be confusing, when what is needed is a rebase on the merge request, not a patch file. Please refer to the docs on rebasing a merge request: https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr...
Also, it does look like there are a number of unresolved threads in the MR that should be marked as resolved if the feedback has been addressed.
Comment #31
smustgrave CreditAttribution: smustgrave commentedIf the issue can be updated via the MR.
Comment #32
gauravvvv CreditAttribution: gauravvvv at Axelerant for Drupal India Association commentedNeed to change the target branch, Author can change it to 11.x
Comment #34
shmy CreditAttribution: shmy commentedAs the rebase on 3332701-refactor-claros-tablesort-indicator is broken i did a new one on rebase-testing (sorry for the poor name). Someone who actually worked on the code should review the result. I run the
build:css
script during every merge conflict resolution and after the final one alint:css
Comment #35
shmy CreditAttribution: shmy commentedComment #36
smustgrave CreditAttribution: smustgrave commentedMR should be updated to point to 11.x or hidden and a new MR for 11.x be placed.
Comment #40
shweta__sharma CreditAttribution: shweta__sharma at OpenSense Labs commentedMerge request pipeline failed.
Comment #41
shmy CreditAttribution: shmy commentedHere are screenshots for renamed
sort--inactive.svg
image tables.pcss.css file:Before (default):




After (default):
Before (forced-colors):
After (forced-colors):
The :is() selector doesn't work for me in neither Firefox or Chromium. I haven't worked with PostCSS before and i don't get why its added there. The following screenshots are made w/o the
:is()
selector as there is no difference for me when set. I don't know if this is a different issue or i'm making something wrong.Before (RTL default):


After (RTL default):
Before (RTL forced-colors):


After (RTL forced-colors):
Comment #43
meeni_dhobale CreditAttribution: meeni_dhobale as a volunteer and at QED42 commentedI removed the @nest deprecated directive and solved the linting errors. Adding before and after screenshots.




RTL-Before
RTL-After
LTR-Before
LTR-After
Comment #44
smustgrave CreditAttribution: smustgrave commentedThis looks correct based on the numerous screenshots.
Comment #46
nod_Committed 9e0ed31 and pushed to 11.x. Thanks!