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
@@ -6,34 +6,37 @@ samp {
6
6
  }
7
7
 
8
8
  code {
9
+ @include border-radius($code-border-radius);
10
+
9
11
  background-color: $code-bg;
10
12
  color: $code-color;
11
13
  font-size: $code-font-size;
12
- padding: $code-padding;
13
- @include border-radius($border-radius);
14
+ padding: $code-padding-y $code-padding-x;
14
15
  }
15
16
 
16
17
  kbd {
18
+ @include border-radius($code-border-radius);
19
+
17
20
  background-color: $kbd-bg;
18
21
  color: $kbd-color;
19
22
  font-size: $code-font-size;
20
- padding: $code-padding;
21
- @include border-radius($border-radius);
23
+ padding: $code-padding-y $code-padding-x;
22
24
 
23
25
  kbd {
24
26
  font-size: 100%;
27
+ font-weight: bolder;
25
28
  padding: 0;
26
29
  }
27
30
  }
28
31
 
29
32
  pre {
30
- background-color: $pre-bg;
33
+ @include border-radius($code-border-radius);
34
+
31
35
  color: $pre-color;
32
36
  display: block;
33
37
  font-size: $code-font-size;
34
38
  margin-top: 0;
35
- margin-bottom: $pre-margin-bottom;
36
- @include border-radius($border-radius);
39
+ margin-bottom: $pre-margin-y;
37
40
 
38
41
  code {
39
42
  background-color: transparent;
@@ -1,67 +1,61 @@
1
- //
2
- // custom checkbox, radio button and select are defined in material design guidelines
1
+ // N.B. Custom checkbox, radio button and select are defined in Material design
3
2
  // (https://material.google.com/components/selection-controls.html)
4
3
  // therefore, these elements are styled in /assets/sass/material/_selection-control.scss
5
- //
6
4
 
7
- //
8
- // custom file
9
- //
10
- .custom-file {
11
- cursor: pointer;
12
- display: inline-block;
13
- height: $textfield-height;
14
- max-width: 100%;
15
- position: relative;
16
- }
5
+ // Custom file
17
6
 
18
- .custom-file-control {
19
- border-bottom: $textfield-border-width solid $textfield-border-color;
20
- color: $textfield-hint-color;
21
- font-weight: $font-weight-regular;
22
- position: absolute;
23
- top: 0;
24
- right: 0;
25
- left: 0;
26
- user-select: none;
27
- z-index: 1;
28
- @include form-control-size($textfield-border-width, $textfield-font-size, $textfield-height, $textfield-padding-top, $textfield-padding-bottom);
29
- @include transition-standard(border-bottom-color);
7
+ .custom-file {
8
+ display: inline-block;
9
+ height: $textfield-height;
10
+ max-width: 100%;
11
+ position: relative;
12
+ }
30
13
 
31
- @each $lang, $text in $custom-file-text {
32
- &:lang(#{$lang})::after {
33
- content: $text;
34
- }
35
- }
14
+ .custom-file-control {
15
+ @include form-control-size($textfield-font-size, $textfield-height, $textfield-line-height, $textfield-padding-x, $textfield-padding-y);
16
+ @include transition-standard(border-color, box-shadow);
17
+
18
+ align-items: center;
19
+ border-bottom: $textfield-border-width solid $textfield-border-color;
20
+ color: $textfield-hint-color;
21
+ display: flex;
22
+ justify-content: space-between;
23
+ position: absolute;
24
+ top: 0;
25
+ right: 0;
26
+ bottom: 0;
27
+ left: 0;
36
28
 
37
- &::before {
38
- background-color: transparent;
39
- background-image: $custom-file-button-bg;
40
- background-position: 50% 50%;
41
- background-repeat: no-repeat;
42
- background-size: $material-icon-size $material-icon-size;
43
- content: "";
44
- opacity: $custom-file-button-opacity;
45
- position: absolute;
46
- top: $textfield-padding-top;
47
- right: 0;
48
- bottom: 0;
49
- width: $material-icon-size;
50
- z-index: 2;
51
- @include transition-standard(opacity);
29
+ @each $lang, $text in $custom-file-text {
30
+ &:lang(#{$lang})::before {
31
+ content: $text;
52
32
  }
33
+ }
34
+
35
+ @include hover {
36
+ border-bottom-color: $textfield-border-color-hover;
37
+ box-shadow: inset 0 ($textfield-border-width-hover * -1) 0 ($textfield-border-width * -1) $textfield-border-color-hover;
38
+ }
39
+
40
+ &::after {
41
+ @include set-material-icons;
53
42
 
54
- // active, focus, hover
55
- @include active-focus-hover {
56
- &::before {
57
- opacity: $custom-file-button-opacity-visible;
58
- }
59
- }
43
+ content: $custom-file-button-icon;
60
44
  }
61
45
 
62
- .custom-file-input {
63
- margin: 0;
64
- max-width: 100%;
65
- min-width: $custom-file-width;
66
- opacity: 0;
46
+ &::before {
47
+ @include text-truncate;
48
+ }
49
+ }
50
+
51
+ .custom-file-input {
52
+ margin: 0;
53
+ max-width: 100%;
54
+ min-width: $custom-file-width;
55
+ opacity: 0;
56
+
57
+ &:focus ~ .custom-file-control {
58
+ border-bottom-color: $textfield-border-color-focus;
59
+ box-shadow: inset 0 ($textfield-border-width-focus * -1) 0 ($textfield-border-width * -1) $textfield-border-color-focus;
67
60
  }
61
+ }
@@ -1,159 +1,189 @@
1
- //
2
- // checkbox and radio button
3
- //
4
- .form-check {
5
- display: block;
6
- margin-bottom: $textfield-margin-bottom;
7
-
8
- // disabled
9
- &.disabled {
10
- .form-check-label {
11
- color: $textfield-color-disabled;
12
- cursor: $cursor-disabled;
13
- }
14
- }
15
- }
1
+ // Checkbox and radio button
16
2
 
17
- .form-check-input {
18
- margin-right: $form-check-input-margin-x;
3
+ .form-check {
4
+ display: block;
5
+ margin-bottom: $textfield-margin-y;
6
+
7
+ &.disabled {
8
+ .form-check-label {
9
+ color: $textfield-color-disabled;
10
+ }
19
11
  }
12
+ }
20
13
 
21
- .form-check-label {
22
- align-items: center;
23
- cursor: pointer;
24
- display: inline-flex;
25
- margin-bottom: 0;
14
+ .form-check-inline {
15
+ display: inline-block;
16
+ margin-bottom: 0;
17
+ vertical-align: middle;
18
+
19
+ + .form-check-inline {
20
+ margin-left: $form-check-inline-margin-x;
26
21
  }
22
+ }
27
23
 
28
- // inline
29
- .form-check-inline {
30
- display: inline-block;
31
- margin-bottom: 0;
32
- vertical-align: middle;
24
+ .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);
29
+ }
33
30
 
34
- + .form-check-inline {
35
- margin-left: $form-check-inline-margin-x;
36
- }
37
- }
31
+ .form-check-label {
32
+ align-items: flex-start;
33
+ color: inherit;
34
+ display: inline-flex;
35
+ font-size: inherit;
36
+ line-height: inherit;
37
+ }
38
38
 
39
- //
40
- // form group
41
- //
42
- .form-group {
43
- margin-bottom: $form-group-margin-bottom;
44
39
 
45
- &:not(.floating-label) label:not(.form-check-label) {
46
- font-size: $form-group-label-font-size;
47
- margin-bottom: 0;
48
- }
40
+
41
+ // Form group
42
+
43
+ .form-group {
44
+ margin-bottom: $form-group-margin-y;
45
+ }
46
+
47
+ .form-row {
48
+ display: flex;
49
+ flex-wrap: wrap;
50
+ margin-right: ($textfield-margin-x / -2);
51
+ margin-left: ($textfield-margin-x / -2);
52
+
53
+ > .col,
54
+ > [class*='col-'] {
55
+ padding-right: ($textfield-margin-x / 2);
56
+ padding-left: ($textfield-margin-x / 2);
49
57
  }
58
+ }
50
59
 
51
- //
52
- // inline
53
- //
54
- .form-inline {
55
- align-items: center;
56
- display: flex;
57
- flex-flow: row wrap;
58
60
 
59
- .form-check {
60
- width: 100%;
61
- }
62
61
 
63
- @include media-breakpoint-up(sm) {
64
- label {
65
- align-items: center;
66
- display: flex;
67
- justify-content: center;
68
- margin-bottom: 0;
69
- }
70
-
71
- .form-check {
72
- margin-bottom: 0;
73
- width: auto;
74
- }
75
-
76
- .form-control {
77
- display: inline-block;
78
- vertical-align: middle;
79
- width: auto;
80
- }
81
-
82
- .form-control-static {
83
- display: inline-block;
84
- }
85
-
86
- .form-group {
87
- align-items: center;
88
- display: flex;
89
- flex: 0 0 auto;
90
- flex-flow: row wrap;
91
- margin-bottom: 0;
92
- }
93
-
94
- .input-group {
95
- width: auto;
96
- }
97
- }
62
+ // Inline
63
+
64
+ .form-inline {
65
+ align-items: center;
66
+ display: flex;
67
+ flex-flow: row wrap;
68
+
69
+ label {
70
+ align-items: center;
71
+ display: flex;
72
+ justify-content: center;
98
73
  }
99
74
 
100
- //
101
- // label
102
- //
103
- .col-form-label {
104
- line-height: ($textfield-height - $textfield-padding-top - $textfield-padding-bottom);
105
- padding-top: $textfield-padding-top;
106
- padding-bottom: $textfield-padding-bottom;
75
+ .form-check {
76
+ align-items: center;
77
+ display: flex;
78
+ justify-content: center;
79
+ margin-bottom: 0;
80
+ width: auto;
107
81
  }
108
82
 
109
- .col-form-label-lg {
110
- line-height: ($textfield-height-lg - $textfield-padding-top-lg - $textfield-padding-bottom-lg);
111
- padding-top: $textfield-padding-top-lg;
112
- padding-bottom: $textfield-padding-bottom-lg;
83
+ .form-control {
84
+ display: inline-block;
85
+ vertical-align: middle;
86
+ width: auto;
113
87
  }
114
88
 
115
- .col-form-label-sm {
116
- line-height: ($textfield-height-sm - $textfield-padding-top-sm - $textfield-padding-bottom-sm);
117
- padding-top: $textfield-padding-top-sm;
118
- padding-bottom: $textfield-padding-bottom-sm;
89
+ .form-control-plaintext {
90
+ display: inline-block;
119
91
  }
120
92
 
121
- .col-form-legend {
122
- font-size: $font-size-base;
93
+ .form-group {
94
+ align-items: center;
95
+ display: flex;
96
+ flex: 0 0 auto;
97
+ flex-flow: row wrap;
123
98
  margin-bottom: 0;
124
- padding-top: $textfield-padding-top;
125
- padding-bottom: $textfield-padding-bottom;
99
+ }
126
100
 
127
- .form-group & {
128
- font-size: $form-group-label-font-size;
129
- }
101
+ .input-group {
102
+ width: auto;
130
103
  }
104
+ }
131
105
 
132
- //
133
- // misc
134
- //
135
- .form-control-feedback,
136
- .form-text {
137
- display: block;
138
- margin-top: $textfield-margin-bottom;
139
-
140
- .form-control-lg + &,
141
- .form-control-static-lg + & {
142
- margin-top: $textfield-margin-bottom-lg;
143
- }
144
106
 
145
- .form-control-sm + &,,
146
- .form-control-static-sm + & {
147
- margin-top: $textfield-margin-bottom-sm;
148
- }
107
+
108
+ // Label
109
+
110
+ .col-form-label {
111
+ color: inherit;
112
+ font-size: $font-size-base;
113
+ line-height: ($textfield-font-size * $textfield-line-height / $font-size-base);
114
+ padding-top: $textfield-padding-y;
115
+ padding-bottom: $textfield-padding-y;
116
+ }
117
+
118
+ .col-form-label-lg {
119
+ font-size: ($font-size-base / $textfield-font-size * $textfield-font-size-lg);
120
+ line-height: ($textfield-line-height-lg / ($font-size-base / $textfield-font-size));
121
+ padding-top: $textfield-padding-y-lg;
122
+ padding-bottom: $textfield-padding-y-lg;
123
+ }
124
+
125
+ .col-form-label-sm {
126
+ font-size: ($font-size-base / $textfield-font-size * $textfield-font-size-sm);
127
+ line-height: ($textfield-line-height-sm / ($font-size-base / $textfield-font-size));
128
+ padding-top: $textfield-padding-y-sm;
129
+ padding-bottom: $textfield-padding-y-sm;
130
+ }
131
+
132
+ .col-form-legend {
133
+ font-size: $font-size-base;
134
+ line-height: ($textfield-font-size * $textfield-line-height / $font-size-base);
135
+ margin-bottom: 0;
136
+ padding-top: $textfield-padding-y;
137
+ padding-bottom: $textfield-padding-y;
138
+ }
139
+
140
+
141
+
142
+ // Misc
143
+
144
+ .form-text {
145
+ @include typography-caption;
146
+
147
+ color: $textfield-hint-color;
148
+ display: block;
149
+ margin-top: $textfield-margin-y;
150
+
151
+ .form-control-lg + & {
152
+ margin-top: $textfield-margin-y-lg;
149
153
  }
150
154
 
151
- .form-control-file,
152
- .form-control-range {
153
- display: block;
155
+ .form-control-sm + & {
156
+ margin-top: $textfield-margin-y-sm;
154
157
  }
158
+ }
159
+
160
+ .form-control-file,
161
+ .form-control-range {
162
+ display: block;
163
+ }
164
+
165
+
155
166
 
156
- .form-control-file {
157
- margin-top: $textfield-padding-top;
158
- margin-bottom: $textfield-margin-bottom;
167
+ // Validation
168
+
169
+ .invalid-feedback {
170
+ @include typography-caption;
171
+
172
+ color: $form-feedback-invalid-color;
173
+ display: none;
174
+ margin-top: $textfield-margin-y;
175
+
176
+ .form-control-lg + & {
177
+ margin-top: $textfield-margin-y-lg;
159
178
  }
179
+
180
+ .form-control-sm + & {
181
+ margin-top: $textfield-margin-y-sm;
182
+ }
183
+ }
184
+
185
+ .invalid-tooltip {
186
+ display: none;
187
+ position: absolute;
188
+ top: 100%;
189
+ }