material-sass 4.0.0.beta3 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +11 -10
  3. data/assets/javascripts/material-sprockets.js +1 -5
  4. data/assets/javascripts/material.js +155 -109
  5. data/assets/javascripts/material.min.js +4 -5
  6. data/assets/javascripts/material/addons/pickadate.js +0 -1
  7. data/assets/javascripts/material/components/expansion-panel.js +4 -5
  8. data/assets/javascripts/material/components/floating-label.js +10 -10
  9. data/assets/javascripts/material/components/nav-drawer.js +94 -68
  10. data/assets/javascripts/material/components/selection-control-focus.js +4 -5
  11. data/assets/javascripts/material/components/tab-switch.js +22 -11
  12. data/assets/javascripts/material/components/util.js +4 -14
  13. data/assets/stylesheets/material/{_colours.scss → _colors.scss} +414 -6
  14. data/assets/stylesheets/material/_functions.scss +17 -5
  15. data/assets/stylesheets/material/base/_base.scss +24 -0
  16. data/assets/stylesheets/material/bootstrap/_alert.scss +2 -2
  17. data/assets/stylesheets/material/bootstrap/_badge.scss +4 -4
  18. data/assets/stylesheets/material/bootstrap/_carousel.scss +36 -0
  19. data/assets/stylesheets/material/bootstrap/_close.scss +1 -1
  20. data/assets/stylesheets/material/bootstrap/_form.scss +26 -25
  21. data/assets/stylesheets/material/bootstrap/_pagination.scss +1 -1
  22. data/assets/stylesheets/material/material.scss +1 -1
  23. data/assets/stylesheets/material/material/_button-flat.scss +1 -1
  24. data/assets/stylesheets/material/material/_button-float.scss +22 -0
  25. data/assets/stylesheets/material/material/_button-group.scss +2 -2
  26. data/assets/stylesheets/material/material/_button.scss +6 -6
  27. data/assets/stylesheets/material/material/_card.scss +4 -4
  28. data/assets/stylesheets/material/material/_chip.scss +2 -2
  29. data/assets/stylesheets/material/material/_data-table.scss +62 -35
  30. data/assets/stylesheets/material/material/_dialog.scss +1 -1
  31. data/assets/stylesheets/material/material/_expansion-panel.scss +6 -6
  32. data/assets/stylesheets/material/material/_menu.scss +14 -0
  33. data/assets/stylesheets/material/material/_navdrawer.scss +99 -90
  34. data/assets/stylesheets/material/material/_picker.scss +69 -10
  35. data/assets/stylesheets/material/material/_progress-circular.scss +3 -3
  36. data/assets/stylesheets/material/material/_progress.scss +7 -7
  37. data/assets/stylesheets/material/material/_tab.scss +4 -0
  38. data/assets/stylesheets/material/material/_text-field-box.scss +19 -19
  39. data/assets/stylesheets/material/material/_text-field-floating-label.scss +8 -8
  40. data/assets/stylesheets/material/material/_text-field-input-group.scss +3 -3
  41. data/assets/stylesheets/material/material/_text-field.scss +3 -3
  42. data/assets/stylesheets/material/material/_toolbar.scss +48 -65
  43. data/assets/stylesheets/material/mixins/_breakpoint.scss +40 -22
  44. data/assets/stylesheets/material/mixins/_grid-framework.scss +6 -2
  45. data/assets/stylesheets/material/mixins/_grid.scss +10 -19
  46. data/assets/stylesheets/material/utilities/_background.scss +1 -1
  47. data/assets/stylesheets/material/utilities/_border.scss +1 -2
  48. data/assets/stylesheets/material/utilities/_display.scss +24 -16
  49. data/assets/stylesheets/material/utilities/_flex.scss +4 -0
  50. data/assets/stylesheets/material/utilities/_text.scss +1 -1
  51. data/assets/stylesheets/material/variables/_elevation-shadow.scss +0 -6
  52. data/assets/stylesheets/material/variables/_grid.scss +10 -19
  53. data/assets/stylesheets/material/variables/_palette.scss +26 -25
  54. data/assets/stylesheets/material/variables/_spacer.scss +24 -21
  55. data/assets/stylesheets/material/variables/_typography.scss +0 -1
  56. data/assets/stylesheets/material/variables/_variable-bootstrap.scss +7 -9
  57. data/assets/stylesheets/material/variables/_variable-material.scss +34 -29
  58. data/lib/material-sass/version.rb +1 -1
  59. metadata +5 -5
@@ -15,10 +15,10 @@
15
15
  @each $color, $values in $theme-colors {
16
16
  &.bg-#{$color} {
17
17
  background-color: transparent !important; // stylelint-disable-line declaration-no-important
18
- border-bottom-color: map-get(theme-color($color), color);
18
+ border-bottom-color: theme-color($color);
19
19
 
20
20
  &::after {
21
- background-color: map-get(theme-color($color), lighter);
21
+ background-color: theme-color-light($color);
22
22
  }
23
23
  }
24
24
  }
@@ -64,9 +64,9 @@
64
64
  @each $color, $values in $theme-colors {
65
65
  &.bg-#{$color}::before {
66
66
  // stylelint-disable value-no-vendor-prefix
67
- 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%);
68
- 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%);
69
- background-image: -moz-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%);
67
+ background-image: repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, theme-color-light($color), theme-color-light($color) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
68
+ background-image: -webkit-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, theme-color-light($color), theme-color-light($color) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
69
+ background-image: -moz-repeating-radial-gradient(#{$progress-bar-height / 2} #{$progress-bar-height / 2}, theme-color-light($color), theme-color-light($color) #{$progress-bar-height / 2}, transparent #{$progress-bar-height / 2}, transparent 100%);
70
70
  // stylelint-enable
71
71
  }
72
72
  }
@@ -122,11 +122,11 @@
122
122
 
123
123
  @each $color, $values in $theme-colors {
124
124
  &.bg-#{$color} {
125
- border-bottom-color: map-get(theme-color($color), lighter);
125
+ border-bottom-color: theme-color-light($color);
126
126
 
127
127
  &::after,
128
128
  &::before {
129
- background-color: map-get(theme-color($color), color);
129
+ background-color: theme-color($color);
130
130
  }
131
131
 
132
132
  &::before {
@@ -90,6 +90,10 @@
90
90
  &.show {
91
91
  display: block;
92
92
  }
93
+
94
+ .nav-tabs-scrollable & {
95
+ bottom: $nav-tab-height;
96
+ }
93
97
  }
94
98
  }
95
99
 
@@ -4,27 +4,27 @@
4
4
 
5
5
  padding-top: 0;
6
6
 
7
- &.has-value > label,
8
- &.is-focused > label {
7
+ &.has-value label,
8
+ &.is-focused label {
9
9
  top: $textfield-box-label-spacer-y;
10
10
  }
11
11
 
12
- > .form-control {
12
+ .form-control {
13
13
  padding-bottom: ($textfield-box-label-spacer-y - $textfield-border-width / $font-size-root * 1rem);
14
14
  }
15
15
  }
16
16
 
17
- > .form-control {
17
+ // stylelint-disable-next-line selector-no-qualifying-type
18
+ select.form-control:not([multiple]):not([size]) {
19
+ @include form-select-size($textfield-font-size, $textfield-box-height, $textfield-box-padding-x);
20
+ }
21
+
22
+ .form-control {
18
23
  @include form-control-size($textfield-font-size, $textfield-box-height, $textfield-line-height, $textfield-box-padding-x, $textfield-box-padding-y);
19
24
 
20
25
  background-color: $textfield-box-bg;
21
26
  border-radius: $textfield-box-border-radius;
22
27
  }
23
-
24
- // stylelint-disable-next-line selector-no-qualifying-type
25
- > select.form-control:not([multiple]):not([size]) {
26
- @include form-select-size($textfield-font-size, $textfield-box-height, $textfield-box-padding-x);
27
- }
28
28
  }
29
29
 
30
30
  // Size
@@ -33,14 +33,14 @@
33
33
  @include textfield-box-size($textfield-font-size-lg, $textfield-box-height-lg, $textfield-line-height-lg, $textfield-box-padding-x-lg, $textfield-box-padding-y-lg);
34
34
  }
35
35
 
36
- > .form-control {
37
- @include form-control-size($textfield-font-size-lg, $textfield-box-height-lg, $textfield-line-height-lg, $textfield-box-padding-x-lg, $textfield-box-padding-y-lg);
38
- }
39
-
40
36
  // stylelint-disable-next-line selector-no-qualifying-type
41
- > select.form-control:not([multiple]):not([size]) {
37
+ select.form-control:not([multiple]):not([size]) {
42
38
  @include form-select-size($textfield-font-size-lg, $textfield-box-height-lg, $textfield-box-padding-x-lg);
43
39
  }
40
+
41
+ .form-control {
42
+ @include form-control-size($textfield-font-size-lg, $textfield-box-height-lg, $textfield-line-height-lg, $textfield-box-padding-x-lg, $textfield-box-padding-y-lg);
43
+ }
44
44
  }
45
45
 
46
46
  .textfield-box-sm {
@@ -48,12 +48,12 @@
48
48
  @include textfield-box-size($textfield-font-size-sm, $textfield-box-height-sm, $textfield-line-height-sm, $textfield-box-padding-x-sm, $textfield-box-padding-y-sm);
49
49
  }
50
50
 
51
- > .form-control {
52
- @include form-control-size($textfield-font-size-sm, $textfield-box-height-sm, $textfield-line-height-sm, $textfield-box-padding-x-sm, $textfield-box-padding-y-sm);
53
- }
54
-
55
51
  // stylelint-disable-next-line selector-no-qualifying-type
56
- > select.form-control:not([multiple]):not([size]) {
52
+ select.form-control:not([multiple]):not([size]) {
57
53
  @include form-select-size($textfield-font-size-sm, $textfield-box-height-sm, $textfield-box-padding-x-sm);
58
54
  }
55
+
56
+ .form-control {
57
+ @include form-control-size($textfield-font-size-sm, $textfield-box-height-sm, $textfield-line-height-sm, $textfield-box-padding-x-sm, $textfield-box-padding-y-sm);
58
+ }
59
59
  }
@@ -4,17 +4,17 @@
4
4
  padding-top: $floating-label-font-size-focus;
5
5
  position: relative;
6
6
 
7
- &.has-value > label,
8
- &.is-focused > label {
7
+ &.has-value label,
8
+ &.is-focused label {
9
9
  line-height: 1;
10
10
  top: 0;
11
11
  }
12
12
 
13
- &.is-focused > label {
13
+ &.is-focused label {
14
14
  color: $floating-label-color-focus;
15
15
  }
16
16
 
17
- &:not(.has-value):not(.is-focused) > .form-control {
17
+ &:not(.has-value):not(.is-focused) .form-control {
18
18
  &[type='date'],
19
19
  &[type='datetime-local'],
20
20
  &[type='time'] {
@@ -22,7 +22,7 @@
22
22
  }
23
23
  }
24
24
 
25
- > label {
25
+ label {
26
26
  @include text-truncate;
27
27
  @include transition-standard(color, top, transform);
28
28
 
@@ -35,7 +35,7 @@
35
35
  transform-origin: 0 0;
36
36
  }
37
37
 
38
- > .form-control {
38
+ .form-control {
39
39
  position: relative;
40
40
 
41
41
  &[type='file']::-webkit-file-upload-button {
@@ -66,7 +66,7 @@
66
66
  .floating-label-lg {
67
67
  @include floating-label-size($textfield-font-size-lg, $textfield-height-lg, $textfield-line-height-lg, $textfield-padding-y-lg);
68
68
 
69
- > .form-control {
69
+ .form-control {
70
70
  @extend %form-control-lg;
71
71
  }
72
72
  }
@@ -74,7 +74,7 @@
74
74
  .floating-label-sm {
75
75
  @include floating-label-size($textfield-font-size-sm, $textfield-height-sm, $textfield-line-height-sm, $textfield-padding-y-sm);
76
76
 
77
- > .form-control {
77
+ .form-control {
78
78
  @extend %form-control-sm;
79
79
  }
80
80
  }
@@ -5,9 +5,9 @@
5
5
  position: relative;
6
6
  width: 100%;
7
7
 
8
- .custom-file,
9
- .custom-select,
10
- .form-control {
8
+ > .custom-file,
9
+ > .custom-select,
10
+ > .form-control {
11
11
  flex: 1 1 auto;
12
12
  margin-bottom: 0;
13
13
  width: 1%;
@@ -59,11 +59,11 @@
59
59
 
60
60
  @each $color, $values in $theme-colors {
61
61
  .form-control-#{$color} {
62
- border-color: map-get(theme-color($color), color);
62
+ border-color: theme-color($color);
63
63
 
64
64
  @include focus-hover {
65
- border-color: map-get(theme-color($color), color);
66
- box-shadow: inset 0 ($textfield-border-width-focus * -1) 0 ($textfield-border-width * -1) map-get(theme-color($color), color);
65
+ border-color: theme-color($color);
66
+ box-shadow: inset 0 ($textfield-border-width-focus * -1) 0 ($textfield-border-width * -1) theme-color($color);
67
67
  }
68
68
  }
69
69
  }
@@ -25,21 +25,6 @@
25
25
 
26
26
  // Vertically align some elements normally placed in `.navbar`
27
27
 
28
- .btn {
29
- margin-top: (($btn-height - $toolbar-element-height) / -2);
30
- margin-bottom: (($btn-height - $toolbar-element-height) / -2);
31
- }
32
-
33
- .btn-lg {
34
- margin-top: (($btn-height-lg - $toolbar-element-height) / -2);
35
- margin-bottom: (($btn-height-lg - $toolbar-element-height) / -2);
36
- }
37
-
38
- .btn-sm {
39
- margin-top: (($btn-height-sm - $toolbar-element-height) / -2);
40
- margin-bottom: (($btn-height-sm - $toolbar-element-height) / -2);
41
- }
42
-
43
28
  .form-control {
44
29
  @include border-radius($toolbar-element-border-radius);
45
30
  @include transition-standard(opacity);
@@ -47,9 +32,8 @@
47
32
  background-color: $toolbar-element-bg;
48
33
  border: 0;
49
34
  color: inherit;
50
- height: $toolbar-element-height;
51
35
  opacity: $toolbar-element-opacity;
52
- padding: (($toolbar-element-height - $textfield-font-size * $textfield-line-height) / 2) $toolbar-inner-spacer-x;
36
+ padding: (($textfield-height - $textfield-font-size * $textfield-line-height) / 2) $toolbar-inner-spacer-x;
53
37
 
54
38
  @include focus-hover {
55
39
  box-shadow: none;
@@ -57,12 +41,14 @@
57
41
  }
58
42
  }
59
43
 
60
- .form-inline {
61
- margin-left: $toolbar-inner-spacer-x;
44
+ .form-control-lg {
45
+ padding-top: (($textfield-height-lg - $textfield-font-size-lg * $textfield-line-height-lg) / 2);
46
+ padding-bottom: (($textfield-height-lg - $textfield-font-size-lg * $textfield-line-height-lg) / 2);
47
+ }
62
48
 
63
- &:first-child {
64
- margin-left: 0;
65
- }
49
+ .form-control-sm {
50
+ padding-top: (($textfield-height-sm - $textfield-font-size-sm * $textfield-line-height-sm) / 2);
51
+ padding-bottom: (($textfield-height-sm - $textfield-font-size-sm * $textfield-line-height-sm) / 2);
66
52
  }
67
53
 
68
54
  .input-group {
@@ -77,16 +63,42 @@
77
63
  }
78
64
 
79
65
  .form-control {
80
- @include border-radius(0);
81
-
82
66
  background-color: transparent;
83
- margin-left: 0;
84
67
  opacity: 1;
68
+
69
+ &:not(:first-child) {
70
+ padding-left: 0;
71
+ }
72
+
73
+ &:not(:last-child) {
74
+ padding-right: 0;
75
+ }
85
76
  }
86
77
 
87
- .input-group-addon {
78
+ .input-group-append {
88
79
  margin-left: 0;
80
+ min-width: 0;
81
+ }
82
+
83
+ .input-group-prepend {
84
+ margin-right: 0;
85
+ min-width: 0;
89
86
  }
87
+
88
+ .input-group-text {
89
+ margin-right: $toolbar-inner-spacer-x;
90
+ margin-left: $toolbar-inner-spacer-x;
91
+ }
92
+ }
93
+
94
+ .input-group-lg > .form-control {
95
+ padding-top: (($textfield-height-lg - $textfield-font-size-lg * $textfield-line-height-lg) / 2);
96
+ padding-bottom: (($textfield-height-lg - $textfield-font-size-lg * $textfield-line-height-lg) / 2);
97
+ }
98
+
99
+ .input-group-sm > .form-control {
100
+ padding-top: (($textfield-height-sm - $textfield-font-size-sm * $textfield-line-height-sm) / 2);
101
+ padding-bottom: (($textfield-height-sm - $textfield-font-size-sm * $textfield-line-height-sm) / 2);
90
102
  }
91
103
 
92
104
  .nav-tabs {
@@ -180,7 +192,6 @@
180
192
  color: inherit;
181
193
  display: inline-flex;
182
194
  height: $toolbar-element-height;
183
- margin-left: $toolbar-inner-spacer-x;
184
195
  position: relative;
185
196
  white-space: nowrap;
186
197
 
@@ -203,10 +214,6 @@
203
214
  left: ($toolbar-inner-spacer-x / -2);
204
215
  }
205
216
 
206
- &:first-child {
207
- margin-left: 0;
208
- }
209
-
210
217
  &:focus {
211
218
  outline: 0;
212
219
 
@@ -214,6 +221,14 @@
214
221
  opacity: 1;
215
222
  }
216
223
  }
224
+
225
+ &:not(:first-child) {
226
+ margin-left: $toolbar-inner-spacer-x;
227
+ }
228
+
229
+ &:not(:last-child) {
230
+ margin-right: $toolbar-inner-spacer-x;
231
+ }
217
232
  }
218
233
 
219
234
  .navbar-text {
@@ -222,11 +237,6 @@
222
237
  display: inline-flex;
223
238
  flex-wrap: wrap;
224
239
  height: $toolbar-element-height;
225
- margin-left: $toolbar-inner-spacer-x;
226
-
227
- &:first-child {
228
- margin-left: 0;
229
- }
230
240
  }
231
241
 
232
242
  // Nav
@@ -294,22 +304,6 @@
294
304
 
295
305
  &#{$infix} {
296
306
  @include media-breakpoint-down($breakpoint) {
297
- .navbar-collapse {
298
- .form-inline,
299
- .navbar-brand,
300
- .navbar-text {
301
- margin-left: 0;
302
- }
303
-
304
- > :first-child {
305
- margin-top: $toolbar-inner-spacer-y;
306
- }
307
-
308
- > :not(:last-child) {
309
- margin-bottom: $toolbar-inner-spacer-y;
310
- }
311
- }
312
-
313
307
  > .container,
314
308
  > .container-fluid {
315
309
  padding-right: 0;
@@ -326,16 +320,10 @@
326
320
  flex-basis: auto;
327
321
  }
328
322
 
329
- .navbar-nav {
330
- flex-wrap: nowrap;
331
- }
332
-
333
323
  .navbar-toggler {
334
324
  display: none;
335
325
 
336
- + .form-inline,
337
- + .navbar-brand,
338
- + .navbar-text {
326
+ &:first-child + .navbar-brand {
339
327
  margin-left: 0;
340
328
  }
341
329
  }
@@ -360,7 +348,6 @@
360
348
  height: $toolbar-element-height;
361
349
  justify-content: center;
362
350
  line-height: 1;
363
- margin-left: $toolbar-inner-spacer-x;
364
351
  padding: 0;
365
352
  position: relative;
366
353
  width: $toolbar-element-height;
@@ -389,15 +376,11 @@
389
376
  left: 0;
390
377
  }
391
378
 
392
- &:first-child {
393
- margin-left: 0;
394
- }
395
-
396
379
  &:focus {
397
380
  outline: 0;
398
381
  }
399
382
 
400
- &:not([disabled]):not(.disabled) {
383
+ &:not(:disabled):not(.disabled) {
401
384
  cursor: pointer;
402
385
  }
403
386
  }
@@ -15,10 +15,29 @@
15
15
  }
16
16
 
17
17
  @function breakpoint-next($name) {
18
- $map: map-keys($grid-breakpoints);
19
- $n: index($map, $name);
18
+ $breakpoint-names: map-keys($grid-breakpoints);
19
+ $n: index($breakpoint-names, $name);
20
20
 
21
- @return if($n < length($map), nth($map, $n + 1), null);
21
+ @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
22
+ }
23
+
24
+ @mixin media-breakpoint-between($lower, $upper) {
25
+ $max: breakpoint-max($upper);
26
+ $min: breakpoint-min($lower);
27
+
28
+ @if $min != null and $max != null {
29
+ @media (min-width: $min) and (max-width: $max) {
30
+ @content;
31
+ }
32
+ } @else if $max == null {
33
+ @include media-breakpoint-up($lower) {
34
+ @content;
35
+ }
36
+ } @else if $min == null {
37
+ @include media-breakpoint-down($upper) {
38
+ @content;
39
+ }
40
+ }
22
41
  }
23
42
 
24
43
  @mixin media-breakpoint-down($name) {
@@ -33,34 +52,33 @@
33
52
  }
34
53
  }
35
54
 
36
- @mixin media-breakpoint-up($name) {
55
+ @mixin media-breakpoint-only($name) {
56
+ $max: breakpoint-max($name);
37
57
  $min: breakpoint-min($name);
38
58
 
39
- @if $min {
40
- @media (min-width: $min) {
59
+ @if $min != null and $max != null {
60
+ @media (min-width: $min) and (max-width: $max) {
61
+ @content;
62
+ }
63
+ } @else if $max == null {
64
+ @include media-breakpoint-up($name) {
65
+ @content;
66
+ }
67
+ } @else if $min == null {
68
+ @include media-breakpoint-down($name) {
41
69
  @content;
42
70
  }
43
- } @else {
44
- @content;
45
- }
46
- }
47
-
48
- // Additional mixins
49
-
50
- @mixin media-breakpoint-between($lower, $upper) {
51
- $max: breakpoint-max($upper);
52
- $min: breakpoint-min($lower);
53
-
54
- @media (min-width: $min) and (max-width: $max) {
55
- @content;
56
71
  }
57
72
  }
58
73
 
59
- @mixin media-breakpoint-only($name) {
60
- $max: breakpoint-max($name);
74
+ @mixin media-breakpoint-up($name) {
61
75
  $min: breakpoint-min($name);
62
76
 
63
- @media (min-width: $min) and (max-width: $max) {
77
+ @if $min {
78
+ @media (min-width: $min) {
79
+ @content;
80
+ }
81
+ } @else {
64
82
  @content;
65
83
  }
66
84
  }