material-sass 4.1.0 → 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/assets/javascripts/material.js +48 -92
  4. data/assets/javascripts/material.min.js +4 -4
  5. data/assets/javascripts/material/components/floating-label.js +1 -1
  6. data/assets/javascripts/material/components/nav-drawer.js +12 -39
  7. data/assets/javascripts/material/components/pickdate.js +1 -1
  8. data/assets/javascripts/material/components/tab-switch.js +2 -12
  9. data/assets/javascripts/material/components/util.js +7 -21
  10. data/assets/stylesheets/material/base/_base.scss +0 -1
  11. data/assets/stylesheets/material/bootstrap/_form.scss +41 -17
  12. data/assets/stylesheets/material/material.scss +0 -1
  13. data/assets/stylesheets/material/material/_expansion-panel.scss +1 -0
  14. data/assets/stylesheets/material/material/_selection-control.scss +8 -1
  15. data/assets/stylesheets/material/material/_text-field-box.scss +65 -30
  16. data/assets/stylesheets/material/material/_text-field-floating-label.scss +114 -21
  17. data/assets/stylesheets/material/material/_text-field-input-group.scss +59 -33
  18. data/assets/stylesheets/material/material/_text-field.scss +150 -84
  19. data/assets/stylesheets/material/material/_toolbar.scss +6 -5
  20. data/assets/stylesheets/material/mixins/_form.scss +32 -57
  21. data/assets/stylesheets/material/mixins/_grid-framework.scss +9 -8
  22. data/assets/stylesheets/material/mixins/_text-hide.scss +4 -2
  23. data/assets/stylesheets/material/utilities/_position.scss +5 -3
  24. data/assets/stylesheets/material/utilities/_text.scss +1 -1
  25. data/assets/stylesheets/material/variables/_spacer.scss +5 -5
  26. data/assets/stylesheets/material/variables/_variable-material.scss +6 -3
  27. data/lib/material-sass/version.rb +1 -1
  28. metadata +3 -4
  29. data/assets/stylesheets/material/bootstrap/_custom-form.scss +0 -59
@@ -145,11 +145,12 @@
145
145
  }
146
146
 
147
147
  .navbar-sticky-top {
148
- box-shadow: map-get($toolbar-elevation-shadow, shadow);
149
- position: sticky;
150
- top: 0;
151
- width: 100%;
152
- z-index: map-get($toolbar-elevation-shadow, elevation);
148
+ @supports (position: sticky) {
149
+ box-shadow: map-get($toolbar-elevation-shadow, shadow);
150
+ position: sticky;
151
+ top: 0;
152
+ z-index: map-get($toolbar-elevation-shadow, elevation);
153
+ }
153
154
  }
154
155
 
155
156
  .toolbar-waterfall {
@@ -1,44 +1,3 @@
1
- @mixin floating-label-size($font-size, $height, $line-height, $padding-y) {
2
- &.has-value > label,
3
- &.is-focused > label {
4
- transform: scale($floating-label-font-size-focus / $font-size);
5
- }
6
-
7
- > label {
8
- font-size: $font-size;
9
- line-height: $line-height;
10
- top: ($floating-label-font-size-focus + $padding-y);
11
- }
12
- }
13
-
14
- @mixin form-control-size($font-size, $height, $line-height, $padding-x, $padding-y) {
15
- font-size: $font-size;
16
- height: $height;
17
- line-height: $line-height;
18
- padding: $padding-y $padding-x ($padding-y - $textfield-border-width / $font-size-root * 1rem);
19
-
20
- &[type='file'] {
21
- height: auto;
22
- max-height: $height;
23
- min-height: $height;
24
- }
25
- }
26
-
27
- @mixin form-select-size($font-size, $height, $padding-x) {
28
- @include media-moz-webkit {
29
- $select-bg-size: (($material-icon-size / $textfield-font-size) * $font-size);
30
-
31
- background-size: $select-bg-size $select-bg-size;
32
- padding-right: ($padding-x + $select-bg-size);
33
-
34
- @if $padding-x != 0 {
35
- background-position: calc(100% - #{$padding-x}) ($height / 2 - $select-bg-size / 2);
36
- } @else {
37
- background-position: 100% ($height / 2 - $select-bg-size / 2);
38
- }
39
- }
40
- }
41
-
42
1
  @mixin form-validation-state($state, $color) {
43
2
  .#{$state}-feedback {
44
3
  @include typography-caption;
@@ -103,6 +62,10 @@
103
62
  }
104
63
  }
105
64
 
65
+ ~ .custom-control-track {
66
+ background-color: rgba($color, $selection-control-track-opacity);
67
+ }
68
+
106
69
  ~ .#{$state}-feedback,
107
70
  ~ .#{$state}-tooltip {
108
71
  display: block;
@@ -136,9 +99,25 @@
136
99
  }
137
100
  }
138
101
 
139
- .custom-select,
140
- .form-control,
141
- .form-control-file {
102
+ .custom-switch .custom-control-input {
103
+ &.is-#{$state},
104
+ .was-validated &:#{$state} {
105
+ ~ .custom-control-label::after {
106
+ background-color: $color;
107
+ }
108
+ }
109
+ }
110
+
111
+ .form-check-input {
112
+ &.is-#{$state},
113
+ .was-validated &:#{$state} {
114
+ + .form-check-label {
115
+ color: $color;
116
+ }
117
+ }
118
+ }
119
+
120
+ %form-control {
142
121
  &.is-#{$state},
143
122
  .was-validated &:#{$state} {
144
123
  border-color: $color;
@@ -155,23 +134,19 @@
155
134
  }
156
135
  }
157
136
 
158
- .form-check-input {
137
+ %form-textarea {
159
138
  &.is-#{$state},
160
139
  .was-validated &:#{$state} {
161
- + .form-check-label {
162
- color: $color;
140
+ @include focus-hover {
141
+ box-shadow: inset $textfield-border-width-hover $textfield-border-width-hover 0 ($textfield-border-width * -1) $color, inset ($textfield-border-width-hover * -1) ($textfield-border-width-hover * -1) 0 ($textfield-border-width * -1) $color;
163
142
  }
164
143
  }
165
- }
166
- }
167
144
 
168
- @mixin textfield-box-size($font-size, $height, $line-height, $padding-x, $padding-y) {
169
- > label {
170
- top: $padding-y;
171
- left: $padding-x;
172
- }
173
-
174
- > .form-control {
175
- padding-top: ($height - ($textfield-box-label-spacer-y - $textfield-border-width / $font-size-root * 1rem) - $font-size * $line-height);
145
+ .textfield-box &.is-#{$state},
146
+ .was-validated .textfield-box &:#{$state} {
147
+ @include focus-hover {
148
+ box-shadow: inset 0 ($textfield-border-width-hover * -1) 0 ($textfield-border-width * -1) $color;
149
+ }
150
+ }
176
151
  }
177
152
  }
@@ -1,4 +1,13 @@
1
1
  @mixin make-grid-columns() {
2
+ %grid-column {
3
+ min-height: 1px;
4
+ padding-right: ($grid-gutter-width / 2);
5
+ padding-left: ($grid-gutter-width / 2);
6
+ position: relative;
7
+ width: 100%;
8
+ }
9
+
10
+ // stylelint-disable-next-line order/order
2
11
  @each $breakpoint in map-keys($grid-breakpoints) {
3
12
  $infix: breakpoint-infix($breakpoint);
4
13
 
@@ -55,12 +64,4 @@
55
64
  @extend %grid-column;
56
65
  }
57
66
  }
58
-
59
- %grid-column {
60
- min-height: 1px;
61
- padding-right: ($grid-gutter-width / 2);
62
- padding-left: ($grid-gutter-width / 2);
63
- position: relative;
64
- width: 100%;
65
- }
66
67
  }
@@ -1,9 +1,11 @@
1
- @mixin text-hide {
1
+ @mixin text-hide($ignore-warning: false) {
2
2
  background-color: transparent;
3
3
  border: 0;
4
4
  color: transparent;
5
5
  font: 0/0 a; // stylelint-disable-line font-family-no-missing-generic-family-keyword
6
6
  text-shadow: none;
7
7
 
8
- @warn 'The `text-hide()` mixin has been deprecated as of v4.1.0. It will be removed entirely in v5.';
8
+ @if ($ignore-warning != true) {
9
+ @warn 'The `text-hide()` mixin has been deprecated as of v4.1.0. It will be removed entirely in v5.';
10
+ }
9
11
  }
@@ -30,7 +30,9 @@ $positions: absolute, fixed, relative, static, sticky;
30
30
  }
31
31
 
32
32
  .sticky-top {
33
- position: sticky;
34
- top: 0;
35
- z-index: map-get($toolbar-elevation-shadow, elevation);
33
+ @supports (position: sticky) {
34
+ position: sticky;
35
+ top: 0;
36
+ z-index: map-get($toolbar-elevation-shadow, elevation);
37
+ }
36
38
  }
@@ -91,7 +91,7 @@
91
91
  // Misc
92
92
 
93
93
  .text-hide {
94
- @include text-hide;
94
+ @include text-hide($ignore-warning: true);
95
95
  }
96
96
 
97
97
  // Transformation
@@ -16,12 +16,12 @@ $sizes: map-merge(
16
16
  $sizes
17
17
  );
18
18
 
19
- $spacer: 1rem !default;
19
+ $spacer: 1rem !default;
20
20
 
21
- $spacer-xs: ($spacer * 0.25) !default;
22
- $spacer-sm: ($spacer * 0.5) !default;
23
- $spacer-lg: ($spacer * 1.5) !default;
24
- $spacer-xl: ($spacer * 3) !default;
21
+ $spacer-xs: ($spacer * 0.25) !default;
22
+ $spacer-sm: ($spacer * 0.5) !default;
23
+ $spacer-lg: ($spacer * 1.5) !default;
24
+ $spacer-xl: ($spacer * 3) !default;
25
25
 
26
26
  $spacers: () !default;
27
27
  // stylelint-disable-next-line scss/dollar-variable-default
@@ -391,7 +391,6 @@ $textfield-border-width-hover: ($textfield-border-width * 2) !default;
391
391
  $textfield-color: $black-primary !default;
392
392
  $textfield-color-disabled: $black-hint !default;
393
393
  $textfield-hint-color: $black-hint !default;
394
- $textfield-line-height: $line-height-base !default;
395
394
  $textfield-margin-x: $spacer !default;
396
395
  $textfield-plaintext-color: $body-color !default;
397
396
 
@@ -403,7 +402,7 @@ $textfield-height-lg: 3.75rem !default;
403
402
  $textfield-height-sm: 2rem !default;
404
403
  $textfield-line-height: 1.5 !default;
405
404
  $textfield-line-height-lg: 1.176471 !default;
406
- $textfield-line-height-sm: 1.384615 !default;
405
+ $textfield-line-height-sm: 1.538462 !default;
407
406
  $textfield-margin-y: 0.5rem !default;
408
407
  $textfield-margin-y-lg: 0.75rem !default;
409
408
  $textfield-margin-y-sm: 0.25rem !default;
@@ -414,6 +413,8 @@ $textfield-padding-y: (($textfield-height - $textfield-font-size * $tex
414
413
  $textfield-padding-y-lg: (($textfield-height-lg - $textfield-font-size-lg * $textfield-line-height-lg) / 2) !default;
415
414
  $textfield-padding-y-sm: (($textfield-height-sm - $textfield-font-size-sm * $textfield-line-height-sm) / 2) !default;
416
415
 
416
+ $textfield-select-bg-size: ($material-icon-size / $textfield-font-size * 1em) !default;
417
+
417
418
  // Text field: box
418
419
  // Based on https://material.io/guidelines/components/text-fields.html#text-fields-text-field-boxes
419
420
 
@@ -436,7 +437,9 @@ $textfield-box-padding-y-sm: (($textfield-box-height-sm - $textfield-font-size
436
437
 
437
438
  $floating-label-color: $textfield-hint-color !default;
438
439
  $floating-label-color-focus: theme-color(secondary) !default;
439
- $floating-label-font-size-focus: 0.75rem !default;
440
+ $floating-label-font-size: 0.75rem !default;
441
+ $floating-label-font-size-lg: 0.875rem !default;
442
+ $floating-label-font-size-sm: 0.625rem !default;
440
443
 
441
444
  // Toolbar (Bootstrap navbar)
442
445
  // Based on https://material.google.com/components/toolbars.html#toolbars-usage
@@ -1,5 +1,5 @@
1
1
  module Material
2
2
  module Sass
3
- VERSION = '4.1.0'
3
+ VERSION = '4.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material-sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mkhairi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-17 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -104,7 +104,6 @@ files:
104
104
  - assets/stylesheets/material/bootstrap/_carousel.scss
105
105
  - assets/stylesheets/material/bootstrap/_close.scss
106
106
  - assets/stylesheets/material/bootstrap/_code.scss
107
- - assets/stylesheets/material/bootstrap/_custom-form.scss
108
107
  - assets/stylesheets/material/bootstrap/_form.scss
109
108
  - assets/stylesheets/material/bootstrap/_image.scss
110
109
  - assets/stylesheets/material/bootstrap/_jumbotron.scss
@@ -208,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
207
  version: '0'
209
208
  requirements: []
210
209
  rubyforge_project:
211
- rubygems_version: 2.7.3
210
+ rubygems_version: 2.7.6
212
211
  signing_key:
213
212
  specification_version: 4
214
213
  summary: Material Design for Bootstrap 4
@@ -1,59 +0,0 @@
1
- // N.B. Custom checkbox, radio button and select are defined in Material design
2
- // (https://material.google.com/components/selection-controls.html)
3
- // therefore, these elements are styled in /assets/sass/material/_selection-control.scss
4
-
5
- // Custom file
6
-
7
- .custom-file {
8
- display: inline-block;
9
- height: $textfield-height;
10
- margin-bottom: 0;
11
- position: relative;
12
- width: 100%;
13
- }
14
-
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 {
32
- @include form-control-size($textfield-font-size, $textfield-height, $textfield-line-height, $textfield-padding-x, $textfield-padding-y);
33
- @include text-truncate;
34
- @include transition-standard(border-color, box-shadow);
35
-
36
- border-bottom: $textfield-border-width solid $textfield-border-color;
37
- color: $textfield-hint-color;
38
- height: $textfield-height;
39
- padding-right: ($material-icon-size + $selection-control-spacer-x);
40
- position: absolute;
41
- top: 0;
42
- right: 0;
43
- left: 0;
44
-
45
- @include hover {
46
- border-bottom-color: $textfield-border-color-hover;
47
- box-shadow: inset 0 ($textfield-border-width-hover * -1) 0 ($textfield-border-width * -1) $textfield-border-color-hover;
48
- }
49
-
50
- &::after {
51
- @include set-material-icons;
52
-
53
- content: $custom-file-button-icon;
54
- position: absolute;
55
- top: 50%;
56
- right: 0;
57
- transform: translateY(-50%);
58
- }
59
- }