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
@@ -44,6 +44,10 @@
44
44
  .order#{$infix}-first {
45
45
  order: -1;
46
46
  }
47
+
48
+ .order#{$infix}-last {
49
+ order: $grid-columns + 1;
50
+ }
47
51
  }
48
52
 
49
53
  .col#{$infix},
@@ -53,9 +57,9 @@
53
57
  }
54
58
 
55
59
  %grid-column {
56
- @include make-gutters;
57
-
58
60
  min-height: 1px;
61
+ padding-right: ($grid-gutter-width / 2);
62
+ padding-left: ($grid-gutter-width / 2);
59
63
  position: relative;
60
64
  width: 100%;
61
65
  }
@@ -1,5 +1,4 @@
1
1
  // Make column
2
-
3
2
  @mixin make-col($size) {
4
3
  flex: 0 0 percentage($size / $grid-columns);
5
4
  max-width: percentage($size / $grid-columns);
@@ -11,29 +10,21 @@
11
10
  margin-left: if($num == 0, 0, percentage($num));
12
11
  }
13
12
 
14
- @mixin make-gutters($type: padding) {
15
- @each $breakpoint in map-keys($grid-gutter-widths) {
16
- @include media-breakpoint-up($breakpoint) {
17
- $gutter: map-get($grid-gutter-widths, $breakpoint);
18
-
19
- @if ($type == margin) {
20
- margin-right: ($gutter / -2);
21
- margin-left: ($gutter / -2);
22
- } @else if ($type == padding) {
23
- padding-right: ($gutter / 2);
24
- padding-left: ($gutter / 2);
25
- }
26
- }
27
- }
13
+ @mixin make-col-ready() {
14
+ min-height: 1px;
15
+ padding-right: ($grid-gutter-width / 2);
16
+ padding-left: ($grid-gutter-width / 2);
17
+ position: relative;
18
+ width: 100%;
28
19
  }
29
20
 
30
21
  // Make container
31
22
 
32
23
  @mixin make-container() {
33
- @include make-gutters;
34
-
35
24
  margin-right: auto;
36
25
  margin-left: auto;
26
+ padding-right: ($grid-gutter-width / 2);
27
+ padding-left: ($grid-gutter-width / 2);
37
28
  width: 100%;
38
29
  }
39
30
 
@@ -48,8 +39,8 @@
48
39
  // Make row
49
40
 
50
41
  @mixin make-row() {
51
- @include make-gutters(margin);
52
-
53
42
  display: flex;
54
43
  flex-wrap: wrap;
44
+ margin-right: ($grid-gutter-width / -2);
45
+ margin-left: ($grid-gutter-width / -2);
55
46
  }
@@ -15,5 +15,5 @@
15
15
  // Palette
16
16
 
17
17
  @each $color, $values in $theme-colors {
18
- @include bg-variant('.bg-#{$color}', map-get(theme-color($color), color), map-get(theme-color($color), darker));
18
+ @include bg-variant('.bg-#{$color}', theme-color($color), theme-color-dark($color));
19
19
  }
@@ -42,7 +42,6 @@
42
42
  border-left: 0 !important;
43
43
  }
44
44
 
45
- // Colour
46
45
  .border-black {
47
46
  border-color: $black !important;
48
47
  }
@@ -85,7 +84,7 @@
85
84
 
86
85
  @each $color, $values in $theme-colors {
87
86
  .border-#{$color} {
88
- border-color: map-get(theme-color($color), color) !important;
87
+ border-color: theme-color($color) !important;
89
88
  }
90
89
  }
91
90
 
@@ -46,32 +46,40 @@
46
46
 
47
47
  // Utilities for toggling `display` in print
48
48
 
49
- .d-print-block {
50
- display: none !important;
51
-
52
- @media print {
49
+ @media print {
50
+ .d-print-block {
53
51
  display: block !important;
54
52
  }
55
- }
56
53
 
57
- .d-print-inline {
58
- display: none !important;
54
+ .d-print-flex {
55
+ display: flex !important;
56
+ }
59
57
 
60
- @media print {
58
+ .d-print-inline {
61
59
  display: inline !important;
62
60
  }
63
- }
64
61
 
65
- .d-print-inline-block {
66
- display: none !important;
67
-
68
- @media print {
62
+ .d-print-inline-block {
69
63
  display: inline-block !important;
70
64
  }
71
- }
72
65
 
73
- .d-print-none {
74
- @media print {
66
+ .d-print-inline-flex {
67
+ display: inline-flex !important;
68
+ }
69
+
70
+ .d-print-none {
75
71
  display: none !important;
76
72
  }
73
+
74
+ .d-print-table {
75
+ display: table !important;
76
+ }
77
+
78
+ .d-print-table-cell {
79
+ display: table-cell !important;
80
+ }
81
+
82
+ .d-print-table-row {
83
+ display: table-row !important;
84
+ }
77
85
  }
@@ -98,6 +98,10 @@
98
98
 
99
99
  // Flex wrap
100
100
 
101
+ .flex#{$infix}-fill {
102
+ flex: 1 1 auto !important;
103
+ }
104
+
101
105
  .flex#{$infix}-nowrap {
102
106
  flex-wrap: nowrap !important;
103
107
  }
@@ -47,7 +47,7 @@
47
47
  @include text-emphasis-variant('.text-muted', $text-muted);
48
48
 
49
49
  @each $color, $values in $theme-colors {
50
- @include text-emphasis-variant('.text-#{$color}', map-get(theme-color($color), color), map-get(theme-color($color), darker));
50
+ @include text-emphasis-variant('.text-#{$color}', theme-color($color), theme-color-dark($color));
51
51
  }
52
52
 
53
53
  // Italcs and weight
@@ -7,7 +7,6 @@ $elevation-12dp: 12 * 10 !default;
7
7
  $elevation-8dp: 8 * 10 !default;
8
8
  $elevation-6dp: 6 * 10 !default;
9
9
  $elevation-4dp: 4 * 10 !default;
10
- $elevation-3dp: 3 * 10 !default;
11
10
  $elevation-2dp: 2 * 10 !default;
12
11
  $elevation-1dp: 1 * 10 !default;
13
12
 
@@ -24,7 +23,6 @@ $shadow-12dp: 0 12px 17px 2px $shadow-color-1, 0 5px 22px 4px $shadow-color-2
24
23
  $shadow-8dp: 0 8px 10px 1px $shadow-color-1, 0 3px 14px 3px $shadow-color-2, 0 4px 15px 0 $shadow-color-3 !default;
25
24
  $shadow-6dp: 0 6px 10px 0 $shadow-color-1, 0 1px 18px 0 $shadow-color-2, 0 3px 5px 0 $shadow-color-3 !default;
26
25
  $shadow-4dp: 0 2px 4px 0 $shadow-color-1, 0 4px 5px 0 $shadow-color-2, 0 1px 10px 0 $shadow-color-3 !default;
27
- $shadow-3dp: 0 3px 3px 0 $shadow-color-1, 0 3px 4px 0 $shadow-color-2, 0 1px 8px 0 $shadow-color-3 !default;
28
26
  $shadow-2dp: 0 0 4px 0 $shadow-color-1, 0 3px 4px 0 $shadow-color-2, 0 1px 5px 0 $shadow-color-3 !default;
29
27
  $shadow-1dp: 0 0 2px 0 $shadow-color-1, 0 2px 2px 0 $shadow-color-2, 0 1px 3px 0 $shadow-color-3 !default;
30
28
 
@@ -55,10 +53,6 @@ $elevation-shadow-4dp: (
55
53
  elevation: $elevation-4dp,
56
54
  shadow: $shadow-4dp
57
55
  ) !default;
58
- $elevation-shadow-3dp: (
59
- elevation: $elevation-3dp,
60
- shadow: $shadow-3dp
61
- ) !default;
62
56
  $elevation-shadow-2dp: (
63
57
  elevation: $elevation-2dp,
64
58
  shadow: $shadow-2dp
@@ -1,24 +1,15 @@
1
- $grid-columns: 12 !default;
2
- $grid-gutter-width-base: 16px !default;
3
- $grid-gutter-width-desktop: 24px !default;
4
-
5
- $grid-gutter-widths: (
6
- xs: $grid-gutter-width-base,
7
- sm: $grid-gutter-width-base,
8
- md: $grid-gutter-width-desktop,
9
- lg: $grid-gutter-width-desktop,
10
- xl: $grid-gutter-width-desktop
11
- ) !default;
1
+ $grid-columns: 12 !default;
2
+ $grid-gutter-width: 40px !default;
12
3
 
13
4
  // Breakpoint
14
5
  // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints
15
6
 
16
7
  $grid-breakpoints: (
17
8
  xs: 0,
18
- sm: 600px,
19
- md: 960px,
20
- lg: 1280px,
21
- xl: 1920px
9
+ sm: 576px,
10
+ md: 768px,
11
+ lg: 992px,
12
+ xl: 1200px
22
13
  ) !default;
23
14
 
24
15
  @include _assert-ascending($grid-breakpoints, '$grid-breakpoints');
@@ -28,10 +19,10 @@ $grid-breakpoints: (
28
19
  // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints
29
20
 
30
21
  $container-max-widths: (
31
- sm: 600px,
32
- md: 840px,
33
- lg: 1024px,
34
- xl: 1600px
22
+ sm: 540px,
23
+ md: 720px,
24
+ lg: 960px,
25
+ xl: 1140px
35
26
  ) !default;
36
27
 
37
28
  @include _assert-ascending($container-max-widths, '$container-max-widths');
@@ -2,55 +2,54 @@
2
2
  // Change these values to customise colour palettes
3
3
 
4
4
  $primary: (
5
- color: $material-color-purple-500,
6
- darker: $material-color-purple-700,
7
- lighter: $material-color-purple-100
5
+ color: $material-color-purple-500,
6
+ dark: $material-color-purple-700,
7
+ light: $material-color-purple-100
8
8
  ) !default;
9
9
 
10
10
  $secondary: (
11
- color: $material-color-pink-a200,
12
- darker: $material-color-pink-a400,
13
- lighter: $material-color-pink-a100
11
+ color: $material-color-pink-a200,
12
+ dark: $material-color-pink-a400,
13
+ light: $material-color-pink-a100
14
14
  ) !default;
15
15
 
16
16
  $danger: (
17
- color: $material-color-red-500,
18
- darker: $material-color-red-700,
19
- lighter: $material-color-red-100
17
+ color: $material-color-red-500,
18
+ dark: $material-color-red-700,
19
+ light: $material-color-red-100
20
20
  ) !default;
21
21
 
22
22
  $info: (
23
- color: $material-color-blue-500,
24
- darker: $material-color-blue-700,
25
- lighter: $material-color-blue-100
23
+ color: $material-color-blue-500,
24
+ dark: $material-color-blue-700,
25
+ light: $material-color-blue-100
26
26
  ) !default;
27
27
 
28
28
  $success: (
29
- color: $material-color-green-500,
30
- darker: $material-color-green-700,
31
- lighter: $material-color-green-100
29
+ color: $material-color-green-500,
30
+ dark: $material-color-green-700,
31
+ light: $material-color-green-100
32
32
  ) !default;
33
33
 
34
34
  $warning: (
35
- color: $material-color-orange-500,
36
- darker: $material-color-orange-700,
37
- lighter: $material-color-orange-100
35
+ color: $material-color-orange-500,
36
+ dark: $material-color-orange-700,
37
+ light: $material-color-orange-100
38
38
  ) !default;
39
39
 
40
40
  $dark: (
41
- color: $material-color-grey-800,
42
- darker: $material-color-grey-900,
43
- lighter: $material-color-grey-600
41
+ color: $material-color-grey-800,
42
+ dark: $material-color-grey-900,
43
+ light: $material-color-grey-600
44
44
  ) !default;
45
45
 
46
46
  $light: (
47
- color: $material-color-grey-100,
48
- darker: $material-color-grey-300,
49
- lighter: $material-color-grey-050
47
+ color: $material-color-grey-100,
48
+ dark: $material-color-grey-300,
49
+ light: $material-color-grey-050
50
50
  ) !default;
51
51
 
52
52
  $theme-colors: () !default;
53
-
54
53
  $theme-colors: map-merge(
55
54
  (
56
55
  'primary': $primary,
@@ -66,3 +65,5 @@ $theme-colors: map-merge(
66
65
  );
67
66
 
68
67
  $yiq-contrasted-threshold: 150 !default;
68
+ $yiq-text-dark: $black-primary !default;
69
+ $yiq-text-light: $white-primary !default;
@@ -1,14 +1,19 @@
1
1
  $border-color: $black-divider !default;
2
- $border-color-solid: $black-divider-solid !default;
2
+ $border-color-solid: #e1e1e1 !default;
3
3
  $border-radius: 2px !default;
4
4
  $border-width: 1px !default;
5
5
 
6
- $sizes: (
7
- 25: 25%,
8
- 50: 50%,
9
- 75: 75%,
10
- 100: 100%
11
- ) !default;
6
+ $sizes: () !default;
7
+ $sizes: map-merge(
8
+ (
9
+ 25: 25%,
10
+ 50: 50%,
11
+ 75: 75%,
12
+ 100: 100%,
13
+ auto: auto
14
+ ),
15
+ $sizes
16
+ );
12
17
 
13
18
  $spacer: 1rem !default;
14
19
 
@@ -17,17 +22,15 @@ $spacer-sm: ($spacer * 0.5) !default;
17
22
  $spacer-lg: ($spacer * 1.5) !default;
18
23
  $spacer-xl: ($spacer * 3) !default;
19
24
 
20
- $spacers: (
21
- 0: 0,
22
- no: 0,
23
- 1: $spacer-xs,
24
- xs: $spacer-xs,
25
- 2: $spacer-sm,
26
- sm: $spacer-sm,
27
- 3: $spacer,
28
- md: $spacer,
29
- 4: $spacer-lg,
30
- lg: $spacer-lg,
31
- 5: $spacer-xl,
32
- xl: $spacer-xl
33
- ) !default;
25
+ $spacers: () !default;
26
+ $spacers: map-merge(
27
+ (
28
+ 0: 0,
29
+ 1: $spacer-xs,
30
+ 2: $spacer-sm,
31
+ 3: $spacer,
32
+ 4: $spacer-lg,
33
+ 5: $spacer-xl
34
+ ),
35
+ $spacers
36
+ );
@@ -16,7 +16,6 @@ $font-family-serif: 'Roboto Slab', Georgia, 'Times New Roman', Times, serif
16
16
 
17
17
  $font-family-base: $font-family-sans-serif !default;
18
18
 
19
- $font-weight-bold: 700 !default;
20
19
  $font-weight-medium: 500 !default;
21
20
  $font-weight-regular: 400 !default;
22
21
  $font-weight-light: 300 !default;
@@ -83,14 +83,12 @@ $pre-scrollable-max-height: 340px !default;
83
83
  // Form
84
84
 
85
85
  $custom-file-button-icon: 'attachment' !default;
86
- $custom-file-width: 14rem !default;
87
- $custom-file-text: (en: 'Choose file...') !default;
88
86
 
89
87
  $form-check-inline-margin-x: $spacer-sm !default;
90
- $form-check-input-margin-x: $spacer-xs !default;
88
+ $form-check-input-gutter: 1.25rem !default;
91
89
 
92
- $form-feedback-invalid-color: map-get(theme-color(danger), color) !default;
93
- $form-feedback-valid-color: map-get(theme-color(success), color) !default;
90
+ $form-feedback-invalid-color: theme-color(danger) !default;
91
+ $form-feedback-valid-color: theme-color(success) !default;
94
92
 
95
93
  $form-group-margin-y: $spacer !default;
96
94
 
@@ -107,14 +105,14 @@ $jumbotron-padding-y: 3rem !default;
107
105
 
108
106
  // Link
109
107
 
110
- $link-color: map-get(theme-color(primary), color) !default;
111
- $link-color-hover: map-get(theme-color(primary), darker) !default;
108
+ $link-color: theme-color(primary) !default;
109
+ $link-color-hover: theme-color(primary) !default;
112
110
  $link-decoration: none !default;
113
111
  $link-decoration-hover: underline !default;
114
112
 
115
113
  // Misc
116
114
 
117
- $blockquote-border-color: map-get(theme-color(primary), color) !default;
115
+ $blockquote-border-color: theme-color(primary) !default;
118
116
  $blockquote-border-width: 0.3125rem !default;
119
117
  $blockquote-small-color: $black-hint !default;
120
118
 
@@ -157,7 +155,7 @@ $nav-link-padding-y: 0.5rem !default;
157
155
  $nav-pills-bg-hover: $black-divider !default;
158
156
  $nav-pills-border-radius: $border-radius !default;
159
157
  $nav-pills-color: $black-primary !default;
160
- $nav-pills-color-active: map-get(theme-color(secondary), color) !default;
158
+ $nav-pills-color-active: theme-color(secondary) !default;
161
159
  $nav-pills-link-opacity: 0.7 !default;
162
160
 
163
161
  // Pagination