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,34 @@
1
+ .badge {
2
+ @include border-radius($badge-border-radius);
3
+
4
+ background-color: $badge-bg;
5
+ color: $badge-color;
6
+ display: inline-block;
7
+ font-size: inherit;
8
+ font-weight: $badge-font-weight;
9
+ line-height: inherit;
10
+ padding: $badge-padding-y $badge-padding-x;
11
+ text-align: center;
12
+ vertical-align: baseline;
13
+ white-space: nowrap;
14
+
15
+ &:empty {
16
+ display: none;
17
+ }
18
+
19
+ .btn & {
20
+ margin-top: -1px;
21
+ margin-bottom: -1px;
22
+ padding-top: 1px;
23
+ padding-bottom: 1px;
24
+ }
25
+ }
26
+
27
+ // Colour
28
+ @each $color, $values in $theme-colors {
29
+ .badge-#{$color} {
30
+ @include color-yiq(map-get(theme-color($color), color));
31
+
32
+ background-color: map-get(theme-color($color), color);
33
+ }
34
+ }
@@ -1,30 +1,31 @@
1
1
  .breadcrumb {
2
+ @include border-radius($breadcrumb-border-radius);
3
+
2
4
  align-items: center;
3
5
  background-color: $breadcrumb-bg;
4
6
  display: flex;
5
7
  flex-wrap: wrap;
6
8
  list-style: none;
9
+ margin-bottom: $breadcrumb-margin-y;
7
10
  min-height: $breadcrumb-height;
8
- margin-bottom: $breadcrumb-margin-bottom;
9
11
  padding: $breadcrumb-padding-y $breadcrumb-padding-x;
10
- @include clearfix;
11
12
  }
12
13
 
13
14
  .breadcrumb-item {
15
+ @include transition-standard(color);
16
+
14
17
  align-items: center;
15
18
  color: $breadcrumb-item-color;
16
19
  display: flex;
17
- @include transition-standard(color);
18
20
 
19
- // active, focus, hover
20
- @include active-focus-hover {
21
- color: $breadcrumb-item-color-active;
22
- }
21
+ @include active-focus-hover {
22
+ color: $breadcrumb-item-color-hover;
23
+ }
23
24
 
24
- &.active {
25
- color: $breadcrumb-item-color-active;
26
- font-weight: bolder;
27
- }
25
+ &.active {
26
+ color: $breadcrumb-item-color-hover;
27
+ font-weight: bolder;
28
+ }
28
29
 
29
30
  a {
30
31
  color: inherit;
@@ -32,13 +33,12 @@
32
33
  }
33
34
 
34
35
  + .breadcrumb-item::before {
35
- background-image: $breadcrumb-divider;
36
- background-position: 50% 50%;
37
- background-repeat: no-repeat;
38
- background-size: ($material-icon-size / $font-size-root * 1rem) ($material-icon-size / $font-size-root * 1rem);
39
- content: "";
36
+ @include set-material-icons;
37
+
38
+ color: $breadcrumb-item-color;
39
+ content: $breadcrumb-item-icon;
40
40
  display: inline-block;
41
- height: ($material-icon-size / $font-size-root * 1rem);
42
- width: ($breadcrumb-item-padding * 2 + $material-icon-size / $font-size-root * 1rem);
41
+ margin-right: $breadcrumb-inner-spacer-x;
42
+ margin-left: $breadcrumb-inner-spacer-x;
43
43
  }
44
44
  }
@@ -1,5 +1,12 @@
1
1
  .carousel {
2
2
  position: relative;
3
+
4
+ @include hover {
5
+ .carousel-control-next,
6
+ .carousel-control-prev {
7
+ opacity: 1;
8
+ }
9
+ }
3
10
  }
4
11
 
5
12
  .carousel-inner {
@@ -9,15 +16,14 @@
9
16
  }
10
17
 
11
18
  .carousel-item {
19
+ @include transition-standard-complex(transform);
20
+
21
+ align-items: center;
22
+ backface-visibility: hidden;
12
23
  display: none;
24
+ perspective: 1000px;
13
25
  position: relative;
14
26
  width: 100%;
15
-
16
- @include if-supports-3d-transforms() {
17
- backface-visibility: hidden;
18
- perspective: 1000px;
19
- @include transition-standard(transform);
20
- }
21
27
  }
22
28
 
23
29
  .carousel-item.active,
@@ -26,164 +32,143 @@
26
32
  display: flex;
27
33
  }
28
34
 
29
- .carousel-item-next,
35
+ .carousel-item-left.active,
30
36
  .carousel-item-prev {
31
- position: absolute;
32
- top: 0;
37
+ transform: translateX(-100%);
38
+
39
+ @supports (transform-style: preserve-3d) {
40
+ transform: translate3d(-100%, 0, 0);
41
+ }
33
42
  }
34
43
 
35
- @include if-supports-3d-transforms() {
36
- .carousel-item-next.carousel-item-left,
37
- .carousel-item-prev.carousel-item-right {
44
+ .carousel-item-left.carousel-item-next,
45
+ .carousel-item-prev.carousel-item-right {
46
+ transform: translateX(0);
47
+
48
+ @supports (transform-style: preserve-3d) {
38
49
  transform: translate3d(0, 0, 0);
39
50
  }
51
+ }
40
52
 
41
- .carousel-item-next,
42
- .active.carousel-item-right {
53
+ .carousel-item-next,
54
+ .carousel-item-right.active {
55
+ transform: translateX(100%);
56
+
57
+ @supports (transform-style: preserve-3d) {
43
58
  transform: translate3d(100%, 0, 0);
44
59
  }
60
+ }
45
61
 
46
- .carousel-item-prev,
47
- .active.carousel-item-left {
48
- transform: translate3d(-100%, 0, 0);
49
- }
62
+ .carousel-item-next,
63
+ .carousel-item-prev {
64
+ position: absolute;
65
+ top: 0;
50
66
  }
51
67
 
52
- //
53
- // left/right controls
54
- //
55
- .carousel-control-next,
56
- .carousel-control-prev {
57
- background-color: $btn-bg;
58
- border-radius: 50%;
59
- box-shadow: map-get($btn-float-elevation-shadow, shadow);
60
- color: $btn-color;
61
- display: block;
62
- font-size: $btn-font-size;
63
- font-weight: $btn-font-weight;
64
- height: $btn-float-size-sm;
65
- line-height: $btn-float-size-sm;
66
- margin-top: ($btn-float-size-sm / -2);
67
- opacity: 0;
68
- position: absolute;
69
- top: 50%;
70
- text-align: center;
71
- text-transform: uppercase;
72
- user-select: none;
73
- vertical-align: middle;
74
- white-space: nowrap;
75
- width: $btn-float-size-sm;
76
-
77
- // active, focus, hover
78
- @include active-focus-hover {
79
- background-color: $btn-bg-active;
80
- color: $btn-color;
81
- text-decoration: none;
82
- }
83
-
84
- &:active {
85
- box-shadow: map-get($btn-elevation-shadow-active, shadow);
86
- }
87
-
88
- &:focus {
89
- outline: 0;
90
- }
91
- }
92
68
 
93
- // active, focus, hover
94
- .carousel {
95
- @include hover {
96
- .carousel-control-next,
97
- .carousel-control-prev {
98
- opacity: 1;
99
- }
100
- }
101
- }
102
69
 
103
- .carousel-control-next {
104
- // position
105
- right: ($btn-float-size-sm / 2);
70
+ // Left/right controls
71
+
72
+ .carousel-control-next,
73
+ .carousel-control-prev {
74
+ align-items: center;
75
+ background-color: $carousel-control-bg;
76
+ border-radius: 50%;
77
+ box-shadow: map-get($carousel-control-elevation-shadow, shadow);
78
+ color: $carousel-control-color;
79
+ display: flex;
80
+ font-size: $carousel-control-font-size;
81
+ height: $carousel-control-size;
82
+ justify-content: center;
83
+ line-height: 1;
84
+ margin-top: ($carousel-control-size / -2);
85
+ opacity: 0;
86
+ position: absolute;
87
+ top: 50%;
88
+ user-select: none;
89
+ width: $carousel-control-size;
90
+
91
+ @include active-focus-hover {
92
+ background-color: $carousel-control-bg-hover;
93
+ color: $carousel-control-color;
94
+ text-decoration: none;
106
95
  }
107
96
 
108
- .carousel-control-prev {
109
- // position
110
- left: ($btn-float-size-sm / 2);
97
+ &:active {
98
+ box-shadow: map-get($carousel-control-elevation-shadow-active, shadow);
111
99
  }
112
100
 
113
- .carousel-control-next-icon,
114
- .carousel-control-prev-icon {
115
- background-color: transparent;
116
- background-position: 50% 50%;
117
- background-repeat: no-repeat;
118
- background-size: $material-icon-size $material-icon-size;
119
- display: block;
120
- height: $btn-float-size-sm;
121
- opacity: $carousel-control-icon-opacity;
122
- width: $btn-float-size-sm;
101
+ &:focus {
102
+ outline: 0;
123
103
  }
104
+ }
124
105
 
125
- // active, focus, hover
126
- .carousel-control-next,
127
- .carousel-control-prev {
128
- @include active-focus-hover {
129
- .carousel-control-next-icon,
130
- .carousel-control-prev-icon {
131
- opacity: 1;
132
- }
133
- }
134
- }
106
+ .carousel-control-next {
107
+ right: ($carousel-control-size / 2);
108
+ }
135
109
 
136
- .carousel-control-next-icon {
137
- background-image: $carousel-control-next-icon-bg;
138
- }
110
+ .carousel-control-prev {
111
+ left: ($carousel-control-size / 2);
112
+ }
139
113
 
140
- .carousel-control-prev-icon {
141
- background-image: $carousel-control-prev-icon-bg;
142
- }
114
+ .carousel-control-next-icon,
115
+ .carousel-control-prev-icon {
116
+ @include set-material-icons;
117
+ }
143
118
 
144
- //
145
- // optional captions
146
- //
147
- .carousel-caption {
148
- color: $carousel-caption-color;
149
- position: absolute;
150
- right: ((100% - $carousel-caption-width) / 2);
151
- bottom: ($carousel-indicator-size * 3);
152
- left: ((100% - $carousel-caption-width) / 2);
153
- text-align: center;
154
- z-index: 1;
155
- }
119
+ .carousel-control-next-icon::before {
120
+ content: $carousel-control-next-icon;
121
+ }
156
122
 
157
- //
158
- // optional indicators
159
- //
160
- .carousel-indicators {
161
- display: flex;
162
- justify-content: center;
163
- list-style: none;
164
- margin-bottom: 0;
165
- padding-left: 0;
166
- position: absolute;
167
- right: ($btn-float-size-sm * 2);
168
- bottom: $carousel-indicator-size;
169
- left: ($btn-float-size-sm * 2);
170
- z-index: 1;
171
-
172
- li {
173
- background-color: rgba(0, 0, 0, 0);
174
- border: 1px solid $carousel-indicator-color;
175
- border-radius: $carousel-indicator-size;
176
- cursor: pointer;
177
- flex: 0 0 auto;
178
- height: $carousel-indicator-size;
179
- margin-right: 1px;
180
- margin-left: 1px;
181
- overflow: hidden;
182
- text-indent: 100%;
183
- width: $carousel-indicator-size;
184
- }
123
+ .carousel-control-prev-icon::before {
124
+ content: $carousel-control-prev-icon;
125
+ }
185
126
 
186
- .active {
187
- background-color: $carousel-indicator-color;
188
- }
127
+
128
+
129
+ // Optional captions
130
+
131
+ .carousel-caption {
132
+ color: $carousel-caption-color;
133
+ position: absolute;
134
+ right: ((100% - $carousel-caption-width) / 2);
135
+ bottom: ($carousel-indicator-size * 3);
136
+ left: ((100% - $carousel-caption-width) / 2);
137
+ text-align: center;
138
+ z-index: 1;
139
+ }
140
+
141
+
142
+
143
+ // Optional indicators
144
+
145
+ .carousel-indicators {
146
+ display: flex;
147
+ justify-content: center;
148
+ list-style: none;
149
+ margin-bottom: 0;
150
+ padding-left: 0;
151
+ position: absolute;
152
+ right: ($carousel-control-size * 2);
153
+ bottom: $carousel-indicator-size;
154
+ left: ($carousel-control-size * 2);
155
+ z-index: 1;
156
+
157
+ li {
158
+ background-color: transparent;
159
+ border: $carousel-indicator-border-width solid $carousel-indicator-border-color;
160
+ border-radius: $carousel-indicator-size;
161
+ flex: 0 0 auto;
162
+ height: $carousel-indicator-size;
163
+ margin-right: $carousel-indicator-border-width;
164
+ margin-left: $carousel-indicator-border-width;
165
+ overflow: hidden;
166
+ text-indent: 100%;
167
+ white-space: nowrap;
168
+ width: $carousel-indicator-size;
189
169
  }
170
+
171
+ .active {
172
+ background-color: $carousel-indicator-bg;
173
+ }
174
+ }
@@ -1,28 +1,27 @@
1
1
  .close {
2
- color: $close-color;
3
- cursor: pointer;
4
- float: right;
5
- font-size: $close-font-size;
6
- font-weight: normal;
7
- line-height: 1;
8
2
  @include transition-standard(color);
9
3
 
10
- // active, focus, hover
11
- @include active-focus-hover {
12
- color: $close-color-active;
13
- text-decoration: none;
14
- }
15
-
16
- &:focus {
17
- outline: 0;
18
- }
19
- }
20
-
21
- button.close {
22
4
  appearance: none;
23
5
  background-color: transparent;
24
6
  background-image: none;
25
7
  border: 0;
26
- cursor: pointer;
8
+ color: $close-color;
9
+ float: right;
10
+ font-size: $close-font-size;
11
+ font-weight: $close-font-weight;
12
+ line-height: 1;
27
13
  padding: 0;
14
+
15
+ @include active-focus-hover {
16
+ color: $close-color-hover;
17
+ text-decoration: none;
18
+ }
19
+
20
+ &:focus {
21
+ outline: 0;
22
+ }
23
+
24
+ span {
25
+ vertical-align: text-top;
26
+ }
28
27
  }