material-sass 4.0.0.alpha6 → 4.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +36 -8
  4. data/Rakefile +16 -3
  5. data/app/assets/javascripts/material-sprockets.js +6 -1
  6. data/app/assets/javascripts/material.js +654 -417
  7. data/app/assets/javascripts/material.min.js +1 -0
  8. data/app/assets/javascripts/material/addons/picker.date.js +234 -0
  9. data/app/assets/javascripts/material/addons/picker.js +172 -0
  10. data/app/assets/javascripts/material/addons/textarea-autosize.js +20 -2
  11. data/app/assets/javascripts/material/addons/waves.js +127 -0
  12. data/app/assets/javascripts/material/components/floating-label.js +92 -0
  13. data/app/assets/javascripts/material/components/navdrawer.js +353 -0
  14. data/app/assets/javascripts/material/components/selection-control-focus.js +47 -0
  15. data/app/assets/javascripts/material/components/tab-switch.js +148 -0
  16. data/app/assets/javascripts/material/components/util.js +133 -0
  17. data/app/assets/javascripts/material/initializers/picker.js +171 -0
  18. data/app/assets/javascripts/material/initializers/textarea-autosize.js +10 -0
  19. data/app/assets/javascripts/material/initializers/waves.js +13 -0
  20. data/app/assets/stylesheets/material/_colours.scss +324 -0
  21. data/app/assets/stylesheets/material/_functions.scss +65 -0
  22. data/app/assets/stylesheets/material/_mixins.scss +23 -23
  23. data/app/assets/stylesheets/material/_print.scss +102 -0
  24. data/app/assets/stylesheets/material/_utilities.scss +21 -17
  25. data/app/assets/stylesheets/material/_variables.scss +13 -42
  26. data/app/assets/stylesheets/material/base/_base.scss +420 -5
  27. data/app/assets/stylesheets/material/base/_grid.scss +34 -33
  28. data/app/assets/stylesheets/material/base/_typography.scss +165 -174
  29. data/app/assets/stylesheets/material/bootstrap/_alert.scss +32 -39
  30. data/app/assets/stylesheets/material/bootstrap/_badge.scss +34 -0
  31. data/app/assets/stylesheets/material/bootstrap/_breadcrumb.scss +18 -18
  32. data/app/assets/stylesheets/material/bootstrap/_carousel.scss +127 -142
  33. data/app/assets/stylesheets/material/bootstrap/_close.scss +18 -19
  34. data/app/assets/stylesheets/material/bootstrap/_code.scss +10 -7
  35. data/app/assets/stylesheets/material/bootstrap/_custom-form.scss +50 -56
  36. data/app/assets/stylesheets/material/bootstrap/_form.scss +159 -129
  37. data/app/assets/stylesheets/material/bootstrap/_image.scss +19 -16
  38. data/app/assets/stylesheets/material/bootstrap/_jumbotron.scss +10 -7
  39. data/app/assets/stylesheets/material/bootstrap/_nav.scss +71 -69
  40. data/app/assets/stylesheets/material/bootstrap/_pagination.scss +34 -26
  41. data/app/assets/stylesheets/material/bootstrap/_popover.scss +26 -59
  42. data/app/assets/stylesheets/material/bootstrap/_responsive-embed.scss +4 -4
  43. data/app/assets/stylesheets/material/bootstrap/_transition.scss +10 -8
  44. data/app/assets/stylesheets/material/material.scss +75 -62
  45. data/app/assets/stylesheets/material/material/_button-flat.scss +26 -39
  46. data/app/assets/stylesheets/material/material/_button-float.scss +10 -14
  47. data/app/assets/stylesheets/material/material/_button-group.scss +268 -0
  48. data/app/assets/stylesheets/material/material/_button.scss +133 -189
  49. data/app/assets/stylesheets/material/material/_card.scss +300 -248
  50. data/app/assets/stylesheets/material/material/_chip.scss +65 -64
  51. data/app/assets/stylesheets/material/material/_data-table.scss +135 -45
  52. data/app/assets/stylesheets/material/material/_dialog.scss +141 -110
  53. data/app/assets/stylesheets/material/material/_expansion-panel.scss +86 -119
  54. data/app/assets/stylesheets/material/material/_menu.scss +308 -228
  55. data/app/assets/stylesheets/material/material/_navdrawer.scss +239 -234
  56. data/app/assets/stylesheets/material/material/_picker.scss +157 -155
  57. data/app/assets/stylesheets/material/material/_progress-circular.scss +80 -80
  58. data/app/assets/stylesheets/material/material/_progress.scss +180 -115
  59. data/app/assets/stylesheets/material/material/_selection-control.scss +132 -139
  60. data/app/assets/stylesheets/material/material/_stepper.scss +94 -93
  61. data/app/assets/stylesheets/material/material/_tab.scss +74 -93
  62. data/app/assets/stylesheets/material/material/_text-field-floating-label.scss +29 -20
  63. data/app/assets/stylesheets/material/material/_text-field-input-group.scss +94 -24
  64. data/app/assets/stylesheets/material/material/_text-field-textarea.scss +13 -26
  65. data/app/assets/stylesheets/material/material/_text-field.scss +127 -118
  66. data/app/assets/stylesheets/material/material/_toolbar.scss +308 -313
  67. data/app/assets/stylesheets/material/material/_tooltip.scss +23 -62
  68. data/app/assets/stylesheets/material/mixins/_background-variant.scss +6 -6
  69. data/app/assets/stylesheets/material/mixins/_border-radius.scss +17 -17
  70. data/app/assets/stylesheets/material/mixins/_breakpoint.scss +32 -2
  71. data/app/assets/stylesheets/material/mixins/_clearfix.scss +1 -1
  72. data/app/assets/stylesheets/material/mixins/_form.scss +62 -25
  73. data/app/assets/stylesheets/material/mixins/_grid-framework.scss +8 -16
  74. data/app/assets/stylesheets/material/mixins/_grid.scss +40 -64
  75. data/app/assets/stylesheets/material/mixins/_material-icons.scss +36 -0
  76. data/app/assets/stylesheets/material/mixins/_nav-divider.scss +1 -1
  77. data/app/assets/stylesheets/material/mixins/_reset-text.scss +2 -21
  78. data/app/assets/stylesheets/material/mixins/_screenreader.scss +14 -12
  79. data/app/assets/stylesheets/material/mixins/_text-alignment.scss +23 -0
  80. data/app/assets/stylesheets/material/mixins/_text-emphasis.scss +6 -6
  81. data/app/assets/stylesheets/material/mixins/_transition.scss +42 -10
  82. data/app/assets/stylesheets/material/utilities/_background.scss +18 -18
  83. data/app/assets/stylesheets/material/utilities/_border.scss +88 -41
  84. data/app/assets/stylesheets/material/utilities/_display.scss +63 -30
  85. data/app/assets/stylesheets/material/utilities/_flex.scss +139 -134
  86. data/app/assets/stylesheets/material/utilities/_material-icons.scss +3 -5
  87. data/app/assets/stylesheets/material/utilities/_position.scss +19 -22
  88. data/app/assets/stylesheets/material/utilities/_sizing.scss +11 -12
  89. data/app/assets/stylesheets/material/utilities/_spacing.scss +51 -56
  90. data/app/assets/stylesheets/material/utilities/_text.scss +80 -75
  91. data/app/assets/stylesheets/material/utilities/_visibility.scss +5 -46
  92. data/app/assets/stylesheets/material/utilities/_waves.scss +11 -18
  93. data/app/assets/stylesheets/material/variables/_elevation-shadow.scss +89 -82
  94. data/app/assets/stylesheets/material/variables/_grid.scss +29 -26
  95. data/app/assets/stylesheets/material/variables/_palette.scss +45 -0
  96. data/app/assets/stylesheets/material/variables/_spacer.scss +34 -88
  97. data/app/assets/stylesheets/material/variables/_transition.scss +29 -0
  98. data/app/assets/stylesheets/material/variables/_typography.scss +88 -74
  99. data/app/assets/stylesheets/material/variables/_variable-bootstrap.scss +196 -133
  100. data/app/assets/stylesheets/material/variables/_variable-material.scss +481 -429
  101. data/lib/material-sass/version.rb +1 -1
  102. data/material-sass.gemspec +3 -3
  103. metadata +26 -21
  104. data/app/assets/javascripts/material/addons-materialise/pickadate.js +0 -139
  105. data/app/assets/javascripts/material/addons-materialise/textarea-autosize.js +0 -11
  106. data/app/assets/javascripts/material/addons-materialise/wave.js +0 -15
  107. data/app/assets/javascripts/material/addons/pickadate.js +0 -7
  108. data/app/assets/javascripts/material/addons/wave.js +0 -5
  109. data/app/assets/javascripts/material/src/floating-label.js +0 -91
  110. data/app/assets/javascripts/material/src/navdrawer.js +0 -352
  111. data/app/assets/javascripts/material/src/tab-switch.js +0 -133
  112. data/app/assets/javascripts/material/src/util.js +0 -138
  113. data/app/assets/stylesheets/material/base/_normalize.scss +0 -253
  114. data/app/assets/stylesheets/material/base/_reboot.scss +0 -239
  115. data/app/assets/stylesheets/material/bootstrap/_button-group.scss +0 -134
  116. data/app/assets/stylesheets/material/mixins/_tab-focus.scss +0 -5
  117. data/app/assets/stylesheets/material/mixins/_transform.scss +0 -9
  118. data/app/assets/stylesheets/material/variables/_animation.scss +0 -22
  119. data/app/assets/stylesheets/material/variables/_colour.scss +0 -389
@@ -0,0 +1,36 @@
1
+ @mixin reset-material-icons {
2
+ font-size: ($material-icon-size / $font-size-base * 1em);
3
+ line-height: ($font-size-base / $material-icon-size * 1em);
4
+
5
+ // The below value is calculated using the technique illustrated in:
6
+ // https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align
7
+ // Font metrics used in the calculation are from Roboro Regular:
8
+ // https://github.com/google/fonts/blob/master/apache/roboto/Roboto-Regular.ttf
9
+
10
+ $roboto-fm-ascender: 1946 !default;
11
+ $roboto-fm-capital-height: 1456 !default;
12
+ $roboto-fm-descender: 512 !default;
13
+
14
+ $roboto-capital-height: (strip-unit($font-size-base) * strip-unit($font-size-root) * strip-unit($line-height-base)) !default;
15
+ $roboto-computed-font-size: ($roboto-capital-height / $roboto-fm-capital-height) !default;
16
+ $roboto-distance-bottom: $roboto-fm-descender !default;
17
+ $roboto-distance-top: ($roboto-fm-ascender - $roboto-fm-capital-height) !default;
18
+
19
+ vertical-align: (($roboto-distance-bottom - $roboto-distance-top) * $roboto-computed-font-size * -1em);
20
+ }
21
+
22
+ @mixin set-material-icons {
23
+ @include reset-material-icons;
24
+
25
+ font-family: 'Material Icons';
26
+ font-feature-settings: 'liga';
27
+ font-style: normal;
28
+ font-weight: normal;
29
+ letter-spacing: normal;
30
+ text-rendering: optimizeLegibility;
31
+ text-transform: none;
32
+ white-space: nowrap;
33
+ word-wrap: normal;
34
+ -moz-osx-font-smoothing: grayscale;
35
+ -webkit-font-smoothing: antialiased;
36
+ }
@@ -1,6 +1,6 @@
1
1
  @mixin nav-divider($bg: $black-divider) {
2
2
  background-color: $bg;
3
3
  height: 1px;
4
- margin: $spacer-sm-y 0;
4
+ margin: $spacer-sm 0;
5
5
  overflow: hidden;
6
6
  }
@@ -1,12 +1,12 @@
1
1
  @mixin reset-text {
2
+ @include text-align(left);
3
+
2
4
  font-family: $font-family-base;
3
5
  font-style: normal;
4
6
  font-weight: normal;
5
7
  letter-spacing: normal;
6
8
  line-break: auto;
7
9
  line-height: $line-height-base;
8
- text-align: left;
9
- text-align: start;
10
10
  text-decoration: none;
11
11
  text-shadow: none;
12
12
  text-transform: none;
@@ -14,22 +14,3 @@
14
14
  word-break: normal;
15
15
  word-spacing: normal;
16
16
  }
17
-
18
- @mixin reset-to-material-icons($base: $font-size-base) {
19
- direction: ltr;
20
- display: inline-block;
21
- font-family: "Material Icons";
22
- font-feature-settings: "liga";
23
- font-size: #{($material-icon-size / $font-size-root) / strip-unit($base)}em;
24
- font-style: normal;
25
- font-weight: normal;
26
- letter-spacing: normal;
27
- line-height: #{strip-unit($base) / (($material-icon-size / $font-size-root) / strip-unit($base))}em;;
28
- text-rendering: optimizeLegibility;
29
- text-transform: none;
30
- vertical-align: middle;
31
- white-space: nowrap;
32
- word-wrap: normal;
33
- -webkit-font-smoothing: antialiased;
34
- -moz-osx-font-smoothing: grayscale;
35
- }
@@ -1,23 +1,25 @@
1
1
  @mixin sr-only {
2
2
  border: 0;
3
- clip: rect(0,0,0,0);
3
+ clip: rect(0, 0, 0, 0);
4
+ clip-path: inset(50%);
4
5
  height: 1px;
5
- margin: -1px;
6
6
  padding: 0;
7
7
  overflow: hidden;
8
8
  position: absolute;
9
+ white-space: nowrap;
9
10
  width: 1px;
10
11
  }
11
12
 
12
13
  @mixin sr-only-focusable {
13
- // active, focus, hover
14
- &:active,
15
- &:focus {
16
- clip: auto;
17
- height: auto;
18
- margin: 0;
19
- overflow: visible;
20
- position: static;
21
- width: auto;
22
- }
14
+ // Active, focus, hover
15
+ &:active,
16
+ &:focus {
17
+ clip: auto;
18
+ clip-path: none;
19
+ height: auto;
20
+ overflow: visible;
21
+ position: static;
22
+ white-space: normal;
23
+ width: auto;
24
+ }
23
25
  }
@@ -0,0 +1,23 @@
1
+ @mixin text-align($direction: 'left') {
2
+ // scss-lint:disable DuplicateProperty
3
+ @if $direction == 'left' {
4
+ text-align: left;
5
+ text-align: start;
6
+
7
+ [dir='rtl'] & {
8
+ text-align: right;
9
+ text-align: start;
10
+ }
11
+ }
12
+
13
+ @if $direction == 'right' {
14
+ text-align: right;
15
+ text-align: end;
16
+
17
+ [dir='rtl'] & {
18
+ text-align: left;
19
+ text-align: end;
20
+ }
21
+ }
22
+ // scss-lint:enable DuplicateProperty
23
+ }
@@ -1,14 +1,14 @@
1
- @mixin text-emphasis-variant($class, $color, $color-dark: "") {
1
+ @mixin text-emphasis-variant($class, $color, $color-dark: '') {
2
2
  #{$class} {
3
3
  color: $color !important;
4
4
  }
5
5
 
6
- @if $color-dark != "" {
6
+ @if $color-dark != '' {
7
7
  a#{$class} {
8
- // active, focus, hover
9
- @include active-focus-hover {
10
- color: $color-dark !important;
11
- }
8
+ // Active, focus, hover
9
+ @include active-focus-hover {
10
+ color: $color-dark !important;
11
+ }
12
12
  }
13
13
  }
14
14
  }
@@ -1,47 +1,61 @@
1
+ // Acceleration curve: permanently leaving the screen
2
+
1
3
  @mixin transition-acceleration($property...) {
2
- transition-duration: $transition-duration-sm;
4
+ transition-duration: $transition-duration-mobile-leaving;
3
5
  transition-property: $property;
4
6
  transition-timing-function: $transition-timing-function-acceleration;
5
7
 
6
8
  @include media-breakpoint-up(sm) {
7
- transition-duration: $transition-duration-tablet-sm;
9
+ transition-duration: $transition-duration-tablet-leaving;
8
10
  }
9
11
 
10
12
  @include media-breakpoint-up(lg) {
11
- transition-duration: $transition-duration-desktop-sm;
13
+ transition-duration: $transition-duration-desktop-leaving;
12
14
  }
13
15
  }
14
16
 
17
+
18
+
19
+ // Deceleration curve: entering the screen
20
+
15
21
  @mixin transition-deceleration($property...) {
16
- transition-duration: $transition-duration-lg;
22
+ transition-duration: $transition-duration-mobile-entering;
17
23
  transition-property: $property;
18
24
  transition-timing-function: $transition-timing-function-deceleration;
19
25
 
20
26
  @include media-breakpoint-up(sm) {
21
- transition-duration: $transition-duration-tablet-lg;
27
+ transition-duration: $transition-duration-tablet-entering;
22
28
  }
23
29
 
24
30
  @include media-breakpoint-up(lg) {
25
- transition-duration: $transition-duration-desktop-lg;
31
+ transition-duration: $transition-duration-desktop-entering;
26
32
  }
27
33
  }
28
34
 
35
+
36
+
37
+ // Sharp curve: temporarily leaving the screen
38
+
29
39
  @mixin transition-sharp($property...) {
30
- transition-duration: $transition-duration-sm;
40
+ transition-duration: $transition-duration-mobile-leaving;
31
41
  transition-property: $property;
32
42
  transition-timing-function: $transition-timing-function-sharp;
33
43
 
34
44
  @include media-breakpoint-up(sm) {
35
- transition-duration: $transition-duration-tablet-sm;
45
+ transition-duration: $transition-duration-tablet-leaving;
36
46
  }
37
47
 
38
48
  @include media-breakpoint-up(lg) {
39
- transition-duration: $transition-duration-desktop-sm;
49
+ transition-duration: $transition-duration-desktop-leaving;
40
50
  }
41
51
  }
42
52
 
53
+
54
+
55
+ // Standard curve: relative movement
56
+
43
57
  @mixin transition-standard($property...) {
44
- transition-duration: $transition-duration;
58
+ transition-duration: $transition-duration-mobile;
45
59
  transition-property: $property;
46
60
  transition-timing-function: $transition-timing-function-standard;
47
61
 
@@ -53,3 +67,21 @@
53
67
  transition-duration: $transition-duration-desktop;
54
68
  }
55
69
  }
70
+
71
+
72
+
73
+ // Standard curve: relative movement - complex, full-screen, large transitions
74
+
75
+ @mixin transition-standard-complex($property...) {
76
+ transition-duration: $transition-duration-mobile-complex;
77
+ transition-property: $property;
78
+ transition-timing-function: $transition-timing-function-standard;
79
+
80
+ @include media-breakpoint-up(sm) {
81
+ transition-duration: $transition-duration-tablet-complex;
82
+ }
83
+
84
+ @include media-breakpoint-up(lg) {
85
+ transition-duration: $transition-duration-desktop-complex;
86
+ }
87
+ }
@@ -1,23 +1,23 @@
1
- // dark and light theme
2
- // based on https://material.google.com/style/color.html#color-themes
3
- @include bg-variant('.bg-dark-1', $dark-theme-1);
4
- @include bg-variant('.bg-dark-2', $dark-theme-2);
5
- @include bg-variant('.bg-dark-3', $dark-theme-3);
6
- @include bg-variant('.bg-dark-4', $dark-theme-4);
1
+ // Dark and light theme
2
+ // Based on https://material.google.com/style/color.html#color-themes
7
3
 
8
- @include bg-variant('.bg-light-1', $light-theme-1);
9
- @include bg-variant('.bg-light-2', $light-theme-2);
10
- @include bg-variant('.bg-light-3', $light-theme-3);
11
- @include bg-variant('.bg-light-4', $light-theme-4);
4
+ @include bg-variant('.bg-dark-1', $dark-theme-1);
5
+ @include bg-variant('.bg-dark-2', $dark-theme-2);
6
+ @include bg-variant('.bg-dark-3', $dark-theme-3);
7
+ @include bg-variant('.bg-dark-4', $dark-theme-4);
12
8
 
13
- // offwhite
14
- @include bg-variant('.bg-faded', $offwhite, $offwhite-dark);
9
+ @include bg-variant('.bg-light-1', $light-theme-1);
10
+ @include bg-variant('.bg-light-2', $light-theme-2);
11
+ @include bg-variant('.bg-light-3', $light-theme-3);
12
+ @include bg-variant('.bg-light-4', $light-theme-4);
15
13
 
16
- // palette
17
- @each $color in $palettes {
18
- $i: index($palettes, $color);
14
+ @include bg-variant('.bg-transparent', transparent);
15
+ @include bg-variant('.bg-white', $white);
19
16
 
20
- @include bg-variant('.bg-#{$color}', nth($palettes-color, $i), nth($palettes-color-dark, $i));
21
- }
22
17
 
23
- @include bg-variant('.bg-inverse', $dark-theme-4, $dark-theme-3);
18
+
19
+ // Palette
20
+
21
+ @each $color, $values in $theme-colors {
22
+ @include bg-variant('.bg-#{$color}', map-get(theme-color($color), color), map-get(theme-color($color), darker));
23
+ }
@@ -1,53 +1,100 @@
1
- //
2
- // border
3
- //
4
- .border-0 {
5
- border: 0 !important;
6
- }
1
+ // Border
7
2
 
8
- .border-top-0 {
9
- border-top: 0 !important;
10
- }
3
+ .border-0 {
4
+ border: 0 !important;
5
+ }
11
6
 
12
- .border-right-0 {
13
- border-right: 0 !important;
14
- }
7
+ .border-top-0 {
8
+ border-top: 0 !important;
9
+ }
15
10
 
16
- .border-bottom-0 {
17
- border-bottom: 0 !important;
18
- }
11
+ .border-right-0 {
12
+ border-right: 0 !important;
13
+ }
19
14
 
20
- .border-left-0 {
21
- border-left: 0 !important;
22
- }
15
+ .border-bottom-0 {
16
+ border-bottom: 0 !important;
17
+ }
23
18
 
24
- //
25
- // border radius
26
- //
27
- .rounded {
28
- @include border-radius($border-radius);
29
- }
19
+ .border-left-0 {
20
+ border-left: 0 !important;
21
+ }
30
22
 
31
- .rounded-0 {
32
- border-radius: 0;
33
- }
23
+ // Colour
24
+ .border-black {
25
+ border-color: $black !important;
26
+ }
34
27
 
35
- .rounded-circle {
36
- border-radius: 50%;
37
- }
28
+ .border-black-primary {
29
+ border-color: $black-primary !important;
30
+ }
38
31
 
39
- .rounded-top {
40
- @include border-top-radius($border-radius);
41
- }
32
+ .border-black-secondary {
33
+ border-color: $black-secondary !important;
34
+ }
42
35
 
43
- .rounded-right {
44
- @include border-right-radius($border-radius);
45
- }
36
+ .border-black-hint {
37
+ border-color: $black-hint !important;
38
+ }
46
39
 
47
- .rounded-bottom {
48
- @include border-bottom-radius($border-radius);
49
- }
40
+ .border-black-divider {
41
+ border-color: $black-divider !important;
42
+ }
43
+
44
+ .border-white {
45
+ border-color: $white !important;
46
+ }
47
+
48
+ .border-white-primary {
49
+ border-color: $white-primary !important;
50
+ }
50
51
 
51
- .rounded-left {
52
- @include border-left-radius($border-radius);
52
+ .border-white-secondary {
53
+ border-color: $white-secondary !important;
54
+ }
55
+
56
+ .border-white-hint {
57
+ border-color: $white-hint !important;
58
+ }
59
+
60
+ .border-white-divider {
61
+ border-color: $white-divider !important;
62
+ }
63
+
64
+ @each $color, $values in $theme-colors {
65
+ .border-#{$color} {
66
+ border-color: map-get(theme-color($color), color) !important;
53
67
  }
68
+ }
69
+
70
+
71
+
72
+ // Border radius
73
+
74
+ .rounded {
75
+ @include border-radius($border-radius);
76
+ }
77
+
78
+ .rounded-0 {
79
+ border-radius: 0;
80
+ }
81
+
82
+ .rounded-circle {
83
+ border-radius: 50%;
84
+ }
85
+
86
+ .rounded-top {
87
+ @include border-top-radius($border-radius);
88
+ }
89
+
90
+ .rounded-right {
91
+ @include border-right-radius($border-radius);
92
+ }
93
+
94
+ .rounded-bottom {
95
+ @include border-bottom-radius($border-radius);
96
+ }
97
+
98
+ .rounded-left {
99
+ @include border-left-radius($border-radius);
100
+ }