spectre_scss 0.3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +48 -0
- data/Rakefile +34 -0
- data/bin/console +7 -0
- data/bin/setup +6 -0
- data/lib/spectre_scss.rb +5 -0
- data/lib/spectre_scss/engine.rb +4 -0
- data/lib/spectre_scss/version.rb +3 -0
- data/spectre_scss.gemspec +26 -0
- data/vendor/assets/stylesheets/spectre.scss +1 -0
- data/vendor/assets/stylesheets/spectre/spectre-exp.scss +16 -0
- data/vendor/assets/stylesheets/spectre/spectre-icons.scss +8 -0
- data/vendor/assets/stylesheets/spectre/spectre.scss +50 -0
- data/vendor/assets/stylesheets/spectre/src/_accordions.scss +34 -0
- data/vendor/assets/stylesheets/spectre/src/_animations.scss +20 -0
- data/vendor/assets/stylesheets/spectre/src/_asian.scss +33 -0
- data/vendor/assets/stylesheets/spectre/src/_autocomplete.scss +41 -0
- data/vendor/assets/stylesheets/spectre/src/_avatars.scss +77 -0
- data/vendor/assets/stylesheets/spectre/src/_badges.scss +70 -0
- data/vendor/assets/stylesheets/spectre/src/_bars.scss +71 -0
- data/vendor/assets/stylesheets/spectre/src/_base.scss +40 -0
- data/vendor/assets/stylesheets/spectre/src/_breadcrumbs.scss +29 -0
- data/vendor/assets/stylesheets/spectre/src/_buttons.scss +182 -0
- data/vendor/assets/stylesheets/spectre/src/_calendars.scss +206 -0
- data/vendor/assets/stylesheets/spectre/src/_cards.scss +39 -0
- data/vendor/assets/stylesheets/spectre/src/_carousels.scss +124 -0
- data/vendor/assets/stylesheets/spectre/src/_chips.scss +24 -0
- data/vendor/assets/stylesheets/spectre/src/_codes.scss +32 -0
- data/vendor/assets/stylesheets/spectre/src/_comparison-sliders.scss +114 -0
- data/vendor/assets/stylesheets/spectre/src/_dropdowns.scss +36 -0
- data/vendor/assets/stylesheets/spectre/src/_empty.scss +21 -0
- data/vendor/assets/stylesheets/spectre/src/_filters.scss +29 -0
- data/vendor/assets/stylesheets/spectre/src/_forms.scss +514 -0
- data/vendor/assets/stylesheets/spectre/src/_icons.scss +656 -0
- data/vendor/assets/stylesheets/spectre/src/_labels.scss +33 -0
- data/vendor/assets/stylesheets/spectre/src/_layout.scss +422 -0
- data/vendor/assets/stylesheets/spectre/src/_media.scss +70 -0
- data/vendor/assets/stylesheets/spectre/src/_menus.scss +56 -0
- data/vendor/assets/stylesheets/spectre/src/_meters.scss +57 -0
- data/vendor/assets/stylesheets/spectre/src/_mixins.scss +185 -0
- data/vendor/assets/stylesheets/spectre/src/_modals.scss +73 -0
- data/vendor/assets/stylesheets/spectre/src/_navbar.scss +29 -0
- data/vendor/assets/stylesheets/spectre/src/_navigation.scss +13 -0
- data/vendor/assets/stylesheets/spectre/src/_navs.scss +34 -0
- data/vendor/assets/stylesheets/spectre/src/_normalize.scss +437 -0
- data/vendor/assets/stylesheets/spectre/src/_pagination.scss +61 -0
- data/vendor/assets/stylesheets/spectre/src/_panels.scss +23 -0
- data/vendor/assets/stylesheets/spectre/src/_parallax.scss +131 -0
- data/vendor/assets/stylesheets/spectre/src/_popovers.scss +70 -0
- data/vendor/assets/stylesheets/spectre/src/_progress.scss +45 -0
- data/vendor/assets/stylesheets/spectre/src/_sliders.scss +93 -0
- data/vendor/assets/stylesheets/spectre/src/_steps.scss +70 -0
- data/vendor/assets/stylesheets/spectre/src/_tables.scss +45 -0
- data/vendor/assets/stylesheets/spectre/src/_tabs.scss +62 -0
- data/vendor/assets/stylesheets/spectre/src/_tiles.scss +38 -0
- data/vendor/assets/stylesheets/spectre/src/_timelines.scss +55 -0
- data/vendor/assets/stylesheets/spectre/src/_toasts.scss +41 -0
- data/vendor/assets/stylesheets/spectre/src/_tooltips.scss +77 -0
- data/vendor/assets/stylesheets/spectre/src/_typography.scss +127 -0
- data/vendor/assets/stylesheets/spectre/src/_utilities.scss +7 -0
- data/vendor/assets/stylesheets/spectre/src/_variables.scss +105 -0
- data/vendor/assets/stylesheets/spectre/src/utilities/_colors.scss +45 -0
- data/vendor/assets/stylesheets/spectre/src/utilities/_display.scss +47 -0
- data/vendor/assets/stylesheets/spectre/src/utilities/_divider.scss +50 -0
- data/vendor/assets/stylesheets/spectre/src/utilities/_loading.scss +34 -0
- data/vendor/assets/stylesheets/spectre/src/utilities/_position.scss +35 -0
- data/vendor/assets/stylesheets/spectre/src/utilities/_shapes.scss +7 -0
- data/vendor/assets/stylesheets/spectre/src/utilities/_text.scss +52 -0
- metadata +157 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
// Cards
|
2
|
+
.card {
|
3
|
+
background: $bg-color-light;
|
4
|
+
border: $border-width solid $border-color;
|
5
|
+
border-radius: $border-radius;
|
6
|
+
display: flex;
|
7
|
+
flex-direction: column;
|
8
|
+
|
9
|
+
.card-header,
|
10
|
+
.card-body,
|
11
|
+
.card-footer {
|
12
|
+
padding: $layout-spacing-lg;
|
13
|
+
padding-bottom: 0;
|
14
|
+
|
15
|
+
&:last-child {
|
16
|
+
padding-bottom: $layout-spacing-lg;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
.card-image {
|
21
|
+
padding-top: $layout-spacing-lg;
|
22
|
+
|
23
|
+
&:first-child {
|
24
|
+
padding-top: 0;
|
25
|
+
|
26
|
+
img {
|
27
|
+
border-top-left-radius: $border-radius;
|
28
|
+
border-top-right-radius: $border-radius;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
&:last-child {
|
33
|
+
img {
|
34
|
+
border-bottom-left-radius: $border-radius;
|
35
|
+
border-bottom-right-radius: $border-radius;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,124 @@
|
|
1
|
+
// Carousels
|
2
|
+
.carousel {
|
3
|
+
background: $bg-color;
|
4
|
+
display: block;
|
5
|
+
overflow: hidden;
|
6
|
+
position: relative;
|
7
|
+
width: 100%;
|
8
|
+
|
9
|
+
.carousel-container {
|
10
|
+
height: 100%;
|
11
|
+
left: 0;
|
12
|
+
position: relative;
|
13
|
+
&::before {
|
14
|
+
content: "";
|
15
|
+
display: block;
|
16
|
+
padding-bottom: 56.25%;
|
17
|
+
}
|
18
|
+
|
19
|
+
.carousel-item {
|
20
|
+
animation: carousel-slideout 1s ease-in-out 1;
|
21
|
+
height: 100%;
|
22
|
+
left: 0;
|
23
|
+
margin: 0;
|
24
|
+
opacity: 0;
|
25
|
+
position: absolute;
|
26
|
+
top: 0;
|
27
|
+
width: 100%;
|
28
|
+
|
29
|
+
&:hover {
|
30
|
+
.item-prev,
|
31
|
+
.item-next {
|
32
|
+
opacity: 1;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
.item-prev,
|
38
|
+
.item-next {
|
39
|
+
background: rgba($gray-color-light, .25);
|
40
|
+
border-color: rgba($gray-color-light, .5);
|
41
|
+
color: $gray-color-light;
|
42
|
+
opacity: 0;
|
43
|
+
position: absolute;
|
44
|
+
top: 50%;
|
45
|
+
transition: all .4s ease;
|
46
|
+
transform: translateY(-50%);
|
47
|
+
z-index: $zindex-2;
|
48
|
+
}
|
49
|
+
.item-prev {
|
50
|
+
left: 1rem;
|
51
|
+
}
|
52
|
+
.item-next {
|
53
|
+
right: 1rem;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
.carousel-locator {
|
58
|
+
&:nth-of-type(1):checked ~ .carousel-container .carousel-item:nth-of-type(1),
|
59
|
+
&:nth-of-type(2):checked ~ .carousel-container .carousel-item:nth-of-type(2),
|
60
|
+
&:nth-of-type(3):checked ~ .carousel-container .carousel-item:nth-of-type(3),
|
61
|
+
&:nth-of-type(4):checked ~ .carousel-container .carousel-item:nth-of-type(4) {
|
62
|
+
animation: carousel-slidein .75s ease-in-out 1;
|
63
|
+
opacity: 1;
|
64
|
+
z-index: $zindex-1;
|
65
|
+
}
|
66
|
+
&:nth-of-type(1):checked ~ .carousel-nav .nav-item:nth-of-type(1),
|
67
|
+
&:nth-of-type(2):checked ~ .carousel-nav .nav-item:nth-of-type(2),
|
68
|
+
&:nth-of-type(3):checked ~ .carousel-nav .nav-item:nth-of-type(3),
|
69
|
+
&:nth-of-type(4):checked ~ .carousel-nav .nav-item:nth-of-type(4) {
|
70
|
+
color: $gray-color-light;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
.carousel-nav {
|
75
|
+
bottom: $layout-spacing;
|
76
|
+
display: flex;
|
77
|
+
justify-content: center;
|
78
|
+
left: 50%;
|
79
|
+
position: absolute;
|
80
|
+
transform: translateX(-50%);
|
81
|
+
width: 10rem;
|
82
|
+
z-index: $zindex-2;
|
83
|
+
|
84
|
+
.nav-item {
|
85
|
+
color: rgba($gray-color-light, .5);
|
86
|
+
display: block;
|
87
|
+
flex: 1 0 auto;
|
88
|
+
height: $unit-8;
|
89
|
+
margin: $unit-1;
|
90
|
+
max-width: 2.5rem;
|
91
|
+
position: relative;
|
92
|
+
|
93
|
+
&::before {
|
94
|
+
background: currentColor;
|
95
|
+
content: "";
|
96
|
+
display: block;
|
97
|
+
height: $border-width-lg;
|
98
|
+
position: absolute;
|
99
|
+
top: .5rem;
|
100
|
+
width: 100%;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
@keyframes carousel-slidein {
|
107
|
+
0% {
|
108
|
+
transform: translateX(100%);
|
109
|
+
}
|
110
|
+
100% {
|
111
|
+
transform: translateX(0);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
@keyframes carousel-slideout {
|
116
|
+
0% {
|
117
|
+
opacity: 1;
|
118
|
+
transform: translateX(0);
|
119
|
+
}
|
120
|
+
100% {
|
121
|
+
opacity: 1;
|
122
|
+
transform: translateX(-50%);
|
123
|
+
}
|
124
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
// Chips
|
2
|
+
.chip {
|
3
|
+
align-items: center;
|
4
|
+
background: $bg-color-dark;
|
5
|
+
border-radius: 5rem;
|
6
|
+
color: $gray-color-dark;
|
7
|
+
display: inline-flex;
|
8
|
+
height: $unit-6;
|
9
|
+
margin: $unit-h;
|
10
|
+
max-width: 100%;
|
11
|
+
padding: $unit-h $unit-2 + $unit-h;
|
12
|
+
text-decoration: none;
|
13
|
+
vertical-align: middle;
|
14
|
+
|
15
|
+
&.active {
|
16
|
+
background: $primary-color;
|
17
|
+
color: $light-color;
|
18
|
+
}
|
19
|
+
|
20
|
+
.avatar {
|
21
|
+
margin-left: -($unit-2 + $unit-h);
|
22
|
+
margin-right: $unit-1;
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// Codes
|
2
|
+
code {
|
3
|
+
font-size: .65rem;
|
4
|
+
@include label-base();
|
5
|
+
@include label-variant($code-color, lighten($code-color, 33%));
|
6
|
+
}
|
7
|
+
|
8
|
+
.code {
|
9
|
+
border-radius: $border-radius;
|
10
|
+
color: $body-font-color;
|
11
|
+
line-height: $line-height;
|
12
|
+
position: relative;
|
13
|
+
|
14
|
+
&::before {
|
15
|
+
content: attr(data-lang);
|
16
|
+
color: $gray-color;
|
17
|
+
font-size: $font-size-sm;
|
18
|
+
position: absolute;
|
19
|
+
right: $layout-spacing;
|
20
|
+
top: $unit-h;
|
21
|
+
}
|
22
|
+
|
23
|
+
code {
|
24
|
+
background: $bg-color;
|
25
|
+
color: inherit;
|
26
|
+
display: block;
|
27
|
+
line-height: inherit;
|
28
|
+
overflow-x: auto;
|
29
|
+
padding: 1rem;
|
30
|
+
width: 100%;
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,114 @@
|
|
1
|
+
// Image comparison slider
|
2
|
+
// Credit: http://codepen.io/solipsistacp/pen/Gpmaq
|
3
|
+
.comparison-slider {
|
4
|
+
height: 50vh;
|
5
|
+
overflow: hidden;
|
6
|
+
position: relative;
|
7
|
+
width: 100%;
|
8
|
+
|
9
|
+
.comparison-before,
|
10
|
+
.comparison-after {
|
11
|
+
height: 100%;
|
12
|
+
left: 0;
|
13
|
+
margin: 0;
|
14
|
+
overflow: hidden;
|
15
|
+
position: absolute;
|
16
|
+
top: 0;
|
17
|
+
|
18
|
+
img {
|
19
|
+
height: 100%;
|
20
|
+
object-fit: none;
|
21
|
+
object-position: left center;
|
22
|
+
position: absolute;
|
23
|
+
width: 100%;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
.comparison-before {
|
28
|
+
width: 100%;
|
29
|
+
z-index: 1;
|
30
|
+
|
31
|
+
.comparison-label {
|
32
|
+
right: $unit-4;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
.comparison-after {
|
37
|
+
max-width: 100%;
|
38
|
+
min-width: 0;
|
39
|
+
z-index: 2;
|
40
|
+
|
41
|
+
&::before {
|
42
|
+
background: transparent;
|
43
|
+
content: "";
|
44
|
+
cursor: default;
|
45
|
+
height: 100%;
|
46
|
+
left: 0;
|
47
|
+
position: absolute;
|
48
|
+
right: $unit-4;
|
49
|
+
top: 0;
|
50
|
+
z-index: $zindex-0;
|
51
|
+
}
|
52
|
+
|
53
|
+
&::after {
|
54
|
+
background: currentColor;
|
55
|
+
border-radius: 50%;
|
56
|
+
box-shadow: 0 -5px, 0 5px;
|
57
|
+
color: $light-color;
|
58
|
+
content: "";
|
59
|
+
height: 3px;
|
60
|
+
position: absolute;
|
61
|
+
right: $unit-2;
|
62
|
+
top: 50%;
|
63
|
+
transform: translate(50%, -50%);
|
64
|
+
width: 3px;
|
65
|
+
}
|
66
|
+
|
67
|
+
.comparison-label {
|
68
|
+
left: $unit-4;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
.comparison-resizer {
|
73
|
+
animation: first-run 1.5s 1 ease-in-out;
|
74
|
+
cursor: ew-resize;
|
75
|
+
height: $unit-4;
|
76
|
+
left: 0;
|
77
|
+
max-width: 100%;
|
78
|
+
min-width: $unit-4;
|
79
|
+
opacity: 0;
|
80
|
+
outline: none;
|
81
|
+
position: relative;
|
82
|
+
resize: horizontal;
|
83
|
+
top: 50%;
|
84
|
+
transform: translateY(-50%) scaleY(30);
|
85
|
+
width: 0;
|
86
|
+
}
|
87
|
+
|
88
|
+
.comparison-label {
|
89
|
+
background: rgba($dark-color, .5);
|
90
|
+
bottom: $unit-4;
|
91
|
+
color: $light-color;
|
92
|
+
padding: $unit-1 $unit-2;
|
93
|
+
position: absolute;
|
94
|
+
user-select: none;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
@keyframes first-run {
|
99
|
+
0% {
|
100
|
+
width: 0;
|
101
|
+
}
|
102
|
+
25% {
|
103
|
+
width: $unit-12;
|
104
|
+
}
|
105
|
+
50% {
|
106
|
+
width: $unit-4;
|
107
|
+
}
|
108
|
+
75% {
|
109
|
+
width: $unit-6;
|
110
|
+
}
|
111
|
+
100% {
|
112
|
+
width: 0;
|
113
|
+
}
|
114
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
// Dropdown
|
2
|
+
.dropdown {
|
3
|
+
display: inline-block;
|
4
|
+
position: relative;
|
5
|
+
|
6
|
+
.menu {
|
7
|
+
animation: slide-down .15s ease 1;
|
8
|
+
display: none;
|
9
|
+
left: 0;
|
10
|
+
max-height: 50vh;
|
11
|
+
overflow-y: auto;
|
12
|
+
position: absolute;
|
13
|
+
top: 100%;
|
14
|
+
}
|
15
|
+
|
16
|
+
&.dropdown-right {
|
17
|
+
.menu {
|
18
|
+
left: auto;
|
19
|
+
right: 0;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
&.active .menu,
|
24
|
+
.dropdown-toggle:focus + .menu,
|
25
|
+
.menu:hover {
|
26
|
+
display: block;
|
27
|
+
}
|
28
|
+
|
29
|
+
// Fix dropdown-toggle border radius in button groups
|
30
|
+
.btn-group {
|
31
|
+
.dropdown-toggle:nth-last-child(2) {
|
32
|
+
border-bottom-right-radius: $border-radius;
|
33
|
+
border-top-right-radius: $border-radius;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// Empty states (or Blank slates)
|
2
|
+
.empty {
|
3
|
+
background: $bg-color;
|
4
|
+
border-radius: $border-radius;
|
5
|
+
color: $gray-color-dark;
|
6
|
+
text-align: center;
|
7
|
+
padding: 4 * $layout-spacing;
|
8
|
+
|
9
|
+
.empty-icon {
|
10
|
+
margin-bottom: $layout-spacing-lg;
|
11
|
+
}
|
12
|
+
|
13
|
+
.empty-title,
|
14
|
+
.empty-subtitle {
|
15
|
+
margin: $layout-spacing auto;
|
16
|
+
}
|
17
|
+
|
18
|
+
.empty-action {
|
19
|
+
margin-top: $layout-spacing-lg;
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Filters
|
2
|
+
.filter {
|
3
|
+
.filter-nav {
|
4
|
+
margin: $layout-spacing 0;
|
5
|
+
}
|
6
|
+
|
7
|
+
.filter-body {
|
8
|
+
display: flex;
|
9
|
+
flex-wrap: wrap;
|
10
|
+
}
|
11
|
+
|
12
|
+
.filter-tag {
|
13
|
+
&#tag-all:checked ~ .filter-nav .chip[for="tag-all"],
|
14
|
+
&#tag-action:checked ~ .filter-nav .chip[for="tag-action"],
|
15
|
+
&#tag-roleplaying:checked ~ .filter-nav .chip[for="tag-roleplaying"],
|
16
|
+
&#tag-shooter:checked ~ .filter-nav .chip[for="tag-shooter"],
|
17
|
+
&#tag-sports:checked ~ .filter-nav .chip[for="tag-sports"] {
|
18
|
+
background: $primary-color;
|
19
|
+
color: $light-color;
|
20
|
+
}
|
21
|
+
|
22
|
+
&#tag-action:checked ~ .filter-body .column:not([data-tag~="tag-action"]),
|
23
|
+
&#tag-roleplaying:checked ~ .filter-body .column:not([data-tag~="tag-roleplaying"]),
|
24
|
+
&#tag-shooter:checked ~ .filter-body .column:not([data-tag~="tag-shooter"]),
|
25
|
+
&#tag-sports:checked ~ .filter-body .column:not([data-tag~="tag-sports"]) {
|
26
|
+
display: none;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,514 @@
|
|
1
|
+
// Forms
|
2
|
+
.form-group {
|
3
|
+
&:not(:last-child) {
|
4
|
+
margin-bottom: $layout-spacing;
|
5
|
+
}
|
6
|
+
}
|
7
|
+
|
8
|
+
fieldset {
|
9
|
+
margin-bottom: $layout-spacing-lg;
|
10
|
+
}
|
11
|
+
|
12
|
+
legend {
|
13
|
+
font-size: $font-size-lg;
|
14
|
+
font-weight: 500;
|
15
|
+
margin-bottom: $layout-spacing-lg;
|
16
|
+
}
|
17
|
+
|
18
|
+
// Form element: Label
|
19
|
+
.form-label {
|
20
|
+
display: block;
|
21
|
+
padding: $control-padding-v + $border-width 0;
|
22
|
+
|
23
|
+
&.label-sm {
|
24
|
+
padding: $control-padding-v-sm + $border-width 0;
|
25
|
+
}
|
26
|
+
|
27
|
+
&.label-lg {
|
28
|
+
padding: $control-padding-v-lg + $border-width 0;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
// Form element: Input
|
33
|
+
.form-input {
|
34
|
+
appearance: none;
|
35
|
+
background: $bg-color-light;
|
36
|
+
background-image: none;
|
37
|
+
border: $border-width solid $border-color-dark;
|
38
|
+
border-radius: $border-radius;
|
39
|
+
color: $body-font-color;
|
40
|
+
@include control-transition();
|
41
|
+
display: block;
|
42
|
+
font-size: $font-size;
|
43
|
+
height: $control-size;
|
44
|
+
line-height: $line-height;
|
45
|
+
max-width: 100%;
|
46
|
+
outline: none;
|
47
|
+
padding: $control-padding-v $control-padding-h;
|
48
|
+
position: relative;
|
49
|
+
width: 100%;
|
50
|
+
&:focus {
|
51
|
+
border-color: $primary-color;
|
52
|
+
@include control-shadow();
|
53
|
+
}
|
54
|
+
&::placeholder {
|
55
|
+
color: $gray-color;
|
56
|
+
}
|
57
|
+
|
58
|
+
// Input sizes
|
59
|
+
&.input-sm {
|
60
|
+
font-size: $font-size-sm;
|
61
|
+
height: $control-size-sm;
|
62
|
+
padding: $control-padding-v-sm $control-padding-h;
|
63
|
+
}
|
64
|
+
|
65
|
+
&.input-lg {
|
66
|
+
font-size: $font-size-lg;
|
67
|
+
height: $control-size-lg;
|
68
|
+
padding: $control-padding-v-lg $control-padding-h;
|
69
|
+
}
|
70
|
+
|
71
|
+
&.input-inline {
|
72
|
+
display: inline-block;
|
73
|
+
vertical-align: middle;
|
74
|
+
width: auto;
|
75
|
+
}
|
76
|
+
|
77
|
+
// Textarea
|
78
|
+
@at-root textarea.form-input {
|
79
|
+
height: auto;
|
80
|
+
}
|
81
|
+
|
82
|
+
// Input types
|
83
|
+
&[type="file"] {
|
84
|
+
height: auto;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
// Form element: Input hint
|
89
|
+
.form-input-hint {
|
90
|
+
color: $gray-color;
|
91
|
+
font-size: $font-size-sm;
|
92
|
+
margin-top: $unit-1;
|
93
|
+
|
94
|
+
.has-success &,
|
95
|
+
.is-success + & {
|
96
|
+
color: $success-color;
|
97
|
+
}
|
98
|
+
|
99
|
+
.has-error &,
|
100
|
+
.is-error + & {
|
101
|
+
color: $error-color;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
// Form element: Select
|
106
|
+
.form-select {
|
107
|
+
appearance: none;
|
108
|
+
border: $border-width solid $border-color-dark;
|
109
|
+
border-radius: $border-radius;
|
110
|
+
color: inherit;
|
111
|
+
font-size: $font-size;
|
112
|
+
height: $control-size;
|
113
|
+
line-height: $line-height;
|
114
|
+
outline: none;
|
115
|
+
padding: $control-padding-v $control-padding-h;
|
116
|
+
vertical-align: middle;
|
117
|
+
width: 100%;
|
118
|
+
|
119
|
+
&[size],
|
120
|
+
&[multiple] {
|
121
|
+
height: auto;
|
122
|
+
|
123
|
+
option {
|
124
|
+
padding: $unit-h $unit-1;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
&:not([multiple]):not([size]) {
|
128
|
+
background: $bg-color-light url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23667189' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right ($control-icon-size / 2) center / .4rem .5rem;
|
129
|
+
padding-right: $control-icon-size + $control-padding-h;
|
130
|
+
}
|
131
|
+
&:focus {
|
132
|
+
border-color: $primary-color;
|
133
|
+
@include control-shadow();
|
134
|
+
}
|
135
|
+
&::-ms-expand {
|
136
|
+
display: none;
|
137
|
+
}
|
138
|
+
|
139
|
+
// Select sizes
|
140
|
+
&.select-sm {
|
141
|
+
font-size: $font-size-sm;
|
142
|
+
height: $control-size-sm;
|
143
|
+
padding: $control-padding-v-sm ($control-icon-size + $control-padding-h) $control-padding-v-sm $control-padding-h;
|
144
|
+
}
|
145
|
+
|
146
|
+
&.select-lg {
|
147
|
+
font-size: $font-size-lg;
|
148
|
+
height: $control-size-lg;
|
149
|
+
padding: $control-padding-v-lg ($control-icon-size + $control-padding-h) $control-padding-v-lg $control-padding-h;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
// Form Icons
|
154
|
+
.has-icon-left,
|
155
|
+
.has-icon-right {
|
156
|
+
position: relative;
|
157
|
+
|
158
|
+
.form-icon {
|
159
|
+
height: $control-icon-size;
|
160
|
+
margin: 0 $control-padding-v;
|
161
|
+
position: absolute;
|
162
|
+
top: 50%;
|
163
|
+
transform: translateY(-50%);
|
164
|
+
width: $control-icon-size;
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
.has-icon-left {
|
169
|
+
.form-icon {
|
170
|
+
left: $border-width;
|
171
|
+
}
|
172
|
+
|
173
|
+
.form-input {
|
174
|
+
padding-left: $control-icon-size + $control-padding-v * 2;
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
.has-icon-right {
|
179
|
+
.form-icon {
|
180
|
+
right: $border-width;
|
181
|
+
}
|
182
|
+
|
183
|
+
.form-input {
|
184
|
+
padding-right: $control-icon-size + $control-padding-v * 2;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
// Form element: Checkbox and Radio
|
189
|
+
.form-checkbox,
|
190
|
+
.form-radio,
|
191
|
+
.form-switch {
|
192
|
+
display: inline-block;
|
193
|
+
line-height: $line-height;
|
194
|
+
padding: ($control-size-sm - $line-height) / 2 ($control-icon-size + $control-padding-h);
|
195
|
+
position: relative;
|
196
|
+
|
197
|
+
input {
|
198
|
+
clip: rect(0, 0, 0, 0);
|
199
|
+
height: 1px;
|
200
|
+
margin: -1px;
|
201
|
+
overflow: hidden;
|
202
|
+
position: absolute;
|
203
|
+
width: 1px;
|
204
|
+
&:focus + .form-icon {
|
205
|
+
border-color: $primary-color;
|
206
|
+
@include control-shadow();
|
207
|
+
}
|
208
|
+
&:checked + .form-icon {
|
209
|
+
background: $primary-color;
|
210
|
+
border-color: $primary-color;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
214
|
+
.form-icon {
|
215
|
+
border: $border-width solid $border-color-dark;
|
216
|
+
@include control-transition();
|
217
|
+
cursor: pointer;
|
218
|
+
display: inline-block;
|
219
|
+
position: absolute;
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
.form-checkbox,
|
224
|
+
.form-radio {
|
225
|
+
.form-icon {
|
226
|
+
background: $bg-color-light;
|
227
|
+
height: $control-icon-size;
|
228
|
+
left: 0;
|
229
|
+
top: ($control-size-sm - $control-icon-size) / 2;
|
230
|
+
width: $control-icon-size;
|
231
|
+
}
|
232
|
+
|
233
|
+
input {
|
234
|
+
&:active + .form-icon {
|
235
|
+
background: $bg-color-dark;
|
236
|
+
}
|
237
|
+
}
|
238
|
+
}
|
239
|
+
.form-checkbox {
|
240
|
+
.form-icon {
|
241
|
+
border-radius: $border-radius;
|
242
|
+
}
|
243
|
+
|
244
|
+
input {
|
245
|
+
&:checked + .form-icon {
|
246
|
+
&::before {
|
247
|
+
background-clip: padding-box;
|
248
|
+
border: $border-width-lg solid $light-color;
|
249
|
+
border-left-width: 0;
|
250
|
+
border-top-width: 0;
|
251
|
+
content: "";
|
252
|
+
height: 10px;
|
253
|
+
left: 50%;
|
254
|
+
margin-left: -3px;
|
255
|
+
margin-top: -6px;
|
256
|
+
position: absolute;
|
257
|
+
top: 50%;
|
258
|
+
transform: rotate(45deg);
|
259
|
+
width: 6px;
|
260
|
+
}
|
261
|
+
}
|
262
|
+
&:indeterminate + .form-icon {
|
263
|
+
background: $primary-color;
|
264
|
+
border-color: $primary-color;
|
265
|
+
&::before {
|
266
|
+
background: $bg-color-light;
|
267
|
+
content: "";
|
268
|
+
height: 2px;
|
269
|
+
left: 50%;
|
270
|
+
margin-left: -5px;
|
271
|
+
margin-top: -1px;
|
272
|
+
position: absolute;
|
273
|
+
top: 50%;
|
274
|
+
width: 10px;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
}
|
278
|
+
}
|
279
|
+
.form-radio {
|
280
|
+
.form-icon {
|
281
|
+
border-radius: $control-icon-size / 2;
|
282
|
+
}
|
283
|
+
|
284
|
+
input {
|
285
|
+
&:checked + .form-icon {
|
286
|
+
&::before {
|
287
|
+
background: $bg-color-light;
|
288
|
+
border-radius: $border-radius;
|
289
|
+
content: "";
|
290
|
+
height: 4px;
|
291
|
+
left: 50%;
|
292
|
+
margin-left: -2px;
|
293
|
+
margin-top: -2px;
|
294
|
+
position: absolute;
|
295
|
+
top: 50%;
|
296
|
+
width: 4px;
|
297
|
+
}
|
298
|
+
}
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
// Form element: Switch
|
303
|
+
.form-switch {
|
304
|
+
padding-left: ($unit-8 + $control-padding-h);
|
305
|
+
|
306
|
+
.form-icon {
|
307
|
+
background: $gray-color-light;
|
308
|
+
background-clip: padding-box;
|
309
|
+
border-radius: $unit-2 + $border-width;
|
310
|
+
height: $unit-4 + $border-width * 2;
|
311
|
+
left: 0;
|
312
|
+
top: ($control-size-sm - $unit-4) / 2 - $border-width;
|
313
|
+
width: $unit-8;
|
314
|
+
&::before {
|
315
|
+
background: $bg-color-light;
|
316
|
+
border-radius: $unit-2;
|
317
|
+
content: "";
|
318
|
+
display: block;
|
319
|
+
height: $unit-4;
|
320
|
+
left: 0;
|
321
|
+
position: absolute;
|
322
|
+
top: 0;
|
323
|
+
@include control-transition();
|
324
|
+
width: $unit-4;
|
325
|
+
}
|
326
|
+
}
|
327
|
+
|
328
|
+
input {
|
329
|
+
&:checked + .form-icon {
|
330
|
+
&::before {
|
331
|
+
left: 14px;
|
332
|
+
}
|
333
|
+
}
|
334
|
+
&:active + .form-icon {
|
335
|
+
&::before {
|
336
|
+
background: $bg-color;
|
337
|
+
}
|
338
|
+
}
|
339
|
+
}
|
340
|
+
}
|
341
|
+
|
342
|
+
// Form element: Input groups
|
343
|
+
.input-group {
|
344
|
+
display: flex;
|
345
|
+
|
346
|
+
.input-group-addon {
|
347
|
+
background: $bg-color;
|
348
|
+
border: $border-width solid $border-color-dark;
|
349
|
+
border-radius: $border-radius;
|
350
|
+
line-height: $line-height;
|
351
|
+
padding: $control-padding-v $control-padding-h;
|
352
|
+
|
353
|
+
&.addon-sm {
|
354
|
+
font-size: $font-size-sm;
|
355
|
+
padding: $control-padding-v-sm $control-padding-h;
|
356
|
+
}
|
357
|
+
&.addon-lg {
|
358
|
+
font-size: $font-size-lg;
|
359
|
+
padding: $control-padding-v-lg $control-padding-h;
|
360
|
+
}
|
361
|
+
}
|
362
|
+
|
363
|
+
.form-input,
|
364
|
+
.form-select {
|
365
|
+
flex: 1 1 auto;
|
366
|
+
}
|
367
|
+
|
368
|
+
.input-group-btn {
|
369
|
+
z-index: $zindex-0;
|
370
|
+
}
|
371
|
+
|
372
|
+
.form-input,
|
373
|
+
.form-select,
|
374
|
+
.input-group-addon,
|
375
|
+
.input-group-btn {
|
376
|
+
&:first-child:not(:last-child) {
|
377
|
+
border-bottom-right-radius: 0;
|
378
|
+
border-top-right-radius: 0;
|
379
|
+
}
|
380
|
+
&:not(:first-child):not(:last-child) {
|
381
|
+
border-radius: 0;
|
382
|
+
margin-left: -$border-width;
|
383
|
+
}
|
384
|
+
&:last-child:not(:first-child) {
|
385
|
+
border-bottom-left-radius: 0;
|
386
|
+
border-top-left-radius: 0;
|
387
|
+
margin-left: -$border-width;
|
388
|
+
}
|
389
|
+
&:focus {
|
390
|
+
z-index: $zindex-0 + 1;
|
391
|
+
}
|
392
|
+
}
|
393
|
+
|
394
|
+
.form-select {
|
395
|
+
width: auto;
|
396
|
+
}
|
397
|
+
|
398
|
+
&.input-inline {
|
399
|
+
display: inline-flex;
|
400
|
+
}
|
401
|
+
}
|
402
|
+
|
403
|
+
// Form validation states
|
404
|
+
.form-input,
|
405
|
+
.form-select {
|
406
|
+
.has-success &,
|
407
|
+
&.is-success {
|
408
|
+
border-color: $success-color;
|
409
|
+
&:focus {
|
410
|
+
@include control-shadow($success-color);
|
411
|
+
}
|
412
|
+
}
|
413
|
+
|
414
|
+
.has-error &,
|
415
|
+
&.is-error {
|
416
|
+
border-color: $error-color;
|
417
|
+
&:focus {
|
418
|
+
@include control-shadow($error-color);
|
419
|
+
}
|
420
|
+
}
|
421
|
+
}
|
422
|
+
|
423
|
+
.form-checkbox,
|
424
|
+
.form-radio,
|
425
|
+
.form-switch {
|
426
|
+
.has-error &,
|
427
|
+
&.is-error {
|
428
|
+
.form-icon {
|
429
|
+
border-color: $error-color;
|
430
|
+
}
|
431
|
+
|
432
|
+
input {
|
433
|
+
&:checked + .form-icon {
|
434
|
+
background: $error-color;
|
435
|
+
border-color: $error-color;
|
436
|
+
}
|
437
|
+
|
438
|
+
&:focus + .form-icon {
|
439
|
+
border-color: $error-color;
|
440
|
+
@include control-shadow($error-color);
|
441
|
+
}
|
442
|
+
}
|
443
|
+
}
|
444
|
+
}
|
445
|
+
|
446
|
+
// validation based on :placeholder-shown (Edge doesn't support it yet)
|
447
|
+
.form-input {
|
448
|
+
&:not(:placeholder-shown) {
|
449
|
+
&:invalid {
|
450
|
+
border-color: $error-color;
|
451
|
+
&:focus {
|
452
|
+
@include control-shadow($error-color);
|
453
|
+
}
|
454
|
+
|
455
|
+
& + .form-input-hint {
|
456
|
+
color: $error-color;
|
457
|
+
}
|
458
|
+
}
|
459
|
+
}
|
460
|
+
}
|
461
|
+
|
462
|
+
// Form disabled and readonly
|
463
|
+
.form-input,
|
464
|
+
.form-select {
|
465
|
+
&:disabled,
|
466
|
+
&.disabled {
|
467
|
+
background-color: $bg-color-dark;
|
468
|
+
cursor: not-allowed;
|
469
|
+
opacity: .5;
|
470
|
+
}
|
471
|
+
}
|
472
|
+
|
473
|
+
.form-input {
|
474
|
+
&[readonly] {
|
475
|
+
background-color: $bg-color;
|
476
|
+
}
|
477
|
+
}
|
478
|
+
|
479
|
+
input {
|
480
|
+
&:disabled,
|
481
|
+
&.disabled {
|
482
|
+
& + .form-icon {
|
483
|
+
background: $bg-color-dark;
|
484
|
+
cursor: not-allowed;
|
485
|
+
opacity: .5;
|
486
|
+
}
|
487
|
+
}
|
488
|
+
}
|
489
|
+
|
490
|
+
.form-switch {
|
491
|
+
input {
|
492
|
+
&:disabled,
|
493
|
+
&.disabled {
|
494
|
+
& + .form-icon::before {
|
495
|
+
background: $bg-color-light;
|
496
|
+
}
|
497
|
+
}
|
498
|
+
}
|
499
|
+
}
|
500
|
+
|
501
|
+
// Form Horizontal
|
502
|
+
.form-horizontal {
|
503
|
+
padding: $layout-spacing;
|
504
|
+
|
505
|
+
.form-group {
|
506
|
+
display: flex;
|
507
|
+
}
|
508
|
+
|
509
|
+
.form-checkbox,
|
510
|
+
.form-radio,
|
511
|
+
.form-switch {
|
512
|
+
margin: ($control-size - $control-size-sm) / 2 0;
|
513
|
+
}
|
514
|
+
}
|