material-sass 4.0.0.alpha6 → 4.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +36 -8
  4. data/Rakefile +16 -3
  5. data/app/assets/javascripts/material-sprockets.js +6 -1
  6. data/app/assets/javascripts/material.js +654 -417
  7. data/app/assets/javascripts/material.min.js +1 -0
  8. data/app/assets/javascripts/material/addons/picker.date.js +234 -0
  9. data/app/assets/javascripts/material/addons/picker.js +172 -0
  10. data/app/assets/javascripts/material/addons/textarea-autosize.js +20 -2
  11. data/app/assets/javascripts/material/addons/waves.js +127 -0
  12. data/app/assets/javascripts/material/components/floating-label.js +92 -0
  13. data/app/assets/javascripts/material/components/navdrawer.js +353 -0
  14. data/app/assets/javascripts/material/components/selection-control-focus.js +47 -0
  15. data/app/assets/javascripts/material/components/tab-switch.js +148 -0
  16. data/app/assets/javascripts/material/components/util.js +133 -0
  17. data/app/assets/javascripts/material/initializers/picker.js +171 -0
  18. data/app/assets/javascripts/material/initializers/textarea-autosize.js +10 -0
  19. data/app/assets/javascripts/material/initializers/waves.js +13 -0
  20. data/app/assets/stylesheets/material/_colours.scss +324 -0
  21. data/app/assets/stylesheets/material/_functions.scss +65 -0
  22. data/app/assets/stylesheets/material/_mixins.scss +23 -23
  23. data/app/assets/stylesheets/material/_print.scss +102 -0
  24. data/app/assets/stylesheets/material/_utilities.scss +21 -17
  25. data/app/assets/stylesheets/material/_variables.scss +13 -42
  26. data/app/assets/stylesheets/material/base/_base.scss +420 -5
  27. data/app/assets/stylesheets/material/base/_grid.scss +34 -33
  28. data/app/assets/stylesheets/material/base/_typography.scss +165 -174
  29. data/app/assets/stylesheets/material/bootstrap/_alert.scss +32 -39
  30. data/app/assets/stylesheets/material/bootstrap/_badge.scss +34 -0
  31. data/app/assets/stylesheets/material/bootstrap/_breadcrumb.scss +18 -18
  32. data/app/assets/stylesheets/material/bootstrap/_carousel.scss +127 -142
  33. data/app/assets/stylesheets/material/bootstrap/_close.scss +18 -19
  34. data/app/assets/stylesheets/material/bootstrap/_code.scss +10 -7
  35. data/app/assets/stylesheets/material/bootstrap/_custom-form.scss +50 -56
  36. data/app/assets/stylesheets/material/bootstrap/_form.scss +159 -129
  37. data/app/assets/stylesheets/material/bootstrap/_image.scss +19 -16
  38. data/app/assets/stylesheets/material/bootstrap/_jumbotron.scss +10 -7
  39. data/app/assets/stylesheets/material/bootstrap/_nav.scss +71 -69
  40. data/app/assets/stylesheets/material/bootstrap/_pagination.scss +34 -26
  41. data/app/assets/stylesheets/material/bootstrap/_popover.scss +26 -59
  42. data/app/assets/stylesheets/material/bootstrap/_responsive-embed.scss +4 -4
  43. data/app/assets/stylesheets/material/bootstrap/_transition.scss +10 -8
  44. data/app/assets/stylesheets/material/material.scss +75 -62
  45. data/app/assets/stylesheets/material/material/_button-flat.scss +26 -39
  46. data/app/assets/stylesheets/material/material/_button-float.scss +10 -14
  47. data/app/assets/stylesheets/material/material/_button-group.scss +268 -0
  48. data/app/assets/stylesheets/material/material/_button.scss +133 -189
  49. data/app/assets/stylesheets/material/material/_card.scss +300 -248
  50. data/app/assets/stylesheets/material/material/_chip.scss +65 -64
  51. data/app/assets/stylesheets/material/material/_data-table.scss +135 -45
  52. data/app/assets/stylesheets/material/material/_dialog.scss +141 -110
  53. data/app/assets/stylesheets/material/material/_expansion-panel.scss +86 -119
  54. data/app/assets/stylesheets/material/material/_menu.scss +308 -228
  55. data/app/assets/stylesheets/material/material/_navdrawer.scss +239 -234
  56. data/app/assets/stylesheets/material/material/_picker.scss +157 -155
  57. data/app/assets/stylesheets/material/material/_progress-circular.scss +80 -80
  58. data/app/assets/stylesheets/material/material/_progress.scss +180 -115
  59. data/app/assets/stylesheets/material/material/_selection-control.scss +132 -139
  60. data/app/assets/stylesheets/material/material/_stepper.scss +94 -93
  61. data/app/assets/stylesheets/material/material/_tab.scss +74 -93
  62. data/app/assets/stylesheets/material/material/_text-field-floating-label.scss +29 -20
  63. data/app/assets/stylesheets/material/material/_text-field-input-group.scss +94 -24
  64. data/app/assets/stylesheets/material/material/_text-field-textarea.scss +13 -26
  65. data/app/assets/stylesheets/material/material/_text-field.scss +127 -118
  66. data/app/assets/stylesheets/material/material/_toolbar.scss +308 -313
  67. data/app/assets/stylesheets/material/material/_tooltip.scss +23 -62
  68. data/app/assets/stylesheets/material/mixins/_background-variant.scss +6 -6
  69. data/app/assets/stylesheets/material/mixins/_border-radius.scss +17 -17
  70. data/app/assets/stylesheets/material/mixins/_breakpoint.scss +32 -2
  71. data/app/assets/stylesheets/material/mixins/_clearfix.scss +1 -1
  72. data/app/assets/stylesheets/material/mixins/_form.scss +62 -25
  73. data/app/assets/stylesheets/material/mixins/_grid-framework.scss +8 -16
  74. data/app/assets/stylesheets/material/mixins/_grid.scss +40 -64
  75. data/app/assets/stylesheets/material/mixins/_material-icons.scss +36 -0
  76. data/app/assets/stylesheets/material/mixins/_nav-divider.scss +1 -1
  77. data/app/assets/stylesheets/material/mixins/_reset-text.scss +2 -21
  78. data/app/assets/stylesheets/material/mixins/_screenreader.scss +14 -12
  79. data/app/assets/stylesheets/material/mixins/_text-alignment.scss +23 -0
  80. data/app/assets/stylesheets/material/mixins/_text-emphasis.scss +6 -6
  81. data/app/assets/stylesheets/material/mixins/_transition.scss +42 -10
  82. data/app/assets/stylesheets/material/utilities/_background.scss +18 -18
  83. data/app/assets/stylesheets/material/utilities/_border.scss +88 -41
  84. data/app/assets/stylesheets/material/utilities/_display.scss +63 -30
  85. data/app/assets/stylesheets/material/utilities/_flex.scss +139 -134
  86. data/app/assets/stylesheets/material/utilities/_material-icons.scss +3 -5
  87. data/app/assets/stylesheets/material/utilities/_position.scss +19 -22
  88. data/app/assets/stylesheets/material/utilities/_sizing.scss +11 -12
  89. data/app/assets/stylesheets/material/utilities/_spacing.scss +51 -56
  90. data/app/assets/stylesheets/material/utilities/_text.scss +80 -75
  91. data/app/assets/stylesheets/material/utilities/_visibility.scss +5 -46
  92. data/app/assets/stylesheets/material/utilities/_waves.scss +11 -18
  93. data/app/assets/stylesheets/material/variables/_elevation-shadow.scss +89 -82
  94. data/app/assets/stylesheets/material/variables/_grid.scss +29 -26
  95. data/app/assets/stylesheets/material/variables/_palette.scss +45 -0
  96. data/app/assets/stylesheets/material/variables/_spacer.scss +34 -88
  97. data/app/assets/stylesheets/material/variables/_transition.scss +29 -0
  98. data/app/assets/stylesheets/material/variables/_typography.scss +88 -74
  99. data/app/assets/stylesheets/material/variables/_variable-bootstrap.scss +196 -133
  100. data/app/assets/stylesheets/material/variables/_variable-material.scss +481 -429
  101. data/lib/material-sass/version.rb +1 -1
  102. data/material-sass.gemspec +3 -3
  103. metadata +26 -21
  104. data/app/assets/javascripts/material/addons-materialise/pickadate.js +0 -139
  105. data/app/assets/javascripts/material/addons-materialise/textarea-autosize.js +0 -11
  106. data/app/assets/javascripts/material/addons-materialise/wave.js +0 -15
  107. data/app/assets/javascripts/material/addons/pickadate.js +0 -7
  108. data/app/assets/javascripts/material/addons/wave.js +0 -5
  109. data/app/assets/javascripts/material/src/floating-label.js +0 -91
  110. data/app/assets/javascripts/material/src/navdrawer.js +0 -352
  111. data/app/assets/javascripts/material/src/tab-switch.js +0 -133
  112. data/app/assets/javascripts/material/src/util.js +0 -138
  113. data/app/assets/stylesheets/material/base/_normalize.scss +0 -253
  114. data/app/assets/stylesheets/material/base/_reboot.scss +0 -239
  115. data/app/assets/stylesheets/material/bootstrap/_button-group.scss +0 -134
  116. data/app/assets/stylesheets/material/mixins/_tab-focus.scss +0 -5
  117. data/app/assets/stylesheets/material/mixins/_transform.scss +0 -9
  118. data/app/assets/stylesheets/material/variables/_animation.scss +0 -22
  119. data/app/assets/stylesheets/material/variables/_colour.scss +0 -389
@@ -1,8 +1,6 @@
1
- //
2
- // todo: material design guidelines do not have specs for striped progress bars
3
- // maybe striped progress bars should be the "buffer" variation of linear indicator
1
+ // Material design does not have specs for striped progress bars
2
+ // so striped progress bars have been styled according to the "buffer" variation of linear indicator
4
3
  // (https://material.google.com/components/progress-activity.html#progress-activity-types-of-indicators)
5
- //
6
4
 
7
5
  .progress {
8
6
  display: flex;
@@ -11,140 +9,207 @@
11
9
  }
12
10
 
13
11
  .progress-bar {
14
- background-color: $progress-bar-bg;
15
- height: $progress-height;
12
+ border-bottom: $progress-bar-height solid $progress-bar-bg;
16
13
 
17
- &::before {
18
- background-color: inherit;
19
- background-image: linear-gradient(to right, $progress-bar-mask, $progress-bar-mask);
20
- content: "";
14
+ &::after {
15
+ background-color: $progress-bg;
16
+ content: '';
21
17
  display: block;
18
+ height: $progress-bar-height;
22
19
  position: absolute;
23
- top: 0;
24
- right: 0;
25
- bottom: 0;
26
- left: 0;
20
+ right: 0;
21
+ bottom: 0;
22
+ left: 0;
27
23
  z-index: -1;
28
24
  }
29
- }
30
25
 
31
- //
32
- // animated & striped
33
- //
34
- .progress-bar-animated {
35
- &::before {
36
- animation-direction: reverse;
37
- animation-duration: $transition-duration;
38
- animation-iteration-count: infinite;
39
- animation-name: progress-bar-animation;
40
- animation-timing-function: linear;
26
+ // Colour
27
+ @each $color, $values in $theme-colors {
28
+ &.bg-#{$color} {
29
+ background-color: transparent !important;
30
+ border-bottom-color: map-get(theme-color($color), color);
31
+
32
+ &::after {
33
+ background-color: map-get(theme-color($color), lighter);
34
+ }
35
+
36
+ &::before {
37
+ background-image: repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, map-get(theme-color($color), lighter), map-get(theme-color($color), lighter) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
38
+ // scss-lint:disable VendorPrefix
39
+ background-image: -webkit-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, map-get(theme-color($color), lighter), map-get(theme-color($color), lighter) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
40
+ // scss-lint:enable VendorPrefix
41
+ }
41
42
  }
42
43
  }
44
+ }
43
45
 
44
- .progress-bar-animated,
45
- .progress-bar-striped {
46
- border-right: ($progress-height * 3) solid $progress-bar-mask;
47
- box-sizing: content-box;
48
46
 
49
- &[style*="width:100%"],
50
- &[style*="width: 100%"] {
51
- border-right: 0;
47
+
48
+ // Animated & striped
49
+
50
+ .progress-bar-animated {
51
+ &::before {
52
+ animation-direction: reverse;
53
+ animation-duration: $transition-duration-mobile;
54
+ animation-iteration-count: infinite;
55
+ animation-name: progress-bar-animation;
56
+ animation-timing-function: linear;
57
+
58
+ @include media-breakpoint-up(sm) {
59
+ animation-duration: $transition-duration-tablet;
52
60
  }
53
61
 
54
- &::before {
55
- background-color: transparent;
56
- background-image: repeating-radial-gradient(#{$progress-height / 2} #{$progress-height / 2}, #{$black-divider}, #{$black-divider} #{$progress-height / 2}, transparent #{$progress-height / 2}, transparent 100%);
57
- background-image: -webkit-repeating-radial-gradient(#{$progress-height / 2} #{$progress-height / 2}, #{$black-divider}, #{$black-divider} #{$progress-height / 2}, transparent #{$progress-height / 2}, transparent 100%);
58
- background-position: 0 0;
59
- background-repeat: repeat-x;
60
- background-size: ($progress-height * 3) ($progress-height * 3);
62
+ @include media-breakpoint-up(lg) {
63
+ animation-duration: $transition-duration-desktop;
61
64
  }
62
65
  }
66
+ }
63
67
 
64
- @keyframes progress-bar-animation {
65
- from {
66
- background-position: 0 0;
67
- }
68
- to {
69
- background-position: ($progress-height * 3) 0;
70
- }
68
+ .progress-bar-animated,
69
+ .progress-bar-striped {
70
+ box-sizing: content-box;
71
+ position: relative;
72
+
73
+ &[style*="width:100%"],
74
+ &[style*="width: 100%"] {
75
+ border-right: 0;
71
76
  }
72
77
 
73
- //
74
- // indeterminate
75
- //
76
- .progress-bar-indeterminate {
77
- background-image: linear-gradient(to right, $progress-bar-mask, $progress-bar-mask);
78
- position: relative;
79
- width: 100% !important;
80
-
81
- &::after,
82
- &::before {
83
- animation-duration: 2s;
84
- animation-iteration-count: infinite;
85
- animation-timing-function: linear;
86
- width: 0%;
87
- @include border-radius($border-radius);
88
- }
78
+ &::after {
79
+ @include border-right-radius($progress-bar-border-radius);
89
80
 
90
- &::after {
91
- animation-name: progress-bar-indeterminate-after;
92
- background-color: inherit;
93
- content: "";
94
- display: block;
95
- position: absolute;
96
- top: 0;
97
- bottom: 0;
98
- left: 0;
99
- }
81
+ right: ($progress-bar-height * -6);
82
+ bottom: ($progress-bar-height * -1);
83
+ }
100
84
 
101
- &::before {
102
- animation-name: progress-bar-indeterminate-before;
103
- background-image: none;
104
- // position
105
- right: auto;
106
- z-index: 0;
107
- }
85
+ &::before {
86
+ background-image: repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, #{$progress-bg}, #{$progress-bg} #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
87
+ // scss-lint:disable VendorPrefix
88
+ background-image: -webkit-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, #{$progress-bg}, #{$progress-bg} #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
89
+ // scss-lint:enable VendorPrefix
90
+ background-position: 0 0;
91
+ background-repeat: repeat-x;
92
+ background-size: ($progress-bar-height * 3) ($progress-bar-height * 3);
93
+ content: '';
94
+ display: block;
95
+ height: $progress-bar-height;
96
+ position: absolute;
97
+ right: -100vw;
98
+ bottom: ($progress-bar-height * -1);
99
+ left: 0;
100
+ z-index: -1;
108
101
  }
109
102
 
110
- @keyframes progress-bar-indeterminate-after {
111
- 0% {
112
- // position
113
- left: 0%;
114
- width: 0%;
115
- }
116
- 50% {
117
- // position
118
- left: 25%;
119
- width: 75%;
120
- }
121
- 75% {
122
- // position
123
- left: 100%;
124
- width: 0%;
103
+ // Colour
104
+ @each $color, $values in $theme-colors {
105
+ &.bg-#{$color}::before {
106
+ background-image: repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, map-get(theme-color($color), lighter), map-get(theme-color($color), lighter) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
107
+ // scss-lint:disable VendorPrefix
108
+ background-image: -webkit-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, map-get(theme-color($color), lighter), map-get(theme-color($color), lighter) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
109
+ // scss-lint:enable VendorPrefix
125
110
  }
126
111
  }
112
+ }
127
113
 
128
- @keyframes progress-bar-indeterminate-before {
129
- 0%,
130
- 62.5% {
131
- // position
132
- left: 0%;
133
- width: 0%;
134
- }
135
- 71.875% {
136
- // position
137
- left: 0%;
138
- width: 25%;
139
- }
140
- 81.25% {
141
- // position
142
- left: 25%;
143
- width: 50%;
144
- }
145
- 100% {
146
- // position
147
- left: 100%;
148
- width: 25%;
114
+ @keyframes progress-bar-animation {
115
+ from {
116
+ background-position: 0 0;
117
+ }
118
+
119
+ to {
120
+ background-position: ($progress-bar-height * 3) 0;
121
+ }
122
+ }
123
+
124
+
125
+
126
+ // Indeterminate
127
+
128
+ .progress-bar-indeterminate {
129
+ border-bottom-color: $progress-bg;
130
+ position: relative;
131
+ width: 100%;
132
+
133
+ &::after,
134
+ &::before {
135
+ @include border-radius($border-radius);
136
+
137
+ animation-duration: 2s;
138
+ animation-iteration-count: infinite;
139
+ animation-timing-function: linear;
140
+ background-color: $progress-bar-bg;
141
+ width: 0%;
142
+ }
143
+
144
+ &::after {
145
+ animation-name: progress-bar-indeterminate-after;
146
+ bottom: ($progress-bar-height * -1);
147
+ z-index: 0;
148
+ }
149
+
150
+ &::before {
151
+ animation-name: progress-bar-indeterminate-before;
152
+ content: '';
153
+ display: block;
154
+ height: $progress-bar-height;
155
+ position: absolute;
156
+ bottom: ($progress-bar-height * -1);
157
+ z-index: 0;
158
+ }
159
+
160
+ // Colour
161
+ @each $color, $values in $theme-colors {
162
+ &.bg-#{$color} {
163
+ border-bottom-color: map-get(theme-color($color), lighter);
164
+
165
+ &::after,
166
+ &::before {
167
+ background-color: map-get(theme-color($color), color);
168
+ }
169
+
170
+ &::before {
171
+ background-image: none;
172
+ }
149
173
  }
150
174
  }
175
+ }
176
+
177
+ @keyframes progress-bar-indeterminate-after {
178
+ 0% {
179
+ left: 0%;
180
+ width: 0%;
181
+ }
182
+
183
+ 50% {
184
+ left: 25%;
185
+ width: 75%;
186
+ }
187
+
188
+ 75% {
189
+ left: 100%;
190
+ width: 0%;
191
+ }
192
+ }
193
+
194
+ @keyframes progress-bar-indeterminate-before {
195
+ 0%,
196
+ 62.5% {
197
+ left: 0%;
198
+ width: 0%;
199
+ }
200
+
201
+ 71.875% {
202
+ left: 0%;
203
+ width: 25%;
204
+ }
205
+
206
+ 81.25% {
207
+ left: 25%;
208
+ width: 50%;
209
+ }
210
+
211
+ 100% {
212
+ left: 100%;
213
+ width: 25%;
214
+ }
215
+ }
@@ -1,47 +1,42 @@
1
1
  .custom-control {
2
- cursor: pointer;
2
+ color: inherit;
3
3
  display: inline-flex;
4
4
  font-size: $font-size-base;
5
5
  margin-right: ($selection-control-spacer-x * 2);
6
6
  min-height: ($font-size-base * $line-height-base);
7
- padding-left: ($selection-control-indicator-size / $font-size-root + $selection-control-spacer-x);
7
+ padding-left: ($selection-control-indicator-size + $selection-control-spacer-x);
8
8
  position: relative;
9
9
  }
10
10
 
11
11
  .custom-control-indicator {
12
- background-position: 50% 50%;
13
- background-repeat: no-repeat;
14
- background-size: $selection-control-indicator-size $selection-control-indicator-size;
15
- display: block;
12
+ align-items: center;
13
+ color: $selection-control-color;
14
+ display: flex;
16
15
  height: $selection-control-indicator-size;
17
16
  pointer-events: none;
18
17
  position: absolute;
19
- top: (($font-size-base * $line-height-base - $selection-control-indicator-size / $font-size-root) / 2);
20
- left: 0;
18
+ top: (($font-size-base * $line-height-base - $selection-control-indicator-size) / 2);
19
+ left: 0;
21
20
  user-select: none;
22
- width: $selection-control-indicator-size;
21
+ width: ($selection-control-indicator-size + $selection-control-spacer-x);
23
22
 
24
23
  &::before {
24
+ @include transition-standard(background-color, opacity, transform);
25
+
25
26
  background-color: $selection-control-radial-bg;
26
27
  border-radius: 50%;
27
- content: "";
28
+ content: '';
28
29
  display: block;
29
30
  height: ($selection-control-indicator-size * 2);
30
31
  margin-top: ($selection-control-indicator-size / -2);
31
32
  margin-left: ($selection-control-indicator-size / -2);
32
33
  opacity: 0;
33
34
  position: absolute;
34
- top: 0;
35
- left: 0;
35
+ top: 0;
36
+ left: 0;
37
+ transform: scale(.87, .87) translateZ(0);
36
38
  width: ($selection-control-indicator-size * 2);
37
- z-index: -1;
38
- @include transition-standard(background-color, opacity, transform);
39
39
  }
40
-
41
- // active, focus, hover
42
- &:active::before {
43
- opacity: 1;
44
- }
45
40
  }
46
41
 
47
42
  .custom-control-input {
@@ -49,156 +44,154 @@
49
44
  position: absolute;
50
45
  z-index: -1;
51
46
 
52
- // active, focus, hover
53
- &:focus ~ .custom-control-indicator::before {
47
+ // Active, focus, hover
48
+ &:active,
49
+ &.focus {
50
+ ~ .custom-control-indicator::before {
54
51
  opacity: 1;
52
+ transform: scale(1, 1) translateZ(0);
55
53
  }
54
+ }
56
55
 
57
- // checked
58
- &:checked ~ .custom-control-indicator::before {
59
- background-color: hex-to-rgba($selection-control-color-active, 0.12);
60
- }
56
+ // Checked
57
+ &:checked ~ {
58
+ .custom-control-indicator {
59
+ color: $selection-control-color-active;
61
60
 
62
- // disabled
63
- &:disabled ~ {
64
- .custom-control-indicator,
65
- .custom-control-description {
66
- color: $selection-control-color-disabled;
67
- cursor: $cursor-disabled;
61
+ &::before {
62
+ background-color: hex-to-rgba($selection-control-color-active, .12);
68
63
  }
64
+ }
65
+ }
69
66
 
70
- .custom-control-indicator {
71
- &::before {
72
- display: none;
73
- }
74
- }
67
+ // Disabled
68
+ &:disabled ~ {
69
+ .custom-control-indicator,
70
+ .custom-control-description {
71
+ color: $selection-control-color-disabled;
72
+ }
73
+
74
+ .custom-control-indicator::before {
75
+ display: none;
75
76
  }
77
+ }
76
78
  }
77
79
 
78
- // stacked layout
79
- .custom-controls-stacked {
80
+
81
+
82
+ // Stacked layout
83
+ .custom-controls-stacked {
84
+ display: flex;
85
+ flex-direction: column;
86
+
87
+ .custom-control {
80
88
  display: flex;
81
- flex-direction: column;
89
+ margin-right: 0;
90
+ margin-bottom: $selection-control-spacer-y;
91
+ }
92
+ }
82
93
 
83
- .custom-control {
84
- margin-right: 0;
85
- margin-bottom: $selection-control-spacer-y;
86
- }
94
+
95
+
96
+ // Checkbox
97
+
98
+ .custom-checkbox {
99
+ .custom-control-indicator::after {
100
+ @include set-material-icons;
101
+
102
+ content: $selection-control-checkbox-icon;
87
103
  }
88
104
 
89
- //
90
- // checkbox
91
- //
92
- .custom-checkbox {
93
- .custom-control-indicator {
94
- background-image: $selection-control-checkbox-bg;
105
+ .custom-control-input {
106
+ // Checked
107
+ &:checked ~ .custom-control-indicator::after {
108
+ content: $selection-control-checkbox-icon-checked;
95
109
  }
96
110
 
97
- .custom-control-input {
98
- // checked
99
- &:checked ~ .custom-control-indicator {
100
- background-image: $selection-control-checkbox-bg-checked;
101
- }
102
-
103
- // disabled
104
- &:disabled {
105
- ~ .custom-control-indicator {
106
- background-image: $selection-control-checkbox-bg-disabled;
107
- }
108
-
109
- &:checked ~ .custom-control-indicator {
110
- background-image: $selection-control-checkbox-bg-disabled-checked;
111
- }
112
- }
113
-
114
- // indeterminate
115
- &:indeterminate ~ .custom-control-indicator {
116
- background-image: $selection-control-checkbox-bg-indeterminate;
117
- }
111
+ // Indeterminate
112
+ &:indeterminate ~ .custom-control-indicator::after {
113
+ content: $selection-control-checkbox-icon-indeterminate;
118
114
  }
119
115
  }
116
+ }
120
117
 
121
- //
122
- // radio button
123
- //
124
- .custom-radio {
125
- .custom-control-indicator {
126
- background-image: $selection-control-radio-bg;
127
- }
128
118
 
129
- .custom-control-input {
130
- // checked
131
- &:checked ~ .custom-control-indicator {
132
- background-image: $selection-control-radio-bg-checked;
133
- }
134
-
135
- // disabled
136
- &:disabled {
137
- ~ .custom-control-indicator {
138
- background-image: $selection-control-radio-bg-disabled;
139
- }
140
-
141
- &:checked ~ .custom-control-indicator {
142
- background-image: $selection-control-radio-bg-disabled-checked;
143
- }
144
- }
119
+
120
+ // Radio button
121
+
122
+ .custom-radio {
123
+ .custom-control-indicator::after {
124
+ @include set-material-icons;
125
+
126
+ content: $selection-control-radio-icon;
127
+ }
128
+
129
+ .custom-control-input {
130
+ // Checked
131
+ &:checked ~ .custom-control-indicator::after {
132
+ content: $selection-control-radio-icon-checked;
145
133
  }
146
134
  }
135
+ }
147
136
 
148
- //
149
- // switch
150
- //
151
- .custom-switch {
152
- padding-left: ($selection-control-track-width / $font-size-root + $selection-control-spacer-x);
153
137
 
154
- .custom-control-indicator {
155
- background-clip: content-box;
156
- background-color: $selection-control-track-bg;
157
- border: (($selection-control-indicator-size - $selection-control-track-height) / 2) solid transparent;
158
- border-radius: $selection-control-track-height;
159
- width: $selection-control-track-width;
160
- @include transition-standard(background-color);
138
+
139
+ // Switch
140
+
141
+ .custom-switch {
142
+ padding-left: ($selection-control-track-width + $selection-control-spacer-x);
143
+
144
+ .custom-control-indicator {
145
+ @include transition-standard(background-color);
146
+
147
+ background-clip: content-box;
148
+ background-color: $selection-control-track-bg;
149
+ border: (($selection-control-indicator-size - $selection-control-track-height) / 2) solid transparent;
150
+ border-radius: $selection-control-track-height;
151
+ width: $selection-control-track-width;
152
+
153
+ &::after,
154
+ &::before {
155
+ top: (($selection-control-indicator-size - $selection-control-track-height) / -2);
156
+ left: (($selection-control-indicator-size - $selection-control-track-height) / -2);
157
+ }
158
+
159
+ &::after {
160
+ @include transition-standard(background-color, transform);
161
+
162
+ background-color: $selection-control-thumb-bg;
163
+ border-radius: 50%;
164
+ box-shadow: $selection-control-thumb-shadow;
165
+ content: '';
166
+ display: block;
167
+ height: $selection-control-indicator-size;
168
+ position: absolute;
169
+ width: $selection-control-indicator-size;
170
+ }
171
+ }
172
+
173
+ .custom-control-input {
174
+ // Checked
175
+ &:checked ~ .custom-control-indicator {
176
+ background-color: hex-to-rgba($selection-control-color-active, .5);
161
177
 
162
178
  &::after,
163
179
  &::before {
164
- // position
165
- top: (($selection-control-indicator-size - $selection-control-track-height) / -2);
166
- left: (($selection-control-indicator-size - $selection-control-track-height) / -2);
180
+ transform: translateX($selection-control-track-width - $selection-control-indicator-size);
167
181
  }
182
+
168
183
  &::after {
169
- background-color: $selection-control-thumb-bg;
170
- border-radius: 50%;
171
- box-shadow: $selection-control-thumb-shadow;
172
- content: "";
173
- display: block;
174
- height: $selection-control-indicator-size;
175
- position: absolute;
176
- width: $selection-control-indicator-size;
177
- @include transition-standard(background-color, transform);
184
+ background-color: $selection-control-color-active;
178
185
  }
179
186
  }
180
187
 
181
- .custom-control-input {
182
- // checked
183
- &:checked ~ .custom-control-indicator {
184
- background-color: hex-to-rgba($selection-control-color-active, 0.5);
185
-
186
- &::after,
187
- &::before {
188
- transform: translateX($selection-control-track-width - $selection-control-indicator-size);
189
- }
190
- &::after {
191
- background-color: $selection-control-color-active;
192
- }
193
- }
194
-
195
- // disabled
196
- &:disabled ~ .custom-control-indicator {
197
- background-color: $selection-control-track-bg-disabled;
198
-
199
- &::after {
200
- background-color: $selection-control-thumb-bg-disabled;
201
- }
202
- }
188
+ // Disabled
189
+ &:disabled ~ .custom-control-indicator {
190
+ background-color: $selection-control-track-bg-disabled;
191
+
192
+ &::after {
193
+ background-color: $selection-control-thumb-bg-disabled;
194
+ }
203
195
  }
204
196
  }
197
+ }