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
@@ -34,9 +34,9 @@
34
34
  $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
35
35
 
36
36
  @if ($yiq >= $yiq-contrasted-threshold) {
37
- @return $black-primary;
37
+ @return $yiq-text-dark;
38
38
  } @else {
39
- @return $white-primary;
39
+ @return $yiq-text-light;
40
40
  }
41
41
  }
42
42
 
@@ -52,8 +52,20 @@
52
52
  }
53
53
  }
54
54
 
55
- // Return a theme colour palette
55
+ // Retrieve a colour
56
56
 
57
- @function theme-color($key: 'primary') {
58
- @return map-get($theme-colors, $key);
57
+ @function color($key: amber) {
58
+ @return map-get($colors, $key);
59
+ }
60
+
61
+ @function theme-color($key: primary) {
62
+ @return map-get(map-get($theme-colors, $key), color);
63
+ }
64
+
65
+ @function theme-color-dark($key: primary) {
66
+ @return map-get(map-get($theme-colors, $key), dark);
67
+ }
68
+
69
+ @function theme-color-light($key: primary) {
70
+ @return map-get(map-get($theme-colors, $key), light);
59
71
  }
@@ -1,3 +1,27 @@
1
+ :root {
2
+ @each $bp, $value in $grid-breakpoints {
3
+ --breakpoint-#{$bp}: #{$value};
4
+ }
5
+
6
+ @each $color, $value in $colors {
7
+ --#{$color}: #{$value};
8
+ }
9
+
10
+ @each $color, $values in $theme-colors {
11
+ @each $level, $value in $values {
12
+ @if $level == 'color' {
13
+ --#{$color}: #{$value};
14
+ } @else {
15
+ --#{$color}-#{$level}: #{$value};
16
+ }
17
+ }
18
+ }
19
+
20
+ --font-family-monospace: #{inspect($font-family-monospace)};
21
+ --font-family-sans-serif: #{inspect($font-family-sans-serif)};
22
+ --font-family-serif: #{inspect($font-family-serif)};
23
+ }
24
+
1
25
  // stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix
2
26
 
3
27
  // Box sizing
@@ -10,8 +10,8 @@
10
10
 
11
11
  @each $color, $values in $theme-colors {
12
12
  .alert-#{$color} {
13
- background-color: map-get(theme-color($color), lighter);
14
- color: color-yiq(map-get(theme-color($color), lighter));
13
+ background-color: theme-color-light($color);
14
+ color: color-yiq(theme-color-light($color));
15
15
  }
16
16
  }
17
17
 
@@ -26,13 +26,13 @@
26
26
 
27
27
  @each $color, $values in $theme-colors {
28
28
  .badge-#{$color} {
29
- background-color: map-get(theme-color($color), color);
30
- color: color-yiq(map-get(theme-color($color), color));
29
+ background-color: theme-color($color);
30
+ color: color-yiq(theme-color($color));
31
31
 
32
32
  &[href] {
33
33
  @include active-focus-hover {
34
- background-color: map-get(theme-color($color), darker);
35
- color: color-yiq(map-get(theme-color($color), darker));
34
+ background-color: theme-color-dark($color);
35
+ color: color-yiq(theme-color-dark($color));
36
36
  text-decoration: none;
37
37
  }
38
38
  }
@@ -65,6 +65,39 @@
65
65
  top: 0;
66
66
  }
67
67
 
68
+ // Fade
69
+
70
+ .carousel-fade {
71
+ .carousel-item {
72
+ @include transition-standard-complex(opacity);
73
+
74
+ opacity: 0;
75
+ }
76
+
77
+ .carousel-item.active,
78
+ .carousel-item-next.carousel-item-left,
79
+ .carousel-item-prev.carousel-item-right {
80
+ opacity: 1;
81
+ }
82
+
83
+ .carousel-item.active,
84
+ .carousel-item-left.active,
85
+ .carousel-item-next,
86
+ .carousel-item-prev,
87
+ .carousel-item-prev.active {
88
+ transform: translateX(0);
89
+
90
+ @supports (transform-style: preserve-3d) {
91
+ transform: translate3d(0, 0, 0);
92
+ }
93
+ }
94
+
95
+ .carousel-item-left.active,
96
+ .carousel-item-right.active {
97
+ opacity: 0;
98
+ }
99
+ }
100
+
68
101
  // Left/right controls
69
102
 
70
103
  .carousel-control-next,
@@ -74,6 +107,7 @@
74
107
  border-radius: 50%;
75
108
  box-shadow: map-get($carousel-control-elevation-shadow, shadow);
76
109
  color: $carousel-control-color;
110
+ cursor: pointer;
77
111
  display: flex;
78
112
  font-size: $carousel-control-font-size;
79
113
  height: $carousel-control-size;
@@ -97,6 +131,7 @@
97
131
  }
98
132
 
99
133
  &:focus {
134
+ opacity: 1;
100
135
  outline: 0;
101
136
  }
102
137
  }
@@ -152,6 +187,7 @@
152
187
  background-color: transparent;
153
188
  border: $carousel-indicator-border-width solid $carousel-indicator-border-color;
154
189
  border-radius: $carousel-indicator-size;
190
+ cursor: pointer;
155
191
  flex: 0 0 auto;
156
192
  height: $carousel-indicator-size;
157
193
  margin-right: $carousel-indicator-border-width;
@@ -21,7 +21,7 @@
21
21
  outline: 0;
22
22
  }
23
23
 
24
- &:not([disabled]):not(.disabled) {
24
+ &:not(:disabled):not(.disabled) {
25
25
  cursor: pointer;
26
26
  }
27
27
  }
@@ -3,35 +3,28 @@
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
+ padding-left: $form-check-input-gutter;
7
+ position: relative;
12
8
  }
13
9
 
14
10
  .form-check-inline {
15
11
  display: inline-block;
12
+ margin-right: $form-check-inline-margin-x;
16
13
  margin-bottom: 0;
17
- vertical-align: middle;
18
-
19
- + .form-check-inline {
20
- margin-left: $form-check-inline-margin-x;
21
- }
22
14
  }
23
15
 
24
16
  .form-check-input {
25
- flex-shrink: 0;
26
- margin-right: $form-check-input-margin-x;
27
- position: relative;
28
- top: (($font-size-base * $line-height-base - $font-size-base) / 3 * 2);
17
+ margin-top: (($font-size-base * $line-height-base - $font-size-base) / 3 * 2);
18
+ margin-left: ($form-check-input-gutter * -1);
19
+ position: absolute;
20
+
21
+ &:disabled ~ .form-check-label {
22
+ color: $textfield-color-disabled;
23
+ }
29
24
  }
30
25
 
31
26
  .form-check-label {
32
- align-items: flex-start;
33
27
  color: inherit;
34
- display: inline-flex;
35
28
  font-size: inherit;
36
29
  line-height: inherit;
37
30
  }
@@ -62,16 +55,12 @@
62
55
  display: flex;
63
56
  flex-flow: row wrap;
64
57
 
65
- label {
66
- align-items: center;
67
- display: flex;
68
- justify-content: center;
58
+ .custom-file,
59
+ .custom-select {
60
+ width: auto;
69
61
  }
70
62
 
71
63
  .form-check {
72
- align-items: center;
73
- display: flex;
74
- justify-content: center;
75
64
  margin-bottom: 0;
76
65
  width: auto;
77
66
  }
@@ -105,7 +94,6 @@
105
94
  color: inherit;
106
95
  font-size: $font-size-base;
107
96
  line-height: ($textfield-font-size * $textfield-line-height / $font-size-base);
108
- margin-bottom: 0;
109
97
  padding-top: $textfield-padding-y;
110
98
  padding-bottom: $textfield-padding-y;
111
99
  }
@@ -146,3 +134,16 @@
146
134
  .form-control-range {
147
135
  display: block;
148
136
  }
137
+
138
+ .form-control-file {
139
+ @extend %form-control;
140
+
141
+ &::-webkit-file-upload-button {
142
+ background-color: transparent;
143
+ background-image: none;
144
+ border: 0;
145
+ color: $textfield-hint-color;
146
+ height: auto;
147
+ padding: 0;
148
+ }
149
+ }
@@ -39,7 +39,7 @@
39
39
  outline: 0;
40
40
  }
41
41
 
42
- &:not([disabled]):not(.disabled) {
42
+ &:not(:disabled):not(.disabled) {
43
43
  cursor: pointer;
44
44
  }
45
45
 
@@ -1,4 +1,4 @@
1
- @import 'colours';
1
+ @import 'colors';
2
2
  @import 'functions';
3
3
  @import 'mixins';
4
4
  @import 'variables';
@@ -18,7 +18,7 @@
18
18
  .btn-flat-#{$color},
19
19
  .btn-outline-#{$color} {
20
20
  @include plain-active-focus-hover {
21
- color: map-get(theme-color($color), color);
21
+ color: theme-color($color);
22
22
  }
23
23
 
24
24
  &.disabled,
@@ -23,3 +23,25 @@
23
23
  width: $btn-float-size-sm;
24
24
  }
25
25
  }
26
+
27
+ .btn-float-dropdown {
28
+ .dropdown-menu {
29
+ border-radius: 0;
30
+ margin-top: $btn-float-dropdown-inner-spacer-y;
31
+ min-width: $btn-float-size;
32
+ padding-top: 0;
33
+ padding-bottom: 0;
34
+ text-align: center;
35
+
36
+ &::before {
37
+ display: none;
38
+ }
39
+
40
+ .btn-float {
41
+ display: block;
42
+ margin-right: auto;
43
+ margin-bottom: $btn-float-dropdown-inner-spacer-y;
44
+ margin-left: auto;
45
+ }
46
+ }
47
+ }
@@ -12,8 +12,8 @@
12
12
  > .btn-#{$color} {
13
13
  &.disabled,
14
14
  &:disabled {
15
- background-color: map-get(theme-color($color), lighter);
16
- color: color-yiq(map-get(theme-color($color), lighter));
15
+ background-color: theme-color-light($color);
16
+ color: color-yiq(theme-color-light($color));
17
17
  }
18
18
  }
19
19
  }
@@ -51,7 +51,7 @@
51
51
  outline: 0;
52
52
  }
53
53
 
54
- &:not([disabled]):not(.disabled) {
54
+ &:not(:disabled):not(.disabled) {
55
55
  cursor: pointer;
56
56
  }
57
57
 
@@ -62,23 +62,23 @@
62
62
 
63
63
  // stylelint-disable selector-no-qualifying-type
64
64
  a.btn.disabled,
65
- fieldset[disabled] a.btn {
65
+ fieldset:disabled a.btn {
66
66
  pointer-events: none;
67
67
  }
68
68
  // stylelint-enable
69
69
 
70
70
  @each $color, $values in $theme-colors {
71
71
  .btn-#{$color} {
72
- background-color: map-get(theme-color($color), color);
73
- color: color-yiq(map-get(theme-color($color), color));
72
+ background-color: theme-color($color);
73
+ color: color-yiq(theme-color($color));
74
74
 
75
75
  @include active-focus-hover {
76
- color: color-yiq(map-get(theme-color($color), color));
76
+ color: color-yiq(theme-color($color));
77
77
  }
78
78
 
79
79
  &.active,
80
80
  &:active {
81
- background-color: map-get(theme-color($color), darker);
81
+ background-color: theme-color-dark($color);
82
82
  }
83
83
 
84
84
  &.disabled,
@@ -12,12 +12,12 @@
12
12
 
13
13
  @each $color, $values in $theme-colors {
14
14
  &.border-#{$color} {
15
- box-shadow: map-get($card-elevation-shadow, shadow), inset 0 0 0 1px map-get(theme-color($color), color);
15
+ box-shadow: map-get($card-elevation-shadow, shadow), inset 0 0 0 1px theme-color($color);
16
16
 
17
17
  &[href],
18
18
  &[tabindex] {
19
19
  @include active-focus-hover {
20
- box-shadow: map-get($card-elevation-shadow-hover, shadow), inset 0 0 0 1px map-get(theme-color($color), color);
20
+ box-shadow: map-get($card-elevation-shadow-hover, shadow), inset 0 0 0 1px theme-color($color);
21
21
  }
22
22
  }
23
23
  }
@@ -107,7 +107,7 @@
107
107
 
108
108
  @each $color, $values in $theme-colors {
109
109
  &.border-#{$color} {
110
- border-top: $card-border-width solid map-get(theme-color($color), color);
110
+ border-top: $card-border-width solid theme-color($color);
111
111
  }
112
112
  }
113
113
 
@@ -151,7 +151,7 @@
151
151
 
152
152
  @each $color, $values in $theme-colors {
153
153
  &.border-#{$color} {
154
- border-bottom: $card-border-width solid map-get(theme-color($color), color);
154
+ border-bottom: $card-border-width solid theme-color($color);
155
155
  }
156
156
  }
157
157
 
@@ -33,8 +33,8 @@
33
33
 
34
34
  @each $color, $values in $theme-colors {
35
35
  .chip-#{$color} {
36
- background-color: map-get(theme-color($color), color);
37
- color: color-yiq(map-get(theme-color($color), color));
36
+ background-color: theme-color($color);
37
+ color: color-yiq(theme-color($color));
38
38
  }
39
39
  }
40
40
 
@@ -23,9 +23,10 @@
23
23
  }
24
24
 
25
25
  tbody {
26
+ color: $table-tbody-color;
27
+
26
28
  td,
27
29
  th {
28
- color: $table-tbody-color;
29
30
  font-size: $table-tbody-font-size;
30
31
  font-weight: $table-tbody-font-weight;
31
32
  height: $table-tbody-cell-height;
@@ -35,9 +36,10 @@
35
36
  }
36
37
 
37
38
  tfoot {
39
+ color: $table-tfoot-color;
40
+
38
41
  td,
39
42
  th {
40
- color: $table-tfoot-color;
41
43
  font-size: $table-tfoot-font-size;
42
44
  font-weight: $table-tfoot-font-weight;
43
45
  height: $table-tfoot-cell-height;
@@ -47,9 +49,10 @@
47
49
  }
48
50
 
49
51
  thead {
52
+ color: $table-thead-color;
53
+
50
54
  td,
51
55
  th {
52
- color: $table-thead-color;
53
56
  font-size: $table-thead-font-size;
54
57
  font-weight: $table-thead-font-weight;
55
58
  height: $table-thead-cell-height;
@@ -62,34 +65,24 @@
62
65
  border-top: $table-border-width solid $table-border-color;
63
66
  }
64
67
 
65
- > :first-child {
66
- > tr:first-child,
67
- > tr:first-child,
68
- > tr:first-child {
69
- td,
70
- th {
71
- border-top: 0;
72
- }
68
+ > :first-child > tr:first-child {
69
+ td,
70
+ th {
71
+ border-top: 0;
73
72
  }
74
73
  }
75
74
  }
76
75
 
77
- .table-bordered {
78
- box-shadow: map-get($table-elevation-shadow, shadow);
79
- }
80
-
81
- .table-striped {
82
- tbody tr:nth-of-type(odd) {
83
- background-color: $table-bg-accent;
76
+ .table-borderless {
77
+ td,
78
+ th,
79
+ .table {
80
+ border: 0;
84
81
  }
85
82
  }
86
83
 
87
- .table-hover {
88
- tbody tr {
89
- @include hover {
90
- background-color: $table-bg-hover;
91
- }
92
- }
84
+ .table-bordered {
85
+ box-shadow: map-get($table-elevation-shadow, shadow);
93
86
  }
94
87
 
95
88
  .table-sm {
@@ -134,25 +127,61 @@
134
127
  }
135
128
  }
136
129
 
130
+ .table-striped {
131
+ tbody tr:nth-of-type(#{$table-striped-order}) {
132
+ background-color: $table-bg-accent;
133
+ }
134
+ }
135
+
136
+ // Placed here because it has to come after the striping styles
137
+
138
+ .table-hover {
139
+ tbody tr {
140
+ @include hover {
141
+ background-color: $table-bg-hover;
142
+ }
143
+ }
144
+ }
145
+
137
146
  // Table background
138
147
 
139
148
  @each $color, $values in $theme-colors {
140
- .table .table-#{$color} {
149
+ .table-#{$color} {
141
150
  &,
142
151
  > td,
143
152
  > th {
144
- background-color: map-get(theme-color($color), color);
145
- color: color-yiq(map-get(theme-color($color), color));
153
+ background-color: theme-color-light($color);
154
+ color: color-yiq(theme-color-light($color));
146
155
  }
156
+
157
+ .table-hover & {
158
+ @include hover {
159
+ &,
160
+ > td,
161
+ > th {
162
+ background-color: theme-color($color);
163
+ color: color-yiq(theme-color($color));
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+
170
+ .table-active {
171
+ &,
172
+ > td,
173
+ > th {
174
+ background-color: $table-bg-active;
175
+ color: color-yiq($table-bg-active);
147
176
  }
148
177
 
149
- .table-hover .table-#{$color} {
178
+ .table-hover & {
150
179
  @include hover {
151
180
  &,
152
181
  > td,
153
182
  > th {
154
- background-color: map-get(theme-color($color), darker);
155
- color: color-yiq(map-get(theme-color($color), darker));
183
+ background-color: $table-bg-active-hover;
184
+ color: color-yiq($table-bg-active-hover);
156
185
  }
157
186
  }
158
187
  }
@@ -198,14 +227,12 @@
198
227
  tbody,
199
228
  tfoot,
200
229
  thead {
201
- td,
202
- th {
203
- color: inherit;
204
- }
230
+ color: inherit;
205
231
  }
206
232
 
207
233
  td,
208
- th {
234
+ th,
235
+ .table {
209
236
  border-color: $table-dark-border-color;
210
237
  }
211
238
  }