-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/23-custom-select'
- Loading branch information
Showing
53 changed files
with
404 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
@if ($illusion-form == true and $illusion-custom-select != false) or $illusion-custom-select == true { | ||
|
||
/* Highly based on https://github.com/filamentgroup/select-css */ | ||
|
||
// Custom select container | ||
.custom-select { | ||
position: $illusion-custom-select-position; | ||
display: $illusion-custom-select-display; | ||
} | ||
|
||
// Native select invisible except for content | ||
.custom-select select { | ||
width: $illusion-custom-select-width; | ||
margin: $illusion-custom-select-margin; | ||
padding: $illusion-custom-select-padding; | ||
outline: $illusion-custom-select-outline; | ||
height: $illusion-custom-select-height; | ||
box-sizing: $illusion-custom-select-box-sizing; | ||
font-size: $illusion-custom-select-font-size; | ||
} | ||
|
||
// Custom arrow | ||
.custom-select:after { | ||
content: $illusion-custom-select-arrow-content; | ||
position: $illusion-custom-select-arrow-position; | ||
top: $illusion-custom-select-arrow-top; | ||
right: $illusion-custom-select-arrow-right; | ||
z-index: $illusion-custom-select-arrow-z-index; | ||
pointer-events: $illusion-custom-select-arrow-pointer-events; | ||
width: $illusion-custom-select-arrow-width; | ||
height: $illusion-custom-select-arrow-height; | ||
border-left: $illusion-custom-select-arrow-border-horizontal; | ||
border-right: $illusion-custom-select-arrow-border-horizontal; | ||
border-top: $illusion-custom-select-arrow-border-top; | ||
margin-top: $illusion-custom-select-arrow-margin-top; | ||
display: none; | ||
} | ||
|
||
// Custom styling when appearance is supported | ||
/* autoprefixer: ignore next */ | ||
@supports (-webkit-appearance: none) or (appearance: none) or ((-moz-appearance: none) and (mask-type: alpha)) { | ||
|
||
// Display custom arrow | ||
/* autoprefixer: on */ | ||
.custom-select:after { | ||
display: $illusion-custom-select-arrow-display; | ||
} | ||
|
||
// Select styling | ||
.custom-select select { | ||
padding-right: $illusion-custom-select-padding-right; | ||
background: none; | ||
appearance: none; | ||
} | ||
} | ||
|
||
// IE 10/11+ - This hides native dropdown button arrow so it will have the custom appearance. | ||
// Targeting media query hack via http://browserhacks.com/#hack-28f493d247a12ab654f6c3637f6978d5 | ||
|
||
// The second rule removes the odd blue bg color behind the text in the select button in IE 10/11 and sets the text color to match the focus style's | ||
// fix via http://stackoverflow.com/questions/17553300/change-ie-background-color-on-unopened-focused-select-box */ | ||
|
||
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | ||
|
||
// Hide native arrow | ||
.custom-select select::-ms-expand { | ||
display: none; | ||
} | ||
|
||
.custom-select select:focus::-ms-value { | ||
background: $illusion-custom-select-ms-focus-background; | ||
color: $illusion-custom-select-ms-focus-color; | ||
} | ||
|
||
// Display custom arrow | ||
.custom-select:after { | ||
display: $illusion-custom-select-arrow-display; | ||
} | ||
|
||
// Styling select | ||
.custom-select select { | ||
padding-right: $illusion-custom-select-padding-right; // make room for the arrow | ||
background: none; | ||
} | ||
} | ||
|
||
@if ($illusion-custom-select-theme != false) or $illusion-custom-select-theme == true { | ||
// Theming custom-select | ||
.custom-select { | ||
border: $illusion-custom-select-border; | ||
} | ||
|
||
.custom-select select { | ||
font-family: $illusion-custom-select-font-family; | ||
font-weight: $illusion-custom-select-font-weight; | ||
color: $illusion-custom-select-color; | ||
border: none; | ||
line-height: $illusion-custom-select-line-height; | ||
padding-top: $illusion-custom-select-padding-top; | ||
padding-bottom: $illusion-custom-select-padding-bottom; | ||
padding-left: $illusion-custom-select-padding-left; | ||
} | ||
|
||
// Focus style | ||
.custom-select select:focus { | ||
&:focus { | ||
outline: $illusion-custom-select-focus-outline; | ||
outline-offset: $illusion-custom-select-focus-outline-offset; | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.