Skip to content

Commit

Permalink
fix(select): set correct arrow color for disabled and readonly states
Browse files Browse the repository at this point in the history
  • Loading branch information
apust committed Dec 24, 2020
1 parent 957c5b2 commit 0dfd3ba
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 20 deletions.
13 changes: 13 additions & 0 deletions src/packages/core/src/select/select.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,16 @@
}
}
}

._e_input_appearance_readonly {
& ._e_select__arrow {
display: none;
}
}


._e_input_appearance_disabled {
& ._e_select__arrow svg {
fill: var(--N100);
}
}
90 changes: 70 additions & 20 deletions src/packages/core/src/select/select.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,71 @@
<div class="_e_input _e_input_size_6 _e_select">
<label class="_e_input__field">
<select class="_e_input__control" required>
<option value=""></option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
<span class="_e_input__label">Label</span>
<span class="_e_input__background"></span>
<span class="_e_input__line"></span>
<div class="_e_input__icon _e_input__icon_passive">
<div class="_e_select__arrow">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path id="icon/navigation/arrow_drop_down_24px" d="M8.33031 11.8617L11.2159 14.6815C11.6504 15.1062 12.3523 15.1062 12.7868 14.6815L15.6724 11.8617C16.3743 11.1758 15.873 10 14.8814 10H9.11021C8.11863 10 7.62841 11.1758 8.33031 11.8617Z" />
</svg>
<p>
<div class="_e_input _e_input_size_6 _e_select">
<label class="_e_input__field">
<select class="_e_input__control" required>
<option value=""></option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
<span class="_e_input__label">Label</span>
<span class="_e_input__background"></span>
<span class="_e_input__line"></span>
<div class="_e_input__icon _e_input__icon_passive">
<div class="_e_select__arrow">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path id="icon/navigation/arrow_drop_down_24px" d="M8.33031 11.8617L11.2159 14.6815C11.6504 15.1062 12.3523 15.1062 12.7868 14.6815L15.6724 11.8617C16.3743 11.1758 15.873 10 14.8814 10H9.11021C8.11863 10 7.62841 11.1758 8.33031 11.8617Z" />
</svg>
</div>
</div>
</div>
</label>
<span class="_e_input__hint">Hint</span>
</div>
</label>
<span class="_e_input__hint">Hint</span>
</div>
</p>

<p>
<div class="_e_input _e_input_size_6 _e_input_appearance_readonly _e_select">
<label class="_e_input__field">
<select class="_e_input__control" required disabled>
<option value=""></option>
<option value="1">Option 1</option>
<option value="2" selected="selected">Option 2</option>
<option value="3">Option 3</option>
</select>
<span class="_e_input__label">Label</span>
<span class="_e_input__background"></span>
<span class="_e_input__line"></span>
<div class="_e_input__icon _e_input__icon_passive">
<div class="_e_select__arrow">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path id="icon/navigation/arrow_drop_down_24px" d="M8.33031 11.8617L11.2159 14.6815C11.6504 15.1062 12.3523 15.1062 12.7868 14.6815L15.6724 11.8617C16.3743 11.1758 15.873 10 14.8814 10H9.11021C8.11863 10 7.62841 11.1758 8.33031 11.8617Z" />
</svg>
</div>
</div>
</label>
<span class="_e_input__hint">Hint</span>
</div>
</p>

<p>
<div class="_e_input _e_input_size_6 _e_input_appearance_disabled _e_select">
<label class="_e_input__field">
<select class="_e_input__control" required disabled>
<option value=""></option>
<option value="1">Option 1</option>
<option value="2" selected="selected">Option 2</option>
<option value="3">Option 3</option>
</select>
<span class="_e_input__label">Label</span>
<span class="_e_input__background"></span>
<span class="_e_input__line"></span>
<div class="_e_input__icon _e_input__icon_passive">
<div class="_e_select__arrow">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path id="icon/navigation/arrow_drop_down_24px" d="M8.33031 11.8617L11.2159 14.6815C11.6504 15.1062 12.3523 15.1062 12.7868 14.6815L15.6724 11.8617C16.3743 11.1758 15.873 10 14.8814 10H9.11021C8.11863 10 7.62841 11.1758 8.33031 11.8617Z" />
</svg>
</div>
</div>
</label>
<span class="_e_input__hint">Hint</span>
</div>
</p>

0 comments on commit 0dfd3ba

Please sign in to comment.