Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make password text easier to read when toggled #4591

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

huwshimi
Copy link
Contributor

@huwshimi huwshimi commented Oct 17, 2022

Done

  • Improve the legibility of readonly passwords that have been displayed via the password toggle component.

Fixes #3975.

QA

  • Open the password toggle example
  • Inspect one of the inputs and add readonly to the input element.
  • You should see the dots in the password field become light grey.
  • Click the show button and the password should be displayed and the text should be the same as the default text colour.

Check if PR is ready for release

If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 馃巵, Breaking Change 馃挘, Bug 馃悰, Documentation 馃摑, Maintenance 馃敤.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention:
    • if CSS class names are not changed it can be bugfix relesase (x.x.X)
    • if CSS class names are changed/added/removed it should be minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) should be listed on the what's new page.
  • Documentation side navigation should be updated with the relevant labels.

Screenshots

Hidden:

Screen Shot 2022-10-17 at 1 53 42 pm

Visible:

Screen Shot 2022-10-17 at 1 53 51 pm

@webteam-app
Copy link

Demo starting at https://vanilla-framework-4591.demos.haus

// immediately follows the .p-form-password-toggle element.
.p-form-password-toggle + [type='text'] {
&[readonly],
&[readonly='readonly'] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the previous line &[readonly] enough to cover the cases where readonly attribute is present with any value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my quick tests it did seem to work with just [readonly] but the base forms target both so I thought I better include both here so that there weren't any potential specificity clashes: https://github.com/canonical/vanilla-framework/blob/main/scss/_base_forms.scss#L52.

I'm happy to change that to [readonly] if you think that'd be fine.

Copy link
Contributor

@bartaz bartaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a small comment on possibly redundant selector.

@bartaz bartaz merged commit 2574a30 into canonical:main Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Password toggle + readonly attribute makes the password hard to read
3 participants