2015-04-18 14:17:32 -04:00
|
|
|
//
|
|
|
|
// Custom forms
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
|
2014-12-24 07:13:23 -05:00
|
|
|
// Embedded icons from Open Iconic.
|
|
|
|
// Released under MIT and copyright 2014 Waybury.
|
|
|
|
// http://useiconic.com/open
|
|
|
|
|
2015-04-18 14:17:32 -04:00
|
|
|
|
2014-12-24 07:13:23 -05:00
|
|
|
// Checkboxes and radios
|
2014-12-24 07:47:08 -05:00
|
|
|
//
|
|
|
|
// Base class takes care of all the key behavioral aspects.
|
|
|
|
|
2014-12-24 07:13:23 -05:00
|
|
|
.c-input {
|
2014-12-25 18:40:24 -05:00
|
|
|
position: relative;
|
|
|
|
display: inline;
|
|
|
|
padding-left: 1.5rem;
|
|
|
|
color: #555;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
> input {
|
|
|
|
position: absolute;
|
|
|
|
z-index: -1; // Put the input behind the label so it doesn't overlay text
|
|
|
|
opacity: 0;
|
|
|
|
|
|
|
|
&:focus ~ .c-indicator {
|
2014-12-31 13:07:34 -05:00
|
|
|
@include box-shadow(0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9);
|
2014-12-25 18:40:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
&:checked ~ .c-indicator {
|
|
|
|
color: #fff;
|
|
|
|
background-color: #0074d9;
|
2015-01-01 15:13:24 -05:00
|
|
|
@include box-shadow(none);
|
2014-12-25 18:40:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
&:active ~ .c-indicator {
|
|
|
|
color: #fff;
|
|
|
|
background-color: #84c6ff;
|
2015-01-01 15:13:24 -05:00
|
|
|
@include box-shadow(none);
|
2014-12-25 18:40:24 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ .c-input {
|
|
|
|
margin-left: 1rem;
|
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
|
2014-12-24 07:47:08 -05:00
|
|
|
// Custom indicator
|
|
|
|
//
|
|
|
|
// Generates a shadow element to create our makeshift checkbox/radio background.
|
|
|
|
|
2014-12-24 07:13:23 -05:00
|
|
|
.c-indicator {
|
2014-12-25 18:40:24 -05:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
display: block;
|
|
|
|
width: 1rem;
|
|
|
|
height: 1rem;
|
|
|
|
font-size: 65%;
|
|
|
|
line-height: 1rem;
|
|
|
|
color: #eee;
|
|
|
|
text-align: center;
|
|
|
|
user-select: none;
|
|
|
|
background-color: #eee;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-position: center center;
|
|
|
|
background-size: 50% 50%;
|
2014-12-31 13:07:34 -05:00
|
|
|
@include box-shadow(inset 0 .125rem .125rem rgba(0,0,0,.1));
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
|
2014-12-24 07:47:08 -05:00
|
|
|
// Checkboxes
|
|
|
|
//
|
|
|
|
// Tweak just a few things for checkboxes.
|
2014-12-24 07:13:23 -05:00
|
|
|
|
2014-12-24 07:47:08 -05:00
|
|
|
.c-checkbox {
|
2014-12-25 18:40:24 -05:00
|
|
|
.c-indicator {
|
|
|
|
border-radius: .25rem;
|
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
|
2014-12-25 18:40:24 -05:00
|
|
|
input:checked ~ .c-indicator {
|
|
|
|
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgOCA4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA4IDgiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTYuNCwxTDUuNywxLjdMMi45LDQuNUwyLjEsMy43TDEuNCwzTDAsNC40bDAuNywwLjdsMS41LDEuNWwwLjcsMC43bDAuNy0wLjdsMy41LTMuNWwwLjctMC43TDYuNCwxTDYuNCwxeiINCgkvPg0KPC9zdmc+DQo=);
|
|
|
|
}
|
2015-01-01 15:01:55 -05:00
|
|
|
|
|
|
|
input:indeterminate ~ .c-indicator {
|
|
|
|
background-color: #0074d9;
|
|
|
|
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iOHB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDggOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgOCA4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0wLDN2Mmg4VjNIMHoiLz4NCjwvc3ZnPg0K);
|
2015-01-01 15:13:24 -05:00
|
|
|
@include box-shadow(none);
|
2015-01-01 15:01:55 -05:00
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
|
2014-12-24 07:47:08 -05:00
|
|
|
// Radios
|
|
|
|
//
|
|
|
|
// Tweak just a few things for radios.
|
2014-12-24 07:13:23 -05:00
|
|
|
|
2014-12-24 07:47:08 -05:00
|
|
|
.c-radio {
|
2014-12-25 18:40:24 -05:00
|
|
|
.c-indicator {
|
|
|
|
border-radius: 50%;
|
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
|
2014-12-24 07:47:08 -05:00
|
|
|
input:checked ~ .c-indicator {
|
2014-12-25 18:40:24 -05:00
|
|
|
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgOCA4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA4IDgiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTQsMUMyLjMsMSwxLDIuMywxLDRzMS4zLDMsMywzczMtMS4zLDMtM1M1LjcsMSw0LDF6Ii8+DQo8L3N2Zz4NCg==);
|
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
|
2015-04-18 14:17:32 -04:00
|
|
|
|
2014-12-24 18:45:37 -05:00
|
|
|
// Layout options
|
|
|
|
//
|
|
|
|
// By default radios and checkboxes are `inline-block` with no additional spacing
|
|
|
|
// set. Use these optional classes to tweak the layout.
|
|
|
|
|
|
|
|
.c-inputs-stacked {
|
2014-12-25 18:40:24 -05:00
|
|
|
.c-input {
|
|
|
|
display: inline;
|
|
|
|
|
|
|
|
&:after {
|
|
|
|
display: block;
|
|
|
|
margin-bottom: .25rem;
|
|
|
|
content: "";
|
|
|
|
}
|
|
|
|
|
|
|
|
+ .c-input {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
}
|
2014-12-24 18:45:37 -05:00
|
|
|
}
|
|
|
|
|
2015-04-18 14:17:32 -04:00
|
|
|
|
2014-12-25 18:40:24 -05:00
|
|
|
// Select
|
|
|
|
//
|
|
|
|
// Replaces the browser default select with a custom one.
|
2014-12-24 07:13:23 -05:00
|
|
|
|
|
|
|
.select {
|
2014-12-25 18:40:24 -05:00
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
color: #555;
|
|
|
|
|
|
|
|
> select {
|
|
|
|
display: inline-block;
|
|
|
|
width: 100%;
|
|
|
|
padding: .5rem 2.25rem .5rem 1rem;
|
|
|
|
margin: 0;
|
|
|
|
line-height: 1.5;
|
|
|
|
color: #555;
|
|
|
|
cursor: pointer;
|
|
|
|
background-color: #eee;
|
|
|
|
border: 0;
|
|
|
|
border-radius: .25rem;
|
|
|
|
outline: 0;
|
|
|
|
-webkit-appearance: none;
|
|
|
|
appearance: none;
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
|
|
|
|
|
|
|
|
// Undo the Firefox inner focus ring
|
|
|
|
&:-moz-focusring {
|
|
|
|
color: transparent;
|
|
|
|
text-shadow: 0 0 0 #000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
color: #fff;
|
|
|
|
background-color: #0074d9;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hide the arrow in IE10 and up
|
|
|
|
&::-ms-expand {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Dropdown arrow
|
|
|
|
&:after {
|
|
|
|
position: absolute;
|
|
|
|
top: 50%;
|
|
|
|
right: 1.25rem;
|
|
|
|
display: inline-block;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
margin-top: -.15rem;
|
|
|
|
pointer-events: none;
|
|
|
|
content: "";
|
|
|
|
border-top: .35rem solid;
|
|
|
|
border-right: .35rem solid transparent;
|
|
|
|
border-bottom: .35rem solid transparent;
|
|
|
|
border-left: .35rem solid transparent;
|
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
|
2014-12-25 18:40:24 -05:00
|
|
|
// Hover state
|
2015-01-01 04:05:01 -05:00
|
|
|
.select select {
|
|
|
|
@include hover {
|
|
|
|
background-color: #ddd;
|
|
|
|
}
|
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
|
|
|
|
|
2014-12-25 18:40:24 -05:00
|
|
|
// Media query to target Firefox only
|
2014-12-24 07:13:23 -05:00
|
|
|
@-moz-document url-prefix() {
|
2014-12-25 18:40:24 -05:00
|
|
|
// Firefox hack to hide the arrow
|
|
|
|
.select select {
|
|
|
|
padding-right: 1rem;
|
|
|
|
text-indent: 0.01px;
|
|
|
|
text-overflow: "";
|
|
|
|
}
|
|
|
|
|
|
|
|
// <option> elements inherit styles from <select>, so reset them.
|
|
|
|
.select option {
|
|
|
|
background-color: #fff;
|
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
|
2014-12-25 18:40:24 -05:00
|
|
|
// IE9 hack to hide the arrow
|
2014-12-24 07:13:23 -05:00
|
|
|
@media screen and (min-width:0\0) {
|
2014-12-25 18:40:24 -05:00
|
|
|
.select select {
|
|
|
|
z-index: 1;
|
|
|
|
padding: .5rem 1.5rem .5rem 1rem;
|
|
|
|
}
|
|
|
|
.select:after {
|
|
|
|
z-index: 5;
|
|
|
|
}
|
|
|
|
.select:before {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 1rem;
|
|
|
|
bottom: 0;
|
|
|
|
z-index: 2;
|
|
|
|
display: block;
|
|
|
|
width: 1.5rem;
|
|
|
|
content: "";
|
|
|
|
background-color: #eee;
|
|
|
|
}
|
2015-01-01 04:05:01 -05:00
|
|
|
.select select {
|
|
|
|
@include hover-focus-active {
|
|
|
|
color: #555;
|
|
|
|
background-color: #eee;
|
|
|
|
}
|
2014-12-25 18:40:24 -05:00
|
|
|
}
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
|
2015-04-18 14:17:32 -04:00
|
|
|
|
2014-12-25 18:40:24 -05:00
|
|
|
// File
|
|
|
|
//
|
|
|
|
// Custom file input.
|
2014-12-24 07:13:23 -05:00
|
|
|
|
|
|
|
.file {
|
2014-12-25 18:40:24 -05:00
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
height: 2.5rem;
|
|
|
|
cursor: pointer;
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
.file input {
|
2014-12-25 18:40:24 -05:00
|
|
|
min-width: 14rem;
|
|
|
|
margin: 0;
|
|
|
|
filter: alpha(opacity=0);
|
|
|
|
opacity: 0;
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
.file-custom {
|
2014-12-25 18:40:24 -05:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 5;
|
|
|
|
height: 2.5rem;
|
|
|
|
padding: .5rem 1rem;
|
|
|
|
line-height: 1.5;
|
|
|
|
color: #555;
|
|
|
|
user-select: none;
|
|
|
|
background-color: #fff;
|
|
|
|
border: .075rem solid #ddd;
|
|
|
|
border-radius: .25rem;
|
|
|
|
box-shadow: inset 0 .2rem .4rem rgba(0,0,0,.05);
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
.file-custom:after {
|
2014-12-25 18:40:24 -05:00
|
|
|
content: "Choose file...";
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
.file-custom:before {
|
2014-12-25 18:40:24 -05:00
|
|
|
position: absolute;
|
|
|
|
top: -.075rem;
|
|
|
|
right: -.075rem;
|
|
|
|
bottom: -.075rem;
|
|
|
|
z-index: 6;
|
|
|
|
display: block;
|
|
|
|
height: 2.5rem;
|
|
|
|
padding: .5rem 1rem;
|
|
|
|
line-height: 1.5;
|
|
|
|
color: #555;
|
|
|
|
content: "Browse";
|
|
|
|
background-color: #eee;
|
|
|
|
border: .075rem solid #ddd;
|
|
|
|
border-radius: 0 .25rem .25rem 0;
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|
|
|
|
|
2014-12-25 18:40:24 -05:00
|
|
|
// Focus state
|
2014-12-24 07:13:23 -05:00
|
|
|
.file input:focus ~ .file-custom {
|
2014-12-25 18:40:24 -05:00
|
|
|
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
|
2014-12-24 07:13:23 -05:00
|
|
|
}
|