Skip to content

Commit

Permalink
fix(PasswordInput): resolve visibility toggle style issues (#8673)
Browse files Browse the repository at this point in the history
* fix(password-input): increase visibility toggle focus specificity

* fix(password-input): position visibility toggle for md and lg  sizes
  • Loading branch information
emyarod authored May 13, 2021
1 parent b00113e commit ed86983
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions packages/components/src/components/text-input/_text-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@
padding-right: $carbon--spacing-08;
}

.#{$prefix}--text-input--sm.#{$prefix}--password-input {
padding-right: $carbon--spacing-07;
}

.#{$prefix}--text-input--lg.#{$prefix}--password-input {
padding-right: $carbon--spacing-09;
}

.#{$prefix}--text-input::placeholder {
@include placeholder-colors;
}
Expand Down Expand Up @@ -110,7 +118,7 @@
right: 0;
display: flex;
width: rem(40px);
height: rem(40px);
height: 100%;
min-height: auto;
align-items: center;
justify-content: center;
Expand All @@ -121,6 +129,16 @@
transition: outline $duration--fast-01 motion(standard, productive);
}

.#{$prefix}--text-input--sm
+ .#{$prefix}--btn.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger {
width: rem(32px);
}

.#{$prefix}--text-input--lg
+ .#{$prefix}--btn.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger {
width: rem(48px);
}

.#{$prefix}--btn.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger
svg {
fill: $icon-secondary;
Expand All @@ -134,7 +152,7 @@
}
}

.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger:focus {
.#{$prefix}--btn.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger:focus {
@include focus-outline('outline');
}

Expand Down

0 comments on commit ed86983

Please sign in to comment.