material-sass 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/Rakefile +4 -4
  4. data/assets/javascripts/material-sprockets.js +0 -1
  5. data/assets/javascripts/material.js +2994 -2927
  6. data/assets/javascripts/material.min.js +10 -10
  7. data/assets/javascripts/material/components/expansion-panel.js +1 -3
  8. data/assets/javascripts/material/components/floating-label.js +2 -3
  9. data/assets/javascripts/material/components/nav-drawer.js +10 -32
  10. data/assets/javascripts/material/components/pickdate.js +228 -0
  11. data/assets/javascripts/material/components/selection-control-focus.js +2 -2
  12. data/assets/javascripts/material/components/tab-switch.js +4 -20
  13. data/assets/javascripts/material/components/util.js +16 -1
  14. data/assets/stylesheets/material/_colors.scss +2 -0
  15. data/assets/stylesheets/material/_functions.scss +6 -0
  16. data/assets/stylesheets/material/_mixins.scss +0 -2
  17. data/assets/stylesheets/material/_print.scss +26 -1
  18. data/assets/stylesheets/material/_utilities.scss +1 -0
  19. data/assets/stylesheets/material/base/_base.scss +5 -2
  20. data/assets/stylesheets/material/bootstrap/_breadcrumb.scss +10 -7
  21. data/assets/stylesheets/material/bootstrap/_popover.scss +1 -2
  22. data/assets/stylesheets/material/bootstrap/_transition.scss +6 -10
  23. data/assets/stylesheets/material/material.scss +2 -0
  24. data/assets/stylesheets/material/material/_card.scss +58 -96
  25. data/assets/stylesheets/material/material/_chip.scss +1 -0
  26. data/assets/stylesheets/material/material/_data-table.scss +57 -1
  27. data/assets/stylesheets/material/material/_dialog.scss +2 -2
  28. data/assets/stylesheets/material/material/_expansion-panel.scss +4 -0
  29. data/assets/stylesheets/material/material/_menu.scss +164 -54
  30. data/assets/stylesheets/material/material/_navdrawer.scss +5 -6
  31. data/assets/stylesheets/material/material/_picker.scss +78 -67
  32. data/assets/stylesheets/material/material/_progress.scss +1 -6
  33. data/assets/stylesheets/material/material/_selection-control.scss +1 -1
  34. data/assets/stylesheets/material/material/_slider.scss +157 -0
  35. data/assets/stylesheets/material/material/_snackbar.scss +125 -0
  36. data/assets/stylesheets/material/material/_text-field-input-group.scss +101 -10
  37. data/assets/stylesheets/material/material/_text-field.scss +10 -15
  38. data/assets/stylesheets/material/material/_toolbar.scss +0 -16
  39. data/assets/stylesheets/material/material/_tooltip.scss +2 -2
  40. data/assets/stylesheets/material/mixins/_form.scss +2 -1
  41. data/assets/stylesheets/material/mixins/_nav-divider.scss +2 -2
  42. data/assets/stylesheets/material/mixins/_screenreader.scss +0 -2
  43. data/assets/stylesheets/material/mixins/_text-hide.scss +2 -0
  44. data/assets/stylesheets/material/mixins/_transition.scss +20 -0
  45. data/assets/stylesheets/material/utilities/_background.scss +5 -0
  46. data/assets/stylesheets/material/utilities/_flex.scss +17 -1
  47. data/assets/stylesheets/material/utilities/_position.scss +1 -0
  48. data/assets/stylesheets/material/utilities/_shadows.scss +23 -0
  49. data/assets/stylesheets/material/utilities/_text.scss +18 -0
  50. data/assets/stylesheets/material/variables/_elevation-shadow.scss +53 -47
  51. data/assets/stylesheets/material/variables/_palette.scss +9 -8
  52. data/assets/stylesheets/material/variables/_spacer.scss +2 -0
  53. data/assets/stylesheets/material/variables/_transition.scss +2 -0
  54. data/assets/stylesheets/material/variables/_typography.scss +3 -3
  55. data/assets/stylesheets/material/variables/_variable-bootstrap.scss +9 -8
  56. data/assets/stylesheets/material/variables/_variable-material.scss +56 -18
  57. data/lib/material-sass/version.rb +1 -1
  58. metadata +6 -6
  59. data/assets/javascripts/material/addons/pickadate.js +0 -152
  60. data/assets/stylesheets/material.min.css +0 -13
  61. data/assets/stylesheets/material/mixins/_hex-to-rgba.scss +0 -3
  62. data/assets/stylesheets/material/mixins/_strip-unit.scss +0 -3
@@ -71,15 +71,10 @@
71
71
  }
72
72
  }
73
73
 
74
- &[style*='width:100%'],
75
- &[style*='width: 100%'] {
76
- border-right: 0;
77
- }
78
-
79
74
  &::after {
80
75
  @include border-right-radius($progress-bar-border-radius);
81
76
 
82
- right: ($progress-bar-height * -6);
77
+ right: ($progress-bar-buffer-width * -1);
83
78
  bottom: ($progress-bar-height * -1);
84
79
  }
85
80
 
@@ -164,7 +164,7 @@
164
164
  }
165
165
 
166
166
  ~ .custom-control-track {
167
- background-color: hex-to-rgba($selection-control-color-active, 0.5);
167
+ background-color: rgba($selection-control-color-active, $selection-control-track-opacity);
168
168
  }
169
169
  }
170
170
 
@@ -0,0 +1,157 @@
1
+ .custom-range {
2
+ appearance: none;
3
+ background-color: transparent;
4
+ padding-left: 0;
5
+ width: 100%;
6
+
7
+ &:active,
8
+ &:focus {
9
+ &::-moz-range-track {
10
+ background-color: $slider-track-bg-active;
11
+ }
12
+
13
+ &::-ms-fill-upper {
14
+ background-color: $slider-track-bg-active;
15
+ }
16
+
17
+ &::-webkit-slider-runnable-track {
18
+ background-color: $slider-track-bg-active;
19
+ }
20
+ }
21
+
22
+ &:focus {
23
+ outline: 0;
24
+
25
+ &::-moz-range-thumb {
26
+ box-shadow: 0 0 0 $slider-thumb-size rgba($slider-thumb-bg, $slider-thumb-radial-opacity);
27
+ }
28
+
29
+ &::-ms-range-thumb {
30
+ box-shadow: 0 0 0 $slider-thumb-size rgba($slider-thumb-bg, $slider-thumb-radial-opacity);
31
+ }
32
+
33
+ &::-webkit-slider-thumb {
34
+ box-shadow: 0 0 0 $slider-thumb-size rgba($slider-thumb-bg, $slider-thumb-radial-opacity);
35
+ }
36
+ }
37
+
38
+ &::-moz-focus-outer {
39
+ border: 0;
40
+ }
41
+
42
+ &::-moz-range-progress {
43
+ background-color: $slider-thumb-bg;
44
+ }
45
+
46
+ &::-moz-range-thumb {
47
+ @include transition-standard(box-shadow, height, width);
48
+
49
+ appearance: none;
50
+ background-color: $slider-thumb-bg;
51
+ border: 0;
52
+ border-radius: 50%;
53
+ height: $slider-thumb-size;
54
+ width: $slider-thumb-size;
55
+
56
+ &:active {
57
+ box-shadow: none;
58
+ height: ($slider-thumb-size * 2);
59
+ width: ($slider-thumb-size * 2);
60
+ }
61
+
62
+ &:focus {
63
+ outline: 0;
64
+ }
65
+ }
66
+
67
+ &::-moz-range-track {
68
+ @include transition-standard(background-color);
69
+
70
+ background-color: $slider-track-bg;
71
+ border-color: transparent;
72
+ border-radius: 0;
73
+ color: transparent;
74
+ cursor: pointer;
75
+ height: $slider-track-height;
76
+ width: 100%;
77
+ }
78
+
79
+ &::-ms-fill-lower {
80
+ background-color: $slider-thumb-bg;
81
+ height: $slider-track-height;
82
+ margin-bottom: $slider-track-height;
83
+ margin-left: ($slider-thumb-size / 2);
84
+ }
85
+
86
+ &::-ms-fill-upper {
87
+ background-color: $slider-track-bg;
88
+ height: $slider-track-height;
89
+ margin-right: ($slider-thumb-size / 2);
90
+ margin-bottom: $slider-track-height;
91
+ }
92
+
93
+ &::-ms-thumb {
94
+ @include transition-standard(box-shadow);
95
+
96
+ appearance: none;
97
+ background-color: $slider-thumb-bg;
98
+ border: 0;
99
+ border-radius: 50%;
100
+ height: $slider-thumb-size;
101
+ margin-right: ($slider-thumb-size / 2);
102
+ margin-left: ($slider-thumb-size / 2);
103
+ width: $slider-thumb-size;
104
+
105
+ &:active {
106
+ box-shadow: 0 0 0 ($slider-thumb-size / 2) $slider-thumb-bg;
107
+ }
108
+
109
+ &:focus {
110
+ outline: 0;
111
+ }
112
+ }
113
+
114
+ &::-ms-track {
115
+ @include transition-standard(background-color);
116
+
117
+ background-color: transparent;
118
+ border-color: transparent;
119
+ border-width: ($slider-thumb-size + $slider-track-height) 0;
120
+ color: transparent;
121
+ cursor: pointer;
122
+ height: $slider-track-height;
123
+ width: 100%;
124
+ }
125
+
126
+ &::-webkit-slider-runnable-track {
127
+ @include transition-standard(background-color);
128
+
129
+ background-color: $slider-track-bg;
130
+ border-color: transparent;
131
+ border-radius: 0;
132
+ color: transparent;
133
+ cursor: pointer;
134
+ height: $slider-track-height;
135
+ width: 100%;
136
+ }
137
+
138
+ &::-webkit-slider-thumb {
139
+ @include transition-standard(box-shadow);
140
+
141
+ appearance: none;
142
+ background-color: $slider-thumb-bg;
143
+ border: 0;
144
+ border-radius: 50%;
145
+ height: $slider-thumb-size;
146
+ margin-top: (($slider-thumb-size - $slider-track-height) / -2);
147
+ width: $slider-thumb-size;
148
+
149
+ &:active {
150
+ box-shadow: 0 0 0 ($slider-thumb-size / 2) $slider-thumb-bg;
151
+ }
152
+
153
+ &:focus {
154
+ outline: 0;
155
+ }
156
+ }
157
+ }
@@ -0,0 +1,125 @@
1
+ // Snackbar based on https://material.io/guidelines/components/snackbars-toasts.html#snackbars-toasts-specs
2
+
3
+ .snackbar {
4
+ align-items: center;
5
+ background-color: $snackbar-bg;
6
+ color: $snackbar-color;
7
+ display: flex;
8
+ font-size: $snackbar-font-size;
9
+ line-height: $snackbar-line-height;
10
+ opacity: 0;
11
+ padding: $snackbar-padding-y $snackbar-padding-x;
12
+ position: fixed;
13
+ bottom: 0;
14
+ left: 0;
15
+ transform: translateY(100%);
16
+ transition: opacity 0s $transition-duration-mobile-leaving, transform $transition-duration-mobile-leaving $transition-timing-function-acceleration;
17
+ width: 100%;
18
+ z-index: map-get($snackbar-elevation-shadow, elevation);
19
+
20
+ @include media-breakpoint-up($snackbar-breakpoint) {
21
+ border-radius: $snackbar-border-radius;
22
+ max-width: $snackbar-max-width;
23
+ min-width: $snackbar-min-width;
24
+ left: 50%;
25
+ transform: translate(-50%, 100%);
26
+ width: auto;
27
+ }
28
+
29
+ @include media-breakpoint-up(sm) {
30
+ transition: opacity 0s $transition-duration-tablet-leaving, transform $transition-duration-tablet-leaving $transition-timing-function-acceleration;
31
+ }
32
+
33
+ @include media-breakpoint-up(lg) {
34
+ transition: opacity 0s $transition-duration-desktop-leaving, transform $transition-duration-desktop-leaving $transition-timing-function-acceleration;
35
+ }
36
+
37
+ @media screen and (prefers-reduced-motion: reduce) {
38
+ transition: none;
39
+ }
40
+
41
+ &.show {
42
+ @include transition-deceleration(transform);
43
+
44
+ opacity: 1;
45
+ transform: translateY(0);
46
+
47
+ @include media-breakpoint-up($snackbar-breakpoint) {
48
+ transform: translate(-50%, 0);
49
+ }
50
+ }
51
+ }
52
+
53
+ .snackbar-body {
54
+ @include text-truncate;
55
+
56
+ margin-right: auto;
57
+ max-height: 100%;
58
+ min-width: 0;
59
+ }
60
+
61
+ .snackbar-btn {
62
+ @include transition-standard(background-color, background-image);
63
+
64
+ background-color: transparent;
65
+ background-image: none;
66
+ border: 0;
67
+ color: $snackbar-btn-color;
68
+ cursor: pointer;
69
+ display: block;
70
+ flex-shrink: 0;
71
+ font-size: inherit;
72
+ font-weight: $btn-font-weight;
73
+ line-height: inherit;
74
+ margin-left: $snackbar-inner-spacer-x;
75
+ padding: 0;
76
+ text-transform: uppercase;
77
+ white-space: nowrap;
78
+
79
+ @include focus-hover {
80
+ color: $snackbar-btn-color-hover;
81
+ text-decoration: none;
82
+ }
83
+
84
+ @include media-breakpoint-up($snackbar-breakpoint) {
85
+ margin-left: $snackbar-inner-spacer-x-desktop;
86
+ }
87
+
88
+ &:focus {
89
+ outline: 0;
90
+ }
91
+ }
92
+
93
+ .snackbar-left,
94
+ .snackbar-right {
95
+ @include media-breakpoint-up($snackbar-breakpoint) {
96
+ transform: translateY(100%);
97
+
98
+ &.show {
99
+ transform: translateY($snackbar-margin-y * -1);
100
+ }
101
+ }
102
+ }
103
+
104
+ .snackbar-left {
105
+ @include media-breakpoint-up($snackbar-breakpoint) {
106
+ left: $snackbar-margin-x;
107
+ }
108
+ }
109
+
110
+ .snackbar-right {
111
+ @include media-breakpoint-up($snackbar-breakpoint) {
112
+ right: $snackbar-margin-x;
113
+ left: auto;
114
+ }
115
+ }
116
+
117
+ .snackbar-multi-line {
118
+ height: $snackbar-height-multi;
119
+ padding-top: $snackbar-padding-y-multi;
120
+ padding-bottom: $snackbar-padding-y-multi;
121
+
122
+ .snackbar-body {
123
+ white-space: normal;
124
+ }
125
+ }
@@ -7,10 +7,20 @@
7
7
 
8
8
  > .custom-file,
9
9
  > .custom-select,
10
- > .form-control {
10
+ > .floating-label,
11
+ > .form-control,
12
+ > .textfield-box {
11
13
  flex: 1 1 auto;
12
14
  margin-bottom: 0;
13
15
  width: 1%;
16
+
17
+ + .custom-file,
18
+ + .custom-select,
19
+ + .floating-label,
20
+ + .form-control,
21
+ + .textfield-box {
22
+ margin-left: $input-group-inner-spacer-x;
23
+ }
14
24
  }
15
25
  }
16
26
 
@@ -21,7 +31,6 @@
21
31
  align-items: center;
22
32
  display: flex;
23
33
  justify-content: center;
24
- min-width: $textfield-height;
25
34
 
26
35
  .btn {
27
36
  min-width: 0;
@@ -33,21 +42,23 @@
33
42
  }
34
43
 
35
44
  .input-group-append {
36
- margin-left: $input-group-addon-margin-x;
45
+ margin-left: $input-group-inner-spacer-x;
37
46
  }
38
47
 
39
48
  .input-group-prepend {
40
- margin-right: $input-group-addon-margin-x;
49
+ margin-right: $input-group-inner-spacer-x;
41
50
  }
42
51
 
43
52
  .input-group-text {
44
53
  color: inherit;
45
54
  font-size: $textfield-font-size;
46
55
  line-height: $textfield-line-height;
47
- margin-right: ($input-group-addon-margin-x / 2);
48
56
  margin-bottom: 0;
49
- margin-left: ($input-group-addon-margin-x / 2);
50
57
  white-space: nowrap;
58
+
59
+ + .input-group-text {
60
+ margin-left: ($input-group-inner-spacer-x / 2);
61
+ }
51
62
  }
52
63
 
53
64
  // Border radius
@@ -63,6 +74,30 @@
63
74
  }
64
75
  }
65
76
 
77
+ // Icons
78
+
79
+ .input-group-icon {
80
+ @include transition-standard(color);
81
+
82
+ color: $textfield-border-color;
83
+ font-size: ($font-size-base / 1rem * $textfield-font-size);
84
+ margin-right: $input-group-inner-spacer-x;
85
+ order: -1;
86
+
87
+ @include hover {
88
+ color: $textfield-border-color-hover;
89
+ }
90
+
91
+ .floating-label.is-focused ~ &,
92
+ .form-control:focus ~ & {
93
+ color: $textfield-border-color-focus;
94
+ }
95
+
96
+ .floating-label:not(.textfield-box) ~ & {
97
+ margin-top: $floating-label-font-size-focus;
98
+ }
99
+ }
100
+
66
101
  // Size
67
102
 
68
103
  .input-group-lg {
@@ -70,10 +105,18 @@
70
105
  @extend %form-control-lg;
71
106
  }
72
107
 
108
+ > .floating-label {
109
+ @extend .floating-label-lg;
110
+
111
+ &.has-value label,
112
+ &.is-focused label {
113
+ line-height: 1;
114
+ top: 0;
115
+ }
116
+ }
117
+
73
118
  > .input-group-append,
74
119
  > .input-group-prepend {
75
- min-width: $textfield-height-lg;
76
-
77
120
  > .btn {
78
121
  @extend %btn-lg;
79
122
  }
@@ -83,6 +126,26 @@
83
126
  line-height: $textfield-line-height-lg;
84
127
  }
85
128
  }
129
+
130
+ > .input-group-icon {
131
+ font-size: ($font-size-base / 1rem * $textfield-font-size-lg);
132
+ line-height: $textfield-line-height-lg;
133
+ }
134
+
135
+ > .textfield-box {
136
+ @extend .textfield-box-lg;
137
+
138
+ &.floating-label {
139
+ &.has-value label,
140
+ &.is-focused label {
141
+ top: $textfield-box-label-spacer-y;
142
+ }
143
+
144
+ .form-control {
145
+ padding-bottom: ($textfield-box-label-spacer-y - $textfield-border-width / $font-size-root * 1rem);
146
+ }
147
+ }
148
+ }
86
149
  }
87
150
 
88
151
  .input-group-sm {
@@ -90,10 +153,18 @@
90
153
  @extend %form-control-sm;
91
154
  }
92
155
 
156
+ > .floating-label {
157
+ @extend .floating-label-sm;
158
+
159
+ &.has-value label,
160
+ &.is-focused label {
161
+ line-height: 1;
162
+ top: 0;
163
+ }
164
+ }
165
+
93
166
  > .input-group-append,
94
167
  > .input-group-prepend {
95
- min-width: $textfield-height-sm;
96
-
97
168
  > .btn {
98
169
  @extend %btn-sm;
99
170
  }
@@ -103,4 +174,24 @@
103
174
  line-height: $textfield-line-height-sm;
104
175
  }
105
176
  }
177
+
178
+ > .input-group-icon {
179
+ font-size: ($font-size-base / 1rem * $textfield-font-size-sm);
180
+ line-height: $textfield-line-height-sm;
181
+ }
182
+
183
+ > .textfield-box {
184
+ @extend .textfield-box-sm;
185
+
186
+ &.floating-label {
187
+ &.has-value label,
188
+ &.is-focused label {
189
+ top: $textfield-box-label-spacer-y;
190
+ }
191
+
192
+ .form-control {
193
+ padding-bottom: ($textfield-box-label-spacer-y - $textfield-border-width / $font-size-root * 1rem);
194
+ }
195
+ }
196
+ }
106
197
  }