Skip to content

Commit

Permalink
fix(styles): input and select disabled placeholder [ci visual]
Browse files Browse the repository at this point in the history
  • Loading branch information
N1XUS committed Oct 27, 2023
1 parent 7b9fc95 commit 004b2c1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/styles/src/mixins/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ $fd-input-field-height--compact: 1.625rem;

@if ($supportsText) {
&::placeholder {
opacity: 0;
color: var(--fdInput_Non_Interactive_State_Placeholder_Color);
}
}
Expand All @@ -249,6 +250,7 @@ $fd-input-field-height--compact: 1.625rem;

@if ($supportsText) {
&::placeholder {
opacity: 0;
color: var(--fdInput_Non_Interactive_State_Placeholder_Color);
}
}
Expand Down
14 changes: 14 additions & 0 deletions packages/styles/src/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,25 @@ $fd-select-padding-x-compact: 0.5rem;
--fdSelect_Min_Width: 5rem;
}

&[aria-selected='false'] {
.#{$block}__text-content {
visibility: hidden;
}
}

.#{$block}__button {
opacity: 0;
}
}

@include fd-disabled() {
&[aria-selected='false'] {
.#{$block}__text-content {
visibility: hidden;
}
}
}

&[aria-selected='false'] {
.#{$block}__text-content {
font-style: italic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<br />
<div class="fd-form-item">
<label class="fd-form-label" for="input-05">Disabled Input:</label>
<input class="fd-input" type="text" id="input-05" disabled value="Field placeholder text" placeholder="Field placeholder text">
<input class="fd-input" type="text" id="input-05" disabled placeholder="Field placeholder text">
</div>
<br />
<div class="fd-form-item">
Expand Down
4 changes: 2 additions & 2 deletions packages/styles/stories/Components/select/cozy.example.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
</div>

<div style="height: 100px">
<label class="fd-form-label" id="cozySelectLabel">Disabled, Placeholder text</label><br />
<label class="fd-form-label" id="cozySelectLabel">In disabled state placeholder should not be visible</label><br />
<div class="fd-popover">
<div class="fd-popover__control" aria-expanded="false" aria-haspopup="true">
<div class="fd-select">
Expand All @@ -137,7 +137,7 @@
</div>

<div style="height: 100px">
<label class="fd-form-label" id="cozySelectLabel">Read Only, Placeholder text</label><br />
<label class="fd-form-label" id="cozySelectLabel">In read-only state placeholder should not be visible</label><br />
<div class="fd-popover">
<div class="fd-popover__control" aria-expanded="false" aria-haspopup="true">
<div class="fd-select">
Expand Down

0 comments on commit 004b2c1

Please sign in to comment.