material-sass 4.0.0.beta2 → 4.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +3 -3
  4. data/Rakefile +11 -9
  5. data/assets/javascripts/material.js +3278 -825
  6. data/assets/javascripts/material.min.js +17 -1
  7. data/assets/javascripts/material/{initializers/picker.js → addons/pickadate.js} +5 -23
  8. data/assets/javascripts/material/components/expansion-panel.js +9 -18
  9. data/assets/javascripts/material/components/floating-label.js +21 -24
  10. data/assets/javascripts/material/components/{navdrawer.js → nav-drawer.js} +51 -55
  11. data/assets/javascripts/material/components/selection-control-focus.js +15 -21
  12. data/assets/javascripts/material/components/tab-switch.js +13 -20
  13. data/assets/javascripts/material/components/util.js +31 -41
  14. data/assets/stylesheets/material/_functions.scss +1 -1
  15. data/assets/stylesheets/material/_print.scss +13 -2
  16. data/assets/stylesheets/material/_utilities.scss +0 -1
  17. data/assets/stylesheets/material/_variables.scss +0 -1
  18. data/assets/stylesheets/material/base/_base.scss +1 -16
  19. data/assets/stylesheets/material/bootstrap/_close.scss +4 -0
  20. data/assets/stylesheets/material/bootstrap/_code.scss +6 -0
  21. data/assets/stylesheets/material/bootstrap/_custom-form.scss +26 -28
  22. data/assets/stylesheets/material/bootstrap/_form.scss +7 -36
  23. data/assets/stylesheets/material/bootstrap/_pagination.scss +7 -2
  24. data/assets/stylesheets/material/bootstrap/_popover.scss +18 -14
  25. data/assets/stylesheets/material/material.scss +0 -1
  26. data/assets/stylesheets/material/material/_button-flat.scss +8 -8
  27. data/assets/stylesheets/material/material/_button-group.scss +26 -63
  28. data/assets/stylesheets/material/material/_button.scss +18 -18
  29. data/assets/stylesheets/material/material/_dialog.scss +6 -6
  30. data/assets/stylesheets/material/material/_expansion-panel.scss +4 -4
  31. data/assets/stylesheets/material/material/_menu.scss +2 -2
  32. data/assets/stylesheets/material/material/_picker.scss +3 -3
  33. data/assets/stylesheets/material/material/_progress.scss +2 -1
  34. data/assets/stylesheets/material/material/_selection-control.scss +88 -67
  35. data/assets/stylesheets/material/material/_text-field-input-group.scss +49 -82
  36. data/assets/stylesheets/material/material/_text-field.scss +36 -6
  37. data/assets/stylesheets/material/material/_toolbar.scss +4 -0
  38. data/assets/stylesheets/material/material/_tooltip.scss +1 -1
  39. data/assets/stylesheets/material/mixins/_breakpoint.scss +1 -1
  40. data/assets/stylesheets/material/mixins/_form.scss +79 -17
  41. data/assets/stylesheets/material/mixins/_grid-framework.scss +9 -3
  42. data/assets/stylesheets/material/mixins/_grid.scss +3 -1
  43. data/assets/stylesheets/material/mixins/_hover.scss +14 -55
  44. data/assets/stylesheets/material/mixins/_material-icons.scss +2 -4
  45. data/assets/stylesheets/material/mixins/_text-alignment.scss +2 -2
  46. data/assets/stylesheets/material/mixins/_text-hide.scss +1 -1
  47. data/assets/stylesheets/material/utilities/_border.scss +20 -0
  48. data/assets/stylesheets/material/variables/_palette.scss +2 -0
  49. data/assets/stylesheets/material/variables/_variable-bootstrap.scss +17 -0
  50. data/assets/stylesheets/material/variables/_variable-material.scss +2 -6
  51. data/lib/material-sass/version.rb +1 -1
  52. metadata +4 -12
  53. data/assets/javascripts/material/addons/picker.date.js +0 -234
  54. data/assets/javascripts/material/addons/picker.js +0 -172
  55. data/assets/javascripts/material/addons/textarea-autosize.js +0 -23
  56. data/assets/javascripts/material/addons/waves.js +0 -127
  57. data/assets/javascripts/material/initializers/textarea-autosize.js +0 -10
  58. data/assets/javascripts/material/initializers/waves.js +0 -13
  59. data/assets/stylesheets/material/material/_text-field-textarea.scss +0 -15
  60. data/assets/stylesheets/material/utilities/_waves.scss +0 -41
@@ -7,31 +7,41 @@
7
7
  .custom-file {
8
8
  display: inline-block;
9
9
  height: $textfield-height;
10
- max-width: 100%;
10
+ margin-bottom: 0;
11
11
  position: relative;
12
+ width: 100%;
12
13
  }
13
14
 
14
- .custom-file-control {
15
+ .custom-file-input {
16
+ height: $textfield-height;
17
+ margin: 0;
18
+ opacity: 0;
19
+ position: relative;
20
+ width: 100%;
21
+ z-index: 1;
22
+
23
+ @include focus-hover {
24
+ ~ .custom-file-label {
25
+ border-bottom-color: $textfield-border-color-focus;
26
+ box-shadow: inset 0 ($textfield-border-width-focus * -1) 0 ($textfield-border-width * -1) $textfield-border-color-focus;
27
+ }
28
+ }
29
+ }
30
+
31
+ .custom-file-label {
15
32
  @include form-control-size($textfield-font-size, $textfield-height, $textfield-line-height, $textfield-padding-x, $textfield-padding-y);
33
+ @include text-truncate;
16
34
  @include transition-standard(border-color, box-shadow);
17
35
 
18
- align-items: center;
19
36
  border-bottom: $textfield-border-width solid $textfield-border-color;
20
37
  color: $textfield-hint-color;
21
- display: flex;
22
- justify-content: space-between;
38
+ height: $textfield-height;
39
+ padding-right: ($material-icon-size + $selection-control-spacer-x);
23
40
  position: absolute;
24
41
  top: 0;
25
42
  right: 0;
26
- bottom: 0;
27
43
  left: 0;
28
44
 
29
- @each $lang, $text in $custom-file-text {
30
- &:lang(#{$lang})::before {
31
- content: $text;
32
- }
33
- }
34
-
35
45
  @include hover {
36
46
  border-bottom-color: $textfield-border-color-hover;
37
47
  box-shadow: inset 0 ($textfield-border-width-hover * -1) 0 ($textfield-border-width * -1) $textfield-border-color-hover;
@@ -41,21 +51,9 @@
41
51
  @include set-material-icons;
42
52
 
43
53
  content: $custom-file-button-icon;
44
- }
45
-
46
- &::before {
47
- @include text-truncate;
48
- }
49
- }
50
-
51
- .custom-file-input {
52
- margin: 0;
53
- max-width: 100%;
54
- min-width: $custom-file-width;
55
- opacity: 0;
56
-
57
- &:focus ~ .custom-file-control {
58
- border-bottom-color: $textfield-border-color-focus;
59
- box-shadow: inset 0 ($textfield-border-width-focus * -1) 0 ($textfield-border-width * -1) $textfield-border-color-focus;
54
+ position: absolute;
55
+ top: 50%;
56
+ right: 0;
57
+ transform: translateY(-50%);
60
58
  }
61
59
  }
@@ -3,6 +3,12 @@
3
3
  .form-check {
4
4
  display: block;
5
5
  margin-bottom: $textfield-margin-y;
6
+
7
+ &.disabled {
8
+ .form-check-label {
9
+ color: $textfield-color-disabled;
10
+ }
11
+ }
6
12
  }
7
13
 
8
14
  .form-check-inline {
@@ -28,10 +34,6 @@
28
34
  display: inline-flex;
29
35
  font-size: inherit;
30
36
  line-height: inherit;
31
-
32
- .form-check.disabled & {
33
- color: $textfield-color-disabled;
34
- }
35
37
  }
36
38
 
37
39
  // Form group
@@ -103,6 +105,7 @@
103
105
  color: inherit;
104
106
  font-size: $font-size-base;
105
107
  line-height: ($textfield-font-size * $textfield-line-height / $font-size-base);
108
+ margin-bottom: 0;
106
109
  padding-top: $textfield-padding-y;
107
110
  padding-bottom: $textfield-padding-y;
108
111
  }
@@ -121,14 +124,6 @@
121
124
  padding-bottom: $textfield-padding-y-sm;
122
125
  }
123
126
 
124
- .col-form-legend {
125
- font-size: $font-size-base;
126
- line-height: ($textfield-font-size * $textfield-line-height / $font-size-base);
127
- margin-bottom: 0;
128
- padding-top: $textfield-padding-y;
129
- padding-bottom: $textfield-padding-y;
130
- }
131
-
132
127
  // Misc
133
128
 
134
129
  .form-text {
@@ -151,27 +146,3 @@
151
146
  .form-control-range {
152
147
  display: block;
153
148
  }
154
-
155
- // Validation
156
-
157
- .invalid-feedback {
158
- @include typography-caption;
159
-
160
- color: $form-feedback-invalid-color;
161
- display: none;
162
- margin-top: $textfield-margin-y;
163
-
164
- .form-control-lg + & {
165
- margin-top: $textfield-margin-y-lg;
166
- }
167
-
168
- .form-control-sm + & {
169
- margin-top: $textfield-margin-y-sm;
170
- }
171
- }
172
-
173
- .invalid-tooltip {
174
- display: none;
175
- position: absolute;
176
- top: 100%;
177
- }
@@ -29,8 +29,8 @@
29
29
  background-image: linear-gradient(to bottom, $btn-overlay, $btn-overlay);
30
30
  }
31
31
 
32
- &:active,
33
- &.active {
32
+ &.active,
33
+ &:active {
34
34
  background-color: $btn-bg-active;
35
35
  background-image: none;
36
36
  }
@@ -39,6 +39,10 @@
39
39
  outline: 0;
40
40
  }
41
41
 
42
+ &:not([disabled]):not(.disabled) {
43
+ cursor: pointer;
44
+ }
45
+
42
46
  .page-item:first-child & {
43
47
  margin-left: 0;
44
48
  }
@@ -50,6 +54,7 @@
50
54
  .page-item.disabled & {
51
55
  background-color: transparent;
52
56
  color: $pagination-color-disabled;
57
+ cursor: auto;
53
58
  pointer-events: none;
54
59
  }
55
60
  }
@@ -4,27 +4,23 @@
4
4
 
5
5
  .popover {
6
6
  @include reset-text;
7
- @include border-radius($border-radius);
7
+ @include border-radius($popover-border-radius);
8
8
 
9
9
  background-clip: padding-box;
10
- background-color: $dialog-content-bg;
11
- box-shadow: map-get($dialog-elevation-shadow, shadow);
10
+ background-color: $popover-bg;
11
+ box-shadow: map-get($popover-elevation-shadow, shadow);
12
12
  display: block;
13
- font-size: $font-size-base;
14
- margin: $tooltip-margin;
15
- max-width: $dialog-width-sm;
13
+ font-size: $popover-font-size;
14
+ margin: $popover-margin;
15
+ max-width: $popover-max-width;
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
19
- z-index: map-get($dialog-elevation-shadow, elevation);
20
-
21
- @include media-breakpoint-up(md) {
22
- margin: $tooltip-margin-desktop;
23
- }
19
+ z-index: map-get($popover-elevation-shadow, elevation);
24
20
  }
25
21
 
26
22
  .popover-body {
27
- padding: $dialog-padding-y $dialog-padding-x;
23
+ padding: $popover-padding-y $popover-padding-x;
28
24
 
29
25
  > :last-child {
30
26
  margin-bottom: 0;
@@ -35,13 +31,21 @@
35
31
  @include typography-title;
36
32
 
37
33
  margin-bottom: 0;
38
- padding: $dialog-padding-y $dialog-padding-x 0;
34
+ padding: $popover-padding-y $popover-padding-x 0;
39
35
 
40
36
  &:empty {
41
37
  display: none;
42
38
  }
43
39
 
44
40
  &:last-child {
45
- padding-bottom: $dialog-padding-y;
41
+ padding-bottom: $popover-padding-y;
42
+ }
43
+ }
44
+
45
+ // Desktop
46
+
47
+ @include media-breakpoint-up(md) {
48
+ .popover {
49
+ margin: $popover-margin-desktop;
46
50
  }
47
51
  }
@@ -53,7 +53,6 @@
53
53
  @import 'material/text-field-box';
54
54
  @import 'material/text-field-floating-label';
55
55
  @import 'material/text-field-input-group';
56
- @import 'material/text-field-textarea';
57
56
  @import 'material/toolbar';
58
57
  @import 'material/tooltip';
59
58
 
@@ -3,13 +3,13 @@
3
3
  background-color: transparent;
4
4
  box-shadow: none;
5
5
 
6
- &:active,
7
- &.active {
6
+ &.active,
7
+ &:active {
8
8
  box-shadow: none;
9
9
  }
10
10
 
11
- &:disabled,
12
- &.disabled {
11
+ &.disabled,
12
+ &:disabled {
13
13
  background-color: transparent;
14
14
  }
15
15
  }
@@ -21,8 +21,8 @@
21
21
  color: map-get(theme-color($color), color);
22
22
  }
23
23
 
24
- &:disabled,
25
- &.disabled {
24
+ &.disabled,
25
+ &:disabled {
26
26
  color: $btn-color-disabled;
27
27
  }
28
28
  }
@@ -34,8 +34,8 @@
34
34
  background-image: linear-gradient(to bottom, $btn-overlay-inverse, $btn-overlay-inverse);
35
35
  }
36
36
 
37
- &:active,
38
- &.active {
37
+ &.active,
38
+ &:active {
39
39
  background-color: $btn-bg-active-inverse;
40
40
  }
41
41
  }
@@ -8,6 +8,16 @@
8
8
  position: relative;
9
9
  vertical-align: middle;
10
10
 
11
+ @each $color, $values in $theme-colors {
12
+ > .btn-#{$color} {
13
+ &.disabled,
14
+ &:disabled {
15
+ background-color: map-get(theme-color($color), lighter);
16
+ color: color-yiq(map-get(theme-color($color), lighter));
17
+ }
18
+ }
19
+ }
20
+
11
21
  > .btn {
12
22
  @include transition-standard(border-color, opacity);
13
23
 
@@ -15,16 +25,6 @@
15
25
  flex: 0 1 auto;
16
26
  min-width: 0;
17
27
 
18
- @each $color, $values in $theme-colors {
19
- &-#{$color} {
20
- &:disabled,
21
- &.disabled {
22
- background-color: map-get(theme-color($color), lighter);
23
- color: color-yiq(map-get(theme-color($color), lighter));
24
- }
25
- }
26
- }
27
-
28
28
  &.active,
29
29
  &:active {
30
30
  box-shadow: none;
@@ -38,13 +38,13 @@
38
38
  &[class*='btn-outline'] {
39
39
  opacity: $btn-group-toggle-opacity;
40
40
 
41
- &:active,
42
- &.active {
41
+ &.active,
42
+ &:active {
43
43
  opacity: 1;
44
44
  }
45
45
 
46
- &:disabled,
47
- &.disabled {
46
+ &.disabled,
47
+ &:disabled {
48
48
  opacity: 1;
49
49
  }
50
50
  }
@@ -74,34 +74,15 @@
74
74
  margin-left: 0;
75
75
  }
76
76
 
77
- // Border radius
78
-
79
- > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
80
- @include border-right-radius(0);
81
- }
82
-
83
- > .btn:last-child:not(:first-child),
84
- > .dropdown-toggle:not(:first-child) {
77
+ > .btn:not(:first-child),
78
+ > .btn-group:not(:first-child) > .btn {
85
79
  @include border-left-radius(0);
86
80
  }
87
81
 
88
- > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
89
- border-radius: 0;
90
- }
91
-
92
- > .btn-group:first-child:not(:last-child) {
93
- > .btn:last-child,
94
- > .dropdown-toggle {
95
- @include border-right-radius(0);
96
- }
97
- }
98
-
99
- > .btn-group:last-child:not(:first-child) > .btn:first-child {
100
- @include border-left-radius(0);
101
- }
102
-
103
- > .btn-group:not(:first-child):not(:last-child) > .btn {
104
- border-radius: 0;
82
+ > .btn:not(:last-child):not(.dropdown-toggle),
83
+ > .btn-group:not(:last-child) > .btn,
84
+ > .dropdown-toggle:not(:last-of-type) {
85
+ @include border-right-radius(0);
105
86
  }
106
87
  }
107
88
 
@@ -122,33 +103,15 @@
122
103
  margin-top: 0;
123
104
  }
124
105
 
125
- // Border radius
126
-
127
- > .btn:first-child:not(:last-child) {
128
- @include border-bottom-radius(0);
129
- }
130
-
131
- > .btn:last-child:not(:first-child) {
132
- @include border-top-radius(0);
133
- }
134
-
135
- > .btn:not(:first-child):not(:last-child) {
136
- border-radius: 0;
137
- }
138
-
139
- > .btn-group:first-child:not(:last-child) {
140
- > .btn:last-child,
141
- > .dropdown-toggle {
142
- @include border-bottom-radius(0);
143
- }
144
- }
145
-
146
- > .btn-group:last-child:not(:first-child) > .btn:first-child {
106
+ > .btn:not(:first-child),
107
+ > .btn-group:not(:first-child) > .btn {
147
108
  @include border-top-radius(0);
148
109
  }
149
110
 
150
- > .btn-group:not(:first-child):not(:last-child) > .btn {
151
- border-radius: 0;
111
+ > .btn:not(:last-child):not(.dropdown-toggle),
112
+ > .btn-group:not(:last-child) > .btn,
113
+ > .dropdown-toggle:not(:last-of-type) {
114
+ @include border-bottom-radius(0);
152
115
  }
153
116
  }
154
117
 
@@ -31,30 +31,30 @@
31
31
  background-image: linear-gradient(to bottom, $btn-overlay, $btn-overlay);
32
32
  }
33
33
 
34
- &:active,
35
- &.active {
34
+ &.active,
35
+ &:active {
36
36
  background-color: $btn-bg-active;
37
37
  background-image: none;
38
38
  box-shadow: map-get($btn-elevation-shadow-active, shadow);
39
39
  }
40
40
 
41
- &:disabled,
42
- &.disabled {
41
+ &.disabled,
42
+ &:disabled {
43
43
  background-color: $btn-bg-disabled;
44
44
  background-image: none;
45
45
  box-shadow: none;
46
46
  color: $btn-color-disabled;
47
47
  opacity: 1;
48
-
49
- .waves-ripple {
50
- display: none;
51
- }
52
48
  }
53
49
 
54
50
  &:focus {
55
51
  outline: 0;
56
52
  }
57
53
 
54
+ &:not([disabled]):not(.disabled) {
55
+ cursor: pointer;
56
+ }
57
+
58
58
  .show > &.dropdown-toggle {
59
59
  background-image: linear-gradient(to bottom, $btn-overlay, $btn-overlay);
60
60
  }
@@ -76,13 +76,13 @@ fieldset[disabled] a.btn {
76
76
  color: color-yiq(map-get(theme-color($color), color));
77
77
  }
78
78
 
79
- &:active,
80
- &.active {
79
+ &.active,
80
+ &:active {
81
81
  background-color: map-get(theme-color($color), darker);
82
82
  }
83
83
 
84
- &:disabled,
85
- &.disabled {
84
+ &.disabled,
85
+ &:disabled {
86
86
  background-color: $btn-bg-disabled;
87
87
  color: $btn-color-disabled;
88
88
  }
@@ -90,8 +90,8 @@ fieldset[disabled] a.btn {
90
90
  }
91
91
 
92
92
  [class*='bg-dark'] :not([class*='bg-light']) .btn {
93
- &:disabled,
94
- &.disabled {
93
+ &.disabled,
94
+ &:disabled {
95
95
  background-color: $btn-bg-disabled-inverse;
96
96
  color: $btn-color-disabled-inverse;
97
97
  }
@@ -148,14 +148,14 @@ fieldset[disabled] a.btn {
148
148
  background-image: none;
149
149
  }
150
150
 
151
- &:active,
152
- &.active {
151
+ &.active,
152
+ &:active {
153
153
  background-color: transparent;
154
154
  box-shadow: none;
155
155
  }
156
156
 
157
- &:disabled,
158
- &.disabled {
157
+ &.disabled,
158
+ &:disabled {
159
159
  background-color: transparent;
160
160
  color: $btn-color-disabled;
161
161
  text-decoration: none;