Skip to content

Commit

Permalink
pixel perfect selector arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
rushatgabhane committed Feb 1, 2024
1 parent a2bd84b commit 68bd583
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docs/_includes/selector.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% assign values = include.values | split: "," %}

<div class="selector">
<select class="platform" onchange="selectOption(this)">
<div class="selector-container">

<select class="selector" onchange="selectOption(this)">
{% for value in values %}
<option value="option-{{ value | strip | downcase }}">{{ value | strip | capitalize }}</option>
{% endfor %}
Expand Down
17 changes: 14 additions & 3 deletions docs/_sass/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ button {
}
}

.selector {
.selector-container {
background-color: $color-highlightBG;
display: flex;
flex-direction: row-reverse;
Expand All @@ -476,11 +476,22 @@ button {
select {
height: 28px;
border-radius: 20px;
padding: 0px 12px;
background-color: $color-button-background;
padding: 0px 26px 0px 12px;
color: $color-text;
font-size: 11px;
font-weight: 700;
text-align: center;
cursor: pointer;

appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
}

select {
background: url("/assets/images/down.svg") no-repeat right $color-button-background;
background-size: 12px;
background-position-x: 85%;
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ function selectOption(s) {
});
}

window.onload = selectOption(document.getElementsByClassName('platform')[0]);
window.onload = selectOption(document.getElementsByClassName('selector')[0]);

0 comments on commit 68bd583

Please sign in to comment.