Skip to content

Instantly share code, notes, and snippets.

@joekolade
Created March 14, 2023 14:48
Show Gist options
  • Select an option

  • Save joekolade/bea5e5364c371cce0b3e7fc08cf14aa6 to your computer and use it in GitHub Desktop.

Select an option

Save joekolade/bea5e5364c371cce0b3e7fc08cf14aa6 to your computer and use it in GitHub Desktop.
[Selectbox CSS]
// @see https://www.macrone.de/das-html-select-element-pure-css-styling/
$base-padding: 8px;
select {
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
&::-ms-expand {
display: none;
}
border-radius: 0;
width: 100%;
padding: $base-padding $base-padding * 2;
background:
url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20276.7%20153%22%20enable-background%3D%22new%200%200%20276.7%20153%22%3E%3Cstyle%3E.arrow%7Bfill%3A%23###ARROWCOLORHEX###%3B%7D%3C%2Fstyle%3E%3Cpath%20class%3D%22arrow%22%20d%3D%22M276.7%200H0l138.2%20153z%22%20%2F%3E%3C%2Fsvg%3E)
no-repeat
calc(100% - #{$base-padding}) center
;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment