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

Command icon 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

Stockfoot created an issue. See original summary.

bspeare’s picture

Version: 10.0.x-dev » 10.1.x-dev
royalpinto007’s picture

Assigned: Unassigned » royalpinto007
Status: Active » Needs work

royalpinto007’s picture

Assigned: royalpinto007 » Unassigned
Status: Needs work » Needs review

Changes 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.

royalpinto007’s picture

Assigned: Unassigned » royalpinto007
Status: Needs review » Needs work
royalpinto007’s picture

Status: Needs work » Needs review

Please review the latest commit with the original file.

Gauravvv made their first commit to this issue’s fork.

gauravvvv’s picture

Fixed CCF in #6, and refactored the code.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs screenshots

Since this changes the .css file can we please get some before/after screenshots.

Thanks!

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new51.95 KB
new63.05 KB

Added before and after patch screenshots. Please review
Before patch:

After patch:

royalpinto007’s picture

Assigned: royalpinto007 » Unassigned
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs screenshots

Thanks @Gauravvv

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Left a comment on the MR. This should be manually tested on RTL too since there's some CSS specific to RTL.

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new97.71 KB

Addressed feedback over MR.
Attached after patch screenshot for RTL. Please review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

nod_’s picture

Status: Reviewed & tested by the community » Needs work

The specificity of the selector is changed, there is no need to prefix the rules with .tablesort

sourabhjain made their first commit to this issue’s fork.

sourabhjain’s picture

Status: Needs work » Needs review

Removed unused . tablesort class.

nod_’s picture

another question in the MR

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems background-color was changed back so should be good now.

nod_’s picture

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.

nod_’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs screenshots

With screenshots too

mherchel’s picture

Status: Needs review » Needs work
StatusFileSize
new82.76 KB

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.

Good catch asking to check this. Because of the specificity of the [dir="rtl], the background image is showing above the mask-image in forced colors mode, making the arrow look kinda weird (as they're superimposed).

I'll push some code shortly.

mherchel’s picture

Status: Needs work » Needs review

Pushed a fix by flipping the .tablesort element. This also has the benefit of no longer needing the RTL version of the icon.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs screenshots
StatusFileSize
new27.83 KB
new24.16 KB

Uploading some screenshots

1

2

Everything looks good to me.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

amber himes matz’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

The 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!

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new9.75 KB

I 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 review

amber himes matz’s picture

@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.

smustgrave’s picture

Status: Needs review » Needs work

If the issue can be updated via the MR.

gauravvvv’s picture

Need to change the target branch, Author can change it to 11.x

shmy made their first commit to this issue’s fork.

shmy’s picture

As 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 a lint:css

shmy’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

MR should be updated to point to 11.x or hidden and a new MR for 11.x be placed.

shmy changed the visibility of the branch rebase-testing to hidden.

shmy changed the visibility of the branch 3332701-refactor-claros-tablesort-indicator to hidden.

shweta__sharma’s picture

Merge request pipeline failed.

shmy’s picture

Here are screenshots for renamed sort--inactive.svg image tables.pcss.css file:

Before (default):
Before (default)
After (default):
After (default)
Before (forced-colors):
Before (forced-colors)
After (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):
Before (RTL default)
After (RTL default):
After (RTL default)

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

Meeni_Dhobale made their first commit to this issue’s fork.

meeni_dhobale’s picture

I removed the @nest deprecated directive and solved the linting errors. Adding before and after screenshots.
RTL-Before

RTL-After

LTR-Before

LTR-After

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

This looks correct based on the numerous screenshots.

  • nod_ committed 9e0ed313 on 11.x
    Issue #3332701 by Gauravvvv, shmy, royalpinto007, Meeni_Dhobale,...
nod_’s picture

Status: Reviewed & tested by the community » Fixed

Committed 9e0ed31 and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.