2016-01-06 09:00:08 +01:00
|
|
|
// scss-lint:disable PropertyCount
|
|
|
|
|
2014-12-24 13:13:23 +01:00
|
|
|
// Embedded icons from Open Iconic.
|
|
|
|
// Released under MIT and copyright 2014 Waybury.
|
|
|
|
// http://useiconic.com/open
|
|
|
|
|
2015-04-18 20:17:32 +02:00
|
|
|
|
2014-12-24 13:13:23 +01:00
|
|
|
// Checkboxes and radios
|
2014-12-24 13:47:08 +01:00
|
|
|
//
|
|
|
|
// Base class takes care of all the key behavioral aspects.
|
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-control {
|
2014-12-26 00:40:24 +01:00
|
|
|
position: relative;
|
|
|
|
display: inline;
|
2016-01-17 07:29:51 +01:00
|
|
|
padding-left: $custom-control-gutter;
|
2014-12-26 00:40:24 +01:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
+ .custom-control {
|
2016-01-17 07:29:51 +01:00
|
|
|
margin-left: $custom-control-spacer-x;
|
2016-01-06 08:25:42 +01:00
|
|
|
}
|
|
|
|
}
|
2014-12-26 00:40:24 +01:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-control-input {
|
|
|
|
position: absolute;
|
|
|
|
z-index: -1; // Put the input behind the label so it doesn't overlay text
|
|
|
|
opacity: 0;
|
2014-12-26 00:40:24 +01:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
&:checked ~ .custom-control-indicator {
|
2016-01-17 07:29:51 +01:00
|
|
|
color: $custom-control-checked-indicator-color;
|
|
|
|
background-color: $custom-control-checked-indicator-bg;
|
|
|
|
@include box-shadow($custom-control-checked-indicator-box-shadow);
|
2016-01-06 08:25:42 +01:00
|
|
|
}
|
2015-08-21 22:21:20 +02:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
&:focus ~ .custom-control-indicator {
|
|
|
|
// the mixin is not used here to make sure there is feedback
|
2016-01-17 07:29:51 +01:00
|
|
|
box-shadow: $custom-control-focus-indicator-box-shadow;
|
2014-12-26 00:40:24 +01:00
|
|
|
}
|
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
&:active ~ .custom-control-indicator {
|
2016-01-17 07:29:51 +01:00
|
|
|
color: $custom-control-active-indicator-color;
|
|
|
|
background-color: $custom-control-active-indicator-bg;
|
|
|
|
@include box-shadow($custom-control-active-indicator-box-shadow);
|
2016-01-06 08:25:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
~ .custom-control-indicator {
|
2016-01-17 07:29:51 +01:00
|
|
|
cursor: $custom-control-disabled-cursor;
|
|
|
|
background-color: $custom-control-disabled-indicator-bg;
|
2016-01-06 08:25:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
~ .custom-control-description {
|
2016-01-17 07:29:51 +01:00
|
|
|
color: $custom-control-disabled-description-color;
|
|
|
|
cursor: $custom-control-disabled-cursor;
|
2016-01-06 08:25:42 +01:00
|
|
|
}
|
2014-12-26 00:40:24 +01:00
|
|
|
}
|
2014-12-24 13:13:23 +01:00
|
|
|
}
|
|
|
|
|
2014-12-24 13:47:08 +01:00
|
|
|
// Custom indicator
|
|
|
|
//
|
|
|
|
// Generates a shadow element to create our makeshift checkbox/radio background.
|
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-control-indicator {
|
2014-12-26 00:40:24 +01:00
|
|
|
position: absolute;
|
2016-01-06 08:25:42 +01:00
|
|
|
top: .0625rem;
|
2014-12-26 00:40:24 +01:00
|
|
|
left: 0;
|
|
|
|
display: block;
|
2016-01-17 07:29:51 +01:00
|
|
|
width: $custom-control-indicator-size;
|
|
|
|
height: $custom-control-indicator-size;
|
2016-01-19 02:33:00 +01:00
|
|
|
pointer-events: none;
|
2014-12-26 00:40:24 +01:00
|
|
|
user-select: none;
|
2016-01-17 07:29:51 +01:00
|
|
|
background-color: $custom-control-indicator-bg;
|
2014-12-26 00:40:24 +01:00
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: center center;
|
2016-01-17 07:29:51 +01:00
|
|
|
background-size: $custom-control-indicator-bg-size;
|
|
|
|
@include box-shadow($custom-control-indicator-box-shadow);
|
2014-12-24 13:13:23 +01:00
|
|
|
}
|
|
|
|
|
2014-12-24 13:47:08 +01:00
|
|
|
// Checkboxes
|
|
|
|
//
|
|
|
|
// Tweak just a few things for checkboxes.
|
2014-12-24 13:13:23 +01:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-checkbox {
|
|
|
|
.custom-control-indicator {
|
2016-01-17 07:29:51 +01:00
|
|
|
@include border-radius($custom-checkbox-radius);
|
2014-12-26 00:40:24 +01:00
|
|
|
}
|
2014-12-24 13:13:23 +01:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-control-input:checked ~ .custom-control-indicator {
|
2016-02-07 03:05:24 +01:00
|
|
|
background-image: $custom-checkbox-checked-icon;
|
2014-12-26 00:40:24 +01:00
|
|
|
}
|
2015-01-01 21:01:55 +01:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-control-input:indeterminate ~ .custom-control-indicator {
|
2016-01-17 07:29:51 +01:00
|
|
|
background-color: $custom-checkbox-indeterminate-bg;
|
2016-02-07 03:05:24 +01:00
|
|
|
background-image: $custom-checkbox-indeterminate-icon;
|
2016-01-17 07:29:51 +01:00
|
|
|
@include box-shadow($custom-checkbox-indeterminate-box-shadow);
|
2015-01-01 21:01:55 +01:00
|
|
|
}
|
2014-12-24 13:13:23 +01:00
|
|
|
}
|
|
|
|
|
2014-12-24 13:47:08 +01:00
|
|
|
// Radios
|
|
|
|
//
|
|
|
|
// Tweak just a few things for radios.
|
2014-12-24 13:13:23 +01:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-radio {
|
|
|
|
.custom-control-indicator {
|
2016-01-17 07:29:51 +01:00
|
|
|
border-radius: $custom-radio-radius;
|
2014-12-26 00:40:24 +01:00
|
|
|
}
|
2014-12-24 13:13:23 +01:00
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-control-input:checked ~ .custom-control-indicator {
|
2016-02-07 03:05:24 +01:00
|
|
|
background-image: $custom-radio-checked-icon;
|
2014-12-26 00:40:24 +01:00
|
|
|
}
|
2014-12-24 13:13:23 +01:00
|
|
|
}
|
|
|
|
|
2015-04-18 20:17:32 +02:00
|
|
|
|
2014-12-25 00:45:37 +01:00
|
|
|
// Layout options
|
|
|
|
//
|
|
|
|
// By default radios and checkboxes are `inline-block` with no additional spacing
|
|
|
|
// set. Use these optional classes to tweak the layout.
|
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
.custom-controls-stacked {
|
|
|
|
.custom-control {
|
2014-12-26 00:40:24 +01:00
|
|
|
display: inline;
|
|
|
|
|
2015-08-19 22:31:31 +02:00
|
|
|
&::after {
|
2014-12-26 00:40:24 +01:00
|
|
|
display: block;
|
2016-01-17 07:29:51 +01:00
|
|
|
margin-bottom: $custom-control-spacer-y;
|
2014-12-26 00:40:24 +01:00
|
|
|
content: "";
|
|
|
|
}
|
|
|
|
|
2016-01-06 08:25:42 +01:00
|
|
|
+ .custom-control {
|
2014-12-26 00:40:24 +01:00
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
}
|
2014-12-25 00:45:37 +01:00
|
|
|
}
|
|
|
|
|
2015-04-18 20:17:32 +02:00
|
|
|
|
2014-12-26 00:40:24 +01:00
|
|
|
// Select
|
|
|
|
//
|
2015-08-19 04:26:18 +02:00
|
|
|
// Replaces the browser default select with a custom one, mostly pulled from
|
|
|
|
// http://primercss.io.
|
2015-08-23 10:12:00 +02:00
|
|
|
//
|
|
|
|
// Includes IE9-specific hacks (noted by ` \9`).
|
2014-12-24 13:13:23 +01:00
|
|
|
|
2016-01-06 08:34:51 +01:00
|
|
|
.custom-select {
|
2014-12-26 00:40:24 +01:00
|
|
|
display: inline-block;
|
2015-08-19 04:26:18 +02:00
|
|
|
max-width: 100%;
|
2016-01-17 07:29:51 +01:00
|
|
|
padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
|
|
|
|
padding-right: $custom-select-padding-x \9;
|
|
|
|
color: $custom-select-color;
|
2015-12-08 10:06:23 +01:00
|
|
|
vertical-align: middle;
|
2016-02-07 02:00:57 +01:00
|
|
|
background: $custom-select-bg $custom-select-indicator no-repeat right $custom-select-padding-x center;
|
2015-08-23 10:12:00 +02:00
|
|
|
background-image: none \9;
|
2016-01-17 07:29:51 +01:00
|
|
|
background-size: $custom-select-bg-size;
|
|
|
|
border: $custom-select-border-width solid $custom-select-border-color;
|
|
|
|
@include border-radius($custom-select-border-radius);
|
2015-08-23 10:12:00 +02:00
|
|
|
// Use vendor prefixes as `appearance` isn't part of the CSS spec.
|
2015-08-19 04:26:18 +02:00
|
|
|
-moz-appearance: none;
|
2015-08-23 10:12:00 +02:00
|
|
|
-webkit-appearance: none;
|
2015-08-19 04:26:18 +02:00
|
|
|
|
|
|
|
&:focus {
|
2016-01-17 07:29:51 +01:00
|
|
|
border-color: $custom-select-focus-border-color;
|
2015-08-23 10:00:22 +02:00
|
|
|
outline: none;
|
2016-01-17 07:29:51 +01:00
|
|
|
@include box-shadow($custom-select-focus-box-shadow);
|
2015-08-19 04:26:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hides the default caret in IE11
|
|
|
|
&::-ms-expand {
|
|
|
|
opacity: 0;
|
2015-01-01 10:05:01 +01:00
|
|
|
}
|
|
|
|
}
|
2014-12-24 13:13:23 +01:00
|
|
|
|
2016-01-06 08:34:51 +01:00
|
|
|
.custom-select-sm {
|
2016-01-17 07:29:51 +01:00
|
|
|
padding-top: $custom-select-padding-y;
|
|
|
|
padding-bottom: $custom-select-padding-y;
|
|
|
|
font-size: $custom-select-sm-font-size;
|
|
|
|
|
|
|
|
// &:not([multiple]) {
|
|
|
|
// height: 26px;
|
|
|
|
// min-height: 26px;
|
|
|
|
// }
|
2014-12-24 13:13:23 +01:00
|
|
|
}
|
|
|
|
|
2015-04-18 20:17:32 +02:00
|
|
|
|
2014-12-26 00:40:24 +01:00
|
|
|
// File
|
|
|
|
//
|
|
|
|
// Custom file input.
|
2014-12-24 13:13:23 +01:00
|
|
|
|
2016-01-06 08:45:44 +01:00
|
|
|
.custom-file {
|
2014-12-26 00:40:24 +01:00
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
2015-12-29 15:41:21 +01:00
|
|
|
max-width: 100%;
|
2016-01-18 00:21:16 +01:00
|
|
|
height: $custom-file-height;
|
2014-12-26 00:40:24 +01:00
|
|
|
cursor: pointer;
|
2014-12-24 13:13:23 +01:00
|
|
|
}
|
2016-01-06 08:45:44 +01:00
|
|
|
|
|
|
|
.custom-file-input {
|
2016-01-18 00:21:16 +01:00
|
|
|
min-width: $custom-file-width;
|
2015-12-29 15:41:21 +01:00
|
|
|
max-width: 100%;
|
2014-12-26 00:40:24 +01:00
|
|
|
margin: 0;
|
2015-08-25 07:49:45 +02:00
|
|
|
filter: alpha(opacity = 0);
|
2014-12-26 00:40:24 +01:00
|
|
|
opacity: 0;
|
2016-01-06 08:45:44 +01:00
|
|
|
|
|
|
|
&:focus ~ .custom-file-control {
|
2016-01-18 00:21:16 +01:00
|
|
|
@include box-shadow($custom-file-focus-box-shadow);
|
2016-01-06 08:45:44 +01:00
|
|
|
}
|
2014-12-24 13:13:23 +01:00
|
|
|
}
|
2016-01-06 08:45:44 +01:00
|
|
|
|
|
|
|
.custom-file-control {
|
2014-12-26 00:40:24 +01:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 5;
|
2016-01-18 00:21:16 +01:00
|
|
|
height: $custom-file-height;
|
|
|
|
padding: $custom-file-padding-x $custom-file-padding-y;
|
|
|
|
line-height: $custom-file-line-height;
|
|
|
|
color: $custom-file-color;
|
2014-12-26 00:40:24 +01:00
|
|
|
user-select: none;
|
2016-01-18 00:21:16 +01:00
|
|
|
background-color: $custom-file-bg;
|
|
|
|
border: $custom-file-border-width solid $custom-file-border-color;
|
2016-01-18 00:32:01 +01:00
|
|
|
@include border-radius($custom-file-border-radius);
|
2016-01-18 00:21:16 +01:00
|
|
|
@include box-shadow($custom-file-box-shadow);
|
2014-12-24 13:13:23 +01:00
|
|
|
|
2016-01-06 08:45:44 +01:00
|
|
|
&::after {
|
2016-01-18 00:21:16 +01:00
|
|
|
content: $custom-file-placeholder;
|
2016-01-06 08:45:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
position: absolute;
|
2016-01-18 00:21:16 +01:00
|
|
|
top: -$custom-file-border-width;
|
|
|
|
right: -$custom-file-border-width;
|
|
|
|
bottom: -$custom-file-border-width;
|
2016-01-06 08:45:44 +01:00
|
|
|
z-index: 6;
|
|
|
|
display: block;
|
2016-01-18 00:21:16 +01:00
|
|
|
height: $custom-file-height;
|
|
|
|
padding: $custom-file-padding-x $custom-file-padding-y;
|
|
|
|
line-height: $custom-file-line-height;
|
|
|
|
color: $custom-file-button-color;
|
|
|
|
content: $custom-file-button-label;
|
|
|
|
background-color: $custom-file-button-bg;
|
|
|
|
border: $custom-file-border-width solid $custom-file-border-color;
|
|
|
|
@include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);
|
2016-01-06 08:45:44 +01:00
|
|
|
}
|
2014-12-24 13:13:23 +01:00
|
|
|
}
|