Problem/Motivation

This is part of the CSS modernization initiative.

The first issue was regarding the form--password-confirm stylesheet.

Steps to reproduce

The stylesheet at https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/themes/claro/css/components/form--password-confirm.pcss.css needs to be refactored to make use of modern CSS and Drupal core's PostCSS tooling.

Proposed resolution

Use CSS Logical Properties where appropriate
Use CSS nesting where appropriate

Remaining tasks

We need two patches. One for Drupal 9.5.x and one for Drupal 10.0.x
We need a followup issue to refactor this component in Drupal 10.0.x to make use of component-level CSS custom properties.

User interface changes

None. There should be no visual differences.

Issue fork drupal-3294005

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sasanikolic created an issue. See original summary.

Aditya4478’s picture

Status: Active » Needs review
FileSize
4.37 KB

No block for IE in this file. It's good to go for review

anoopsingh92’s picture

Assigned: Unassigned » anoopsingh92
anoopsingh92’s picture

Assigned: anoopsingh92 » Unassigned
FileSize
69.55 KB

Hi @Aditya4478, I reviewed your patch #2. It is applying cleanly it looks good to me.

Lenovo@LAPTOP-PDE747K8 MINGW64 /c/xampp/htdocs/drupal-3294005 (9.5.x)
$ git apply -v 3294005-9.5.x.patch
Checking patch core/themes/claro/css/components/form--password-confirm.css...
Checking patch core/themes/claro/css/components/form--password-confirm.pcss.css...
Applied patch core/themes/claro/css/components/form--password-confirm.css cleanly.
Applied patch core/themes/claro/css/components/form--password-confirm.pcss.css cleanly.

Patch #2
Thanks for the patch.

Aditya4478’s picture

Version: 9.5.x-dev » 10.0.x-dev
FileSize
6.3 KB
Aditya4478’s picture

Version: 10.0.x-dev » 9.5.x-dev
FileSize
8.24 KB

Only nesting done with proper use of "&" . No scope for variable creation found. There is no IE block, so no removal needed. And since its 9.5.x version "rtl" statements are untouched.

Aditya4478’s picture

Version: 9.5.x-dev » 10.0.x-dev
FileSize
12.37 KB

Worked on "rtl" statements
Edited some CSS logical properties

Aditya4478’s picture

Consider #6 & #7 patches

sasanikolic’s picture

Status: Needs review » Needs work
  1. +++ b/core/themes/claro/css/components/form--password-confirm.css
    @@ -30,13 +30,13 @@
    -.js .password-confirm__confirm {
    ...
    +.password-confirm__confirm .js {
    

    This selector is not correct, as it's reversed. It should be .js .password-confirm__confirm.

  2. +++ b/core/themes/claro/css/components/form--password-confirm.css
    @@ -100,13 +122,12 @@
    -  .is-initial .password-strength__bar {
    ...
    +    .password-strength__bar .is-initial {
    

    Same as above, this is also turned around and it should be .is-initial .password-strength__bar.

  3. +++ b/core/themes/claro/css/components/form--password-confirm.css
    @@ -115,36 +136,19 @@
    +.password-strength__title .is-initial.is-password-empty {
    

    This selector should be .is-initial.is-password-empty .password-strength__title.
    Also, this should be in the media query.

Sakthivel M’s picture

Status: Needs work » Needs review
FileSize
13.06 KB

#10 Please review the patch

Aditya4478’s picture

FileSize
11.13 KB

#9 changes included except media query (3rd).

Used & at last in nesting. You corrected me once not to use at last, but here it seems everything working. So ....

sasanikolic’s picture

Status: Needs review » Needs work
+++ b/core/themes/claro/css/components/form--password-confirm.css
@@ -97,9 +97,31 @@
+  /* Password strength states */

We need to look into that compilation process of the comments - this doesn't belong in here but above the other nested definition.

Sakthivel M’s picture

#11 Patch failed

Image

Sakthivel M’s picture

Status: Needs work » Needs review
FileSize
10.4 KB

#14 Please review the patch

Including #12 comments

ckrina’s picture

ckrina’s picture

Issue summary: View changes
smustgrave’s picture

Version: 10.0.x-dev » 10.1.x-dev
Status: Needs review » Needs work

This issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 200, following Review a patch or merge require as a guide.

Running #14 against 10.1 as I think we missed the boat for 10.0

Verified the form-password by creating a user and filling in the password field.

The suggestions appear correct and all styling around the password.

+1 for RTBC

Am moving back to NW because this was initially tagged for a followup and don't know what that's for. (maybe not needed)

Gauravvvv’s picture

Status: Needs work » Needs review
FileSize
9.72 KB
4.73 KB

Updated short-hand properties. Please review

smustgrave’s picture

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

This will need screenshots since .css changed.

Gauravvvv’s picture

Status: Needs work » Needs review
FileSize
109.66 KB
113.4 KB

I have added before/after patch screenshots. please review

Before patch

After patch

smustgrave’s picture

Status: Needs review » Needs work
.js .is-initial:not(.form-item--error) .form-item__description {
  margin-block-start: 0;
}

.js .is-initial.is-password-empty.is-confirm-empty:not(.form-item--error) .password-confirm__confirm {
  display: none;
  max-block-size: 0;
  margin-block-start: 0;
}
.password-strength__bar.is-weak {
  border-color: var(--password-strength-bar--weak-border-color);
  background-color: var(--password-strength-bar--weak-bg-color);
}

.password-strength__bar.is-fair {
  border-color: var(--password-strength-bar--fair-border-color);
  background-color: var(--password-strength-bar--fair-bg-color);
}

.password-strength__bar.is-good {
  border-color: var(--password-strength-bar--good-border-color);
  background-color: var(--password-strength-bar--good-bg-color);
}

.password-strength__bar.is-strong {
  border-color: var(--password-strength-bar--strong-border-color);
  back

More nesting can be done.

Gauravvvv’s picture

Status: Needs work » Needs review
FileSize
11.52 KB
4.74 KB

Addressed #21, Attached patch and interdiff. please review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs screenshots
FileSize
71.32 KB
74.42 KB

before

After

after

Nesting looks better
Adding some screenshots to show nothing broke.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/themes/claro/css/components/form--password-confirm.pcss.css
    @@ -45,14 +45,16 @@
    +.js .is-initial {
    +  &:not(.form-item--error) .form-item__description {
    ...
    +  &.is-password-empty.is-confirm-empty:not(.form-item--error) .password-confirm__confirm {
    

    These selectors are really hard to read, and I think nesting them like this makes them even harder 😐 Unless we can figure out how to make them read better, I would probably prefer reverting these lines back to the original code.

  2. +++ b/core/themes/claro/css/components/form--password-confirm.pcss.css
    @@ -141,17 +165,14 @@
    +  .password-strength__bar {
    +    @nest .is-initial & {
    

    This should be merged with the rule above this.

  3. We should also rename the custom properties to follow our new standards for custom property naming conventions. For example, we should remove the double dashes from the custom property names.
Gauravvvv’s picture

Status: Needs work » Needs review
FileSize
14.67 KB
8.84 KB

Addressed #24, attached patch and interdiff for same. please review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
110.42 KB

See attached screenshot. Using claro test module and didn't see anything break.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 25: 3294005-25.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community

Seems random failure

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 25: 3294005-25.patch, failed testing. View results

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

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community

Random failure.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 25: 3294005-25.patch, failed testing. View results

nod_’s picture

Status: Needs work » Reviewed & tested by the community
nod_’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs followup

  • nod_ committed f43ee842 on 10.1.x
    Issue #3294005 by Aditya4478, Gauravvvv, Sakthivel M, smustgrave,...

Status: Fixed » Closed (fixed)

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