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
@@ -1,14 +1,16 @@
1
1
  .btn {
2
- background-color: $btn-bg;
2
+ @include border-radius($btn-border-radius);
3
+ @include transition-standard(box-shadow);
4
+
5
+ background-color: transparent;
3
6
  background-image: none;
4
7
  border: 0;
5
8
  box-shadow: map-get($btn-elevation-shadow, shadow);
6
9
  color: $btn-color;
7
- cursor: pointer;
8
10
  display: inline-block;
9
11
  font-size: $btn-font-size;
10
12
  font-weight: $btn-font-weight;
11
- line-height: 1;
13
+ line-height: $btn-line-height;
12
14
  margin: 0;
13
15
  max-width: 100%;
14
16
  min-width: $btn-min-width;
@@ -19,223 +21,165 @@
19
21
  user-select: none;
20
22
  vertical-align: middle;
21
23
  white-space: nowrap;
22
- z-index: map-get($btn-elevation-shadow, elevation);
23
- @include border-radius($border-radius);
24
- @include transition-standard(background-color, box-shadow, color);
25
-
26
- &::before {
27
- background-color: $btn-focus-overlay;
28
- content: "";
29
- display: block;
30
- opacity: 0;
31
- position: absolute;
32
- top: 0;
33
- right: 0;
34
- bottom: 0;
35
- left: 0;
36
- z-index: -1;
37
- @include border-radius($border-radius);
38
- @include transition-standard(opacity);
39
- }
40
-
41
- // active, focus, hover
42
- @include active-focus-hover {
43
- color: $btn-color;
44
24
 
45
- @if ($link-decoration-active != "none") {
46
- text-decoration: none;
47
- }
25
+ @include active-focus-hover {
26
+ color: $btn-color;
27
+ text-decoration: none;
28
+ }
29
+
30
+ @include focus-hover {
31
+ background-image: linear-gradient(to bottom, $btn-overlay, $btn-overlay);
32
+ }
33
+
34
+ &:active,
35
+ &.active {
36
+ background-color: $btn-bg-active;
37
+ background-image: none;
38
+ box-shadow: map-get($btn-elevation-shadow-active, shadow);
39
+ }
40
+
41
+ &:disabled,
42
+ &.disabled {
43
+ background-color: $btn-bg-disabled;
44
+ background-image: none;
45
+ box-shadow: none;
46
+ color: $btn-color-disabled;
47
+ opacity: 1;
48
+
49
+ .waves-ripple {
50
+ display: none;
48
51
  }
52
+ }
53
+
54
+ &:focus {
55
+ outline: 0;
56
+ }
57
+
58
+ .show > &.dropdown-toggle {
59
+ background-image: linear-gradient(to bottom, $btn-overlay, $btn-overlay);
60
+ }
61
+ }
62
+
63
+ a {
64
+ &.btn.disabled {
65
+ pointer-events: none;
66
+ }
67
+ }
49
68
 
50
- @include focus-hover {
51
- &::before {
52
- opacity: 1;
53
- }
69
+ fieldset {
70
+ &[disabled] a {
71
+ &.btn {
72
+ pointer-events: none;
54
73
  }
74
+ }
75
+ }
55
76
 
56
- &:active,
57
- &.active {
58
- background-color: $btn-bg-active;
59
- box-shadow: map-get($btn-elevation-shadow-active, shadow);
60
- z-index: map-get($btn-elevation-shadow-active, elevation);
77
+ // Colour
78
+ @each $color, $values in $theme-colors {
79
+ .btn-#{$color} {
80
+ @include color-yiq(map-get(theme-color($color), color));
81
+
82
+ background-color: map-get(theme-color($color), color);
61
83
 
62
- &::before {
63
- opacity: 0;
64
- }
84
+ @include active-focus-hover {
85
+ @include color-yiq(map-get(theme-color($color), color));
65
86
  }
66
87
 
67
- &:focus {
68
- outline: 0;
88
+ &:active,
89
+ &.active {
90
+ background-color: map-get(theme-color($color), darker);
69
91
  }
70
92
 
71
- // disabled
72
93
  &:disabled,
73
94
  &.disabled {
74
95
  background-color: $btn-bg-disabled;
75
- box-shadow: none;
76
96
  color: $btn-color-disabled;
77
- cursor: $cursor-disabled;
78
- opacity: 1;
79
- pointer-events: none;
80
-
81
- &::before,
82
- .waves-ripple {
83
- display: none;
84
- }
85
97
  }
98
+ }
99
+ }
86
100
 
87
- // open
88
- .open > &,
89
- .open > & {
90
- &.dropdown-toggle::before {
91
- opacity: 1;
92
- }
93
- }
101
+ [class*='bg-dark'] :not([class*='bg-light']) .btn {
102
+ &:disabled,
103
+ &.disabled {
104
+ background-color: $btn-bg-disabled-inverse;
105
+ color: $btn-color-disabled-inverse;
106
+ }
107
+ }
94
108
 
95
- .dropdown.open > & {
96
- &.dropdown-toggle,
97
- &.dropdown-toggle::before {
98
- @include border-bottom-radius(0);
99
- }
100
- }
109
+ // Size
110
+ .btn-lg,
111
+ %btn-lg {
112
+ font-size: $btn-font-size-lg;
113
+ padding: $btn-padding-y-lg $btn-padding-x-lg;
114
+ }
101
115
 
102
- .dropup.open > & {
103
- &.dropdown-toggle,
104
- &.dropdown-toggle::before {
105
- @include border-top-radius(0);
106
- }
107
- }
116
+ .btn-sm,
117
+ %btn-sm {
118
+ font-size: $btn-font-size-sm;
119
+ padding: $btn-padding-y-sm $btn-padding-x-sm;
108
120
  }
109
121
 
110
- // colour
111
- .btn-inverse {
112
- color: $btn-color-inverse;
113
-
114
- // active, focus, hover
115
- @include active-focus-hover {
116
- color: $btn-color-inverse;
117
- }
118
-
119
- &:active,
120
- &.active {
121
- background-color: $btn-bg-inverse-active;
122
- }
123
-
124
- // disabled
125
- &:disabled,
126
- &.disabled {
127
- background-color: $btn-bg-inverse-disabled;
128
- color: $btn-color-inverse-disabled;
129
- }
130
- }
131
-
132
- @each $color in $palettes {
133
- $i: index($palettes, $color);
134
-
135
- .btn-#{$color} {
136
- background-color: nth($palettes-color, $i);
137
- color: nth($palettes-text-color, $i);
138
-
139
- // active, focus, hover
140
- @include active-focus-hover {
141
- color: nth($palettes-text-color, $i);
142
- }
143
-
144
- &:active,
145
- &.active {
146
- background-color: nth($palettes-color-dark, $i);
147
- }
148
-
149
- // disabled
150
- &:disabled,
151
- &.disabled {
152
- background-color: $btn-bg-disabled;
153
- color: $btn-color-disabled;
154
- }
155
- }
156
- }
157
122
 
158
- // size
159
- .btn-lg {
160
- font-size: $btn-font-size-lg;
161
- padding: $btn-padding-y-lg $btn-padding-x-lg;
162
- }
163
123
 
164
- .btn-sm {
165
- font-size: $btn-font-size-sm;
166
- padding: $btn-padding-y-sm $btn-padding-x-sm;
124
+ // Block button
125
+
126
+ .btn-block {
127
+ display: block;
128
+ width: 100%;
129
+
130
+ + .btn-block {
131
+ margin-top: $btn-block-margin-y;
167
132
  }
133
+ }
168
134
 
169
- //
170
- // block button
171
- //
172
- .btn-block {
173
- display: block;
135
+ [type='button'],
136
+ [type='reset'],
137
+ [type='submit'] {
138
+ &.btn-block {
174
139
  width: 100%;
140
+ }
141
+ }
175
142
 
176
- + .btn-block {
177
- margin-top: $btn-block-spacer;
178
- }
143
+
144
+
145
+ // Link button
146
+
147
+ .btn-link {
148
+ background-color: transparent;
149
+ border-radius: 0;
150
+ box-shadow: none;
151
+ color: $link-color;
152
+ font-weight: normal;
153
+ text-decoration: $link-decoration;
154
+ text-transform: none;
155
+
156
+ @include active-focus-hover {
157
+ color: $link-color-hover;
158
+ text-decoration: $link-decoration-hover;
179
159
  }
180
160
 
181
- input[type="button"],
182
- input[type="reset"],
183
- input[type="submit"] {
184
- &.btn-block {
185
- width: 100%;
186
- }
161
+ @include focus-hover {
162
+ background-image: none;
187
163
  }
188
164
 
189
- //
190
- // link button
191
- //
192
- .btn-link {
165
+ &:active,
166
+ &.active {
193
167
  background-color: transparent;
194
- border-radius: 0;
195
168
  box-shadow: none;
196
- color: $link-color;
197
- font-weight: normal;
198
- text-decoration: $link-decoration;
199
- text-transform: none;
200
- z-index: initial;
201
-
202
- &::before {
203
- display: none;
204
- }
169
+ }
205
170
 
206
- // active, focus, hover
207
- @include active-focus-hover {
208
- color: $link-color-active;
209
- text-decoration: $link-decoration-active;
210
- }
211
-
212
- &:active,
213
- &.active {
214
- background-color: transparent;
215
- box-shadow: none;
216
- z-index: initial;
217
- }
218
-
219
- &:focus {
220
- @include tab-focus;
221
- }
222
-
223
- // disabled
224
- &:disabled,
225
- &.disabled {
226
- background-color: transparent;
227
- color: $btn-color-disabled;
228
- outline: 0;
229
-
230
- @if ($link-decoration-active != "none") {
231
- text-decoration: none;
232
- }
233
- }
234
- }
235
-
236
- //
237
- // no minimum width
238
- //
239
- .btn-fluid {
240
- min-width: 0;
171
+ &:disabled,
172
+ &.disabled {
173
+ background-color: transparent;
174
+ color: $btn-color-disabled;
175
+ text-decoration: none;
241
176
  }
177
+ }
178
+
179
+
180
+
181
+ // No minimum width
182
+
183
+ .btn-fluid {
184
+ min-width: 0;
185
+ }
@@ -1,348 +1,400 @@
1
1
  .card {
2
+ @include border-radius($card-border-radius);
3
+
4
+ background-clip: border-box;
2
5
  background-color: $card-bg;
3
6
  box-shadow: map-get($card-elevation-shadow, shadow);
4
7
  display: flex;
5
8
  flex-direction: column;
9
+ min-width: 0;
6
10
  position: relative;
7
- z-index: map-get($card-elevation-shadow, elevation);
8
- @include border-radius($border-radius);
9
- }
11
+ word-wrap: break-word;
10
12
 
11
- .card[href],
12
- .card[tabindex] {
13
- // active, focus, hover
13
+ &[href],
14
+ &[tabindex] {
14
15
  @include active-focus-hover {
15
- box-shadow: map-get($card-elevation-shadow-active, shadow);
16
+ box-shadow: map-get($card-elevation-shadow-hover, shadow);
16
17
  text-decoration: none;
17
- z-index: map-get($card-elevation-shadow-active, elevation);
18
18
  }
19
19
 
20
20
  &:focus {
21
21
  outline: 0;
22
22
  }
23
+ }
23
24
  }
24
25
 
25
- // colour
26
- .card-inverse {
27
- background-color: $card-bg-inverse;
28
- color: $card-color-inverse;
26
+ // Colour
27
+ @each $color, $values in $theme-colors {
28
+ .card {
29
+ &.border-#{$color} {
30
+ box-shadow: map-get($card-elevation-shadow, shadow), inset 0 0 0 1px map-get(theme-color($color), color);
31
+
32
+ &[href],
33
+ &[tabindex] {
34
+ @include active-focus-hover {
35
+ box-shadow: map-get($card-elevation-shadow-hover, shadow), inset 0 0 0 1px map-get(theme-color($color), color);
36
+ }
37
+ }
38
+ }
29
39
  }
40
+ }
30
41
 
31
- @each $color in $palettes {
32
- $i: index($palettes, $color);
33
42
 
34
- .card-#{$color} {
35
- background-color: nth($palettes-color, $i);
36
- color: nth($palettes-text-color, $i);
37
- }
43
+
44
+ // Action
45
+
46
+ .card-actions {
47
+ align-items: flex-start;
48
+ display: flex;
49
+ padding: ($card-action-padding-y - $card-action-inner-spacer-y / 2) ($card-action-padding-x - $card-action-inner-spacer-x / 2);
50
+
51
+ &:first-child {
52
+ @include border-top-radius($card-border-radius);
38
53
  }
39
54
 
40
- //
41
- // action
42
- //
43
- .card-actions {
44
- display: flex;
45
- padding: $card-action-spacer-y ($card-action-spacer-x / 2);
46
- @include clearfix;
55
+ &:last-child {
56
+ @include border-bottom-radius($card-border-radius);
57
+ }
47
58
 
48
- &:first-child {
49
- @include border-top-radius($border-radius);
50
- }
59
+ .btn {
60
+ @include text-truncate;
51
61
 
52
- &:last-child {
53
- @include border-bottom-radius($border-radius);
54
- }
62
+ flex: 0 1 auto;
63
+ margin: ($card-action-inner-spacer-y / 2) ($card-action-inner-spacer-x / 2);
64
+ min-width: 0;
65
+ padding-right: $card-action-inner-spacer-x;
66
+ padding-left: $card-action-inner-spacer-x;
67
+ }
68
+ }
55
69
 
56
- .btn {
57
- margin-right: ($card-action-spacer-x / 2);
58
- margin-left: ($card-action-spacer-x / 2);
59
- min-width: 0;
60
- overflow-x: hidden;
61
- padding-right: $card-action-spacer-x;
62
- padding-left: $card-action-spacer-x;
63
- text-overflow: ellipsis;
64
- }
65
70
 
66
- // vertical
67
- &.flex-column,
68
- &.flex-column-reverse {
69
- .btn {
70
- display: table;
71
71
 
72
- + .btn {
73
- margin-top: ($card-action-spacer-y / 2);
74
- }
75
- }
76
- }
72
+ // Body
73
+
74
+ .card-body {
75
+ flex: 1 1 auto;
76
+ padding: $card-inner-spacer-y $card-padding-x;
77
+
78
+ &:first-child,
79
+ .card-header[class*='border-'] + &,
80
+ .card-img-top + &,
81
+ .list-group + & {
82
+ padding-top: $card-padding-y;
77
83
  }
78
84
 
79
- .card-link {
80
- // active, focus, hover
81
- @include active-focus-hover {
82
- text-decoration: none;
83
- }
85
+ &:first-child {
86
+ @include border-top-radius($card-border-radius);
87
+ }
84
88
 
85
- + .card-link {
86
- margin-left: $card-action-spacer-x;
87
- }
89
+ &:last-child {
90
+ @include border-bottom-radius($card-border-radius);
91
+
92
+ padding-bottom: $card-padding-y;
88
93
  }
89
94
 
90
- //
91
- // block
92
- //
93
- .card-block {
94
- flex: 1 1 auto;
95
- padding: $card-spacer-inner-y $card-spacer-inner-x;
95
+ .card-header:not([class*='border-']) + & {
96
+ padding-top: 0;
97
+ }
96
98
 
97
- &:first-child,
98
- .card-img-top + & {
99
- padding-top: ($card-spacer-inner-y * 1.5);
100
- }
99
+ > :last-child {
100
+ margin-bottom: 0;
101
+ }
101
102
 
102
- &:last-child {
103
- padding-bottom: ($card-spacer-inner-y * 1.5);
104
- }
103
+ + .card-img-bottom,
104
+ + .list-group {
105
+ margin-top: ($card-padding-y - $card-inner-spacer-y);
105
106
  }
107
+ }
106
108
 
107
- //
108
- // footer
109
- //
110
- .card-footer {
111
- padding: 0 $card-spacer-inner-x $card-spacer-inner-y;
112
109
 
113
- &:first-child {
114
- padding-top: $card-spacer-inner-y;
115
- @include border-top-radius($border-radius);
116
- }
117
110
 
118
- &:last-child {
119
- @include border-bottom-radius($border-radius);
111
+ // Footer
112
+
113
+ .card-footer {
114
+ padding: $card-inner-spacer-y $card-padding-x;
115
+
116
+ @each $color, $values in $theme-colors {
117
+ &.border-#{$color} {
118
+ border-top: $card-border-width solid map-get(theme-color($color), color);
120
119
  }
121
120
  }
122
121
 
123
- //
124
- // header
125
- //
126
- .card-header {
127
- margin-bottom: 0;
128
- padding: $card-spacer-inner-y $card-spacer-inner-x 0;
122
+ &:first-child {
123
+ @include border-top-radius($card-border-radius);
129
124
 
130
- &:first-child,
131
- .card-img-top + & {
132
- padding-top: ($card-spacer-inner-y * 1.5);
125
+ border-top: 0;
126
+ }
127
+
128
+ &:last-child {
129
+ @include border-bottom-radius($card-border-radius);
130
+ }
131
+
132
+ .card-body + &,
133
+ .card-header + & {
134
+ &:not[class*='border-'] {
135
+ padding-top: 0;
133
136
  }
134
137
 
135
- &:first-child {
136
- @include border-top-radius($border-radius);
138
+ &[class*='border-'] {
139
+ margin-top: ($card-padding-y - $card-inner-spacer-y);
137
140
  }
141
+ }
138
142
 
139
- &:last-child {
140
- padding-bottom: ($card-spacer-inner-y * 1.5);
141
- @include border-bottom-radius($border-radius);
143
+ .card-header[class*='border-'] + & {
144
+ &[class*='border-'] {
145
+ margin-top: ($card-border-width * -1);
142
146
  }
143
147
  }
144
148
 
145
- .card-header-pills {
146
- margin-top: ($card-action-spacer-y - $card-spacer-inner-y);
147
- margin-right: ($card-action-spacer-x - $card-spacer-inner-x);
148
- margin-bottom: $card-action-spacer-y;
149
- margin-left: ($card-action-spacer-x - $card-spacer-inner-x);
149
+ > :last-child {
150
+ margin-bottom: 0;
151
+ }
152
+ }
153
+
150
154
 
151
- .card-header:first-child &,
152
- .card-img-top + .card-header & {
153
- margin-top: ($card-action-spacer-y - $card-spacer-inner-y * 1.5);
154
- }
155
155
 
156
- .nav-item + .nav-item,
157
- .nav-link + .nav-link {
158
- margin-left: $card-action-spacer-x;
159
- }
156
+ // Header
157
+
158
+ .card-header {
159
+ margin-bottom: 0;
160
+ padding: $card-inner-spacer-y $card-padding-x;
160
161
 
161
- .nav-link {
162
- padding-right: $card-action-spacer-x;
163
- padding-left: $card-action-spacer-x;
162
+ @each $color, $values in $theme-colors {
163
+ &.border-#{$color} {
164
+ border-bottom: $card-border-width solid map-get(theme-color($color), color);
164
165
  }
166
+ }
165
167
 
166
- // vertical
167
- &.flex-column,
168
- &.flex-column-reverse {
169
- .nav-item,
170
- .nav-link {
171
- display: table;
172
- }
168
+ &:first-child,
169
+ .card-img-top + &,
170
+ .list-group + & {
171
+ padding-top: $card-padding-y;
172
+ }
173
173
 
174
- .nav-item + .nav-item,
175
- .nav-link + .nav-link {
176
- margin-top: ($card-action-spacer-y / 2);
177
- margin-left: 0;
178
- }
179
- }
174
+ &:first-child {
175
+ @include border-top-radius($card-border-radius);
180
176
  }
181
177
 
182
- .card-header-tabs {
183
- margin-top: ($card-spacer-inner-y * -1);
184
- margin-right: ($card-spacer-inner-x * -1);
185
- margin-left: ($card-spacer-inner-x * -1);
178
+ &:last-child {
179
+ @include border-bottom-radius($card-border-radius);
186
180
 
187
- .card-header:first-child &,
188
- .card-img-top + .card-header & {
189
- margin-top: ($card-spacer-inner-y * -1.5);
190
- }
181
+ border-bottom: 0;
182
+ padding-bottom: $card-padding-y;
183
+ }
191
184
 
192
- .card-header:last-child & {
193
- margin-bottom: ($card-spacer-inner-y * -1.5);
185
+ &:not([class*='border-']) {
186
+ + .card-img-bottom,
187
+ + .list-group {
188
+ margin-top: ($card-padding-y - $card-inner-spacer-y);
194
189
  }
195
190
  }
196
191
 
197
- //
198
- // image
199
- //
200
- .card-img {
201
- @include border-radius($border-radius);
192
+ &[class*='border-'] {
193
+ padding-top: $card-padding-y;
194
+ padding-bottom: $card-padding-y;
202
195
  }
196
+ }
203
197
 
204
- .card-img-bottom {
205
- @include border-bottom-radius($border-radius);
198
+ .card-header-pills {
199
+ margin: ($card-inner-spacer-y * -1) ($card-inner-spacer-x * -1) 0;
200
+ padding: ($card-action-padding-y - $card-action-inner-spacer-y / 2) ($card-action-padding-x - $card-action-inner-spacer-x / 2);
201
+
202
+ .card-header:first-child &,
203
+ .card-header[class*='border-'] &,
204
+ .card-img-top + .card-header & {
205
+ margin-top: ($card-padding-y * -1);
206
206
  }
207
207
 
208
- .card-img-top {
209
- @include border-top-radius($border-radius);
208
+ .card-header:last-child &,
209
+ .card-header[class*='border-'] & {
210
+ margin-bottom: ($card-padding-y * -1);
210
211
  }
211
212
 
212
- //
213
- // image overlay
214
- //
215
- .card-img-overlay {
216
- max-height: 100%;
217
- padding: ($card-spacer-inner-y * 1.5) $card-spacer-inner-x;
218
- position: absolute;
219
- right: 0;
220
- bottom: 0;
221
- left: 0;
213
+ .nav-link {
214
+ margin: ($card-action-inner-spacer-y / 2) ($card-action-inner-spacer-x / 2);
215
+ padding-right: $card-action-inner-spacer-x;
216
+ padding-left: $card-action-inner-spacer-x;
222
217
  }
218
+ }
223
219
 
224
- //
225
- // set
226
- //
227
- .card-columns {
228
- column-count: 2;
229
- column-gap: 0;
230
- margin-right: ($card-spacer-outer-x / -2);
231
- margin-left: ($card-spacer-outer-x / -2);
220
+ .card-header-tabs {
221
+ margin-top: ($card-inner-spacer-y * -1);
222
+ margin-right: ($card-inner-spacer-x * -1);
223
+ margin-bottom: ($card-padding-y - $card-inner-spacer-y);
224
+ margin-left: ($card-inner-spacer-x * -1);
225
+
226
+ .card-header:first-child &,
227
+ .card-header[class*='border-'] &,
228
+ .card-img-top + .card-header &,
229
+ .list-group + .card-header & {
230
+ margin-top: ($card-padding-y * -1);
231
+ }
232
232
 
233
- .card {
234
- display: inline-block;
235
- margin-right: ($card-spacer-outer-x / 2);
236
- margin-bottom: $card-spacer-outer-y;
237
- margin-left: ($card-spacer-outer-x / 2);
238
- width: calc(100% - #{$card-spacer-outer-x});
239
- }
233
+ .card-header[class*='border-'] &,
234
+ .card-header:last-child & {
235
+ margin-bottom: ($card-padding-y * -1);
236
+ }
237
+ }
240
238
 
241
- @include media-breakpoint-up(sm) {
242
- column-count: 3;
243
- }
239
+
240
+
241
+ // Image
242
+
243
+ .card-img {
244
+ @include border-radius($card-border-radius);
245
+ }
246
+
247
+ .card-img-bottom {
248
+ @include border-bottom-radius($card-border-radius);
249
+ }
250
+
251
+ .card-img-top {
252
+ @include border-top-radius($card-border-radius);
253
+ }
254
+
255
+
256
+
257
+ // Image overlay
258
+
259
+ .card-img-overlay {
260
+ max-height: 100%;
261
+ padding: $card-padding-y $card-padding-x;
262
+ position: absolute;
263
+ right: 0;
264
+ bottom: 0;
265
+ left: 0;
266
+ }
267
+
268
+
269
+
270
+ // Set
271
+
272
+ .card-columns {
273
+ column-count: $card-columns-count;
274
+ column-gap: $card-margin-x;
275
+ margin-top: ($card-margin-y / -2);
276
+ margin-bottom: ($card-margin-y / 2);
277
+
278
+ @include media-breakpoint-up(md) {
279
+ column-count: $card-columns-count-desktop;
244
280
  }
245
281
 
246
- .card-deck {
282
+ .card {
283
+ display: inline-flex;
284
+ margin-top: ($card-margin-y / 2);
285
+ margin-bottom: ($card-margin-y / 2);
286
+ width: 100%;
287
+ }
288
+ }
289
+
290
+ .card-deck {
291
+ @include media-breakpoint-up(sm) {
292
+ display: flex;
293
+ flex-flow: row wrap;
294
+ margin-right: ($card-margin-x / -2);
295
+ margin-left: ($card-margin-x / -2);
296
+ }
297
+
298
+ .card {
299
+ margin-bottom: $card-margin-y;
300
+
247
301
  @include media-breakpoint-up(sm) {
248
- display: flex;
249
- flex-flow: row wrap;
250
- margin-right: ($card-spacer-outer-x / -2);
251
- margin-left: ($card-spacer-outer-x / -2);
252
-
253
- .card {
254
- flex: 1 0 0;
255
- margin-right: ($card-spacer-outer-x / 2);
256
- margin-bottom: $card-spacer-outer-y;
257
- margin-left: ($card-spacer-outer-x / 2);
258
- }
302
+ flex: 1 0 0;
303
+ margin-right: ($card-margin-x / 2);
304
+ margin-left: ($card-margin-x / 2);
259
305
  }
260
306
  }
307
+ }
261
308
 
262
- .card-group {
263
- @include media-breakpoint-up(sm) {
264
- display: flex;
265
- flex-flow: row wrap;
309
+ .card-group {
310
+ @include media-breakpoint-up(sm) {
311
+ display: flex;
312
+ flex-flow: row wrap;
313
+ }
266
314
 
267
- .card {
268
- flex: 1 0 0;
315
+ .card {
316
+ box-shadow: $shadow-1dp;
317
+ margin-bottom: $card-margin-y;
269
318
 
270
- &:first-child {
319
+ @include media-breakpoint-up(sm) {
320
+ flex: 1 0 0;
321
+
322
+ &:first-child:not(:last-child) {
323
+ @include border-right-radius(0);
324
+
325
+ .card-actions,
326
+ .card-body,
327
+ .card-footer,
328
+ .card-header,
329
+ .card-img,
330
+ .card-img-bottom,
331
+ .card-img-top {
271
332
  @include border-right-radius(0);
272
-
273
- .card-actions,
274
- .card-footer,
275
- .card-header,
276
- .card-img,
277
- .card-img-bottom,
278
- .card-img-top {
279
- @include border-right-radius(0);
280
- }
281
333
  }
334
+ }
282
335
 
283
- &:last-child {
284
- @include border-left-radius(0);
336
+ &:last-child:not(:first-child) {
337
+ @include border-left-radius(0);
285
338
 
286
- .card-actions,
287
- .card-footer,
288
- .card-header,
289
- .card-img,
290
- .card-img-bottom,
291
- .card-img-top {
292
- @include border-left-radius(0);
293
- }
339
+ .card-actions,
340
+ .card-body,
341
+ .card-footer,
342
+ .card-header,
343
+ .card-img,
344
+ .card-img-bottom,
345
+ .card-img-top {
346
+ @include border-left-radius(0);
294
347
  }
348
+ }
295
349
 
296
- &:not(:first-child):not(:last-child) {
297
- @include border-radius(0);
350
+ &:not(:first-child):not(:last-child) {
351
+ @include border-radius(0);
298
352
 
299
- .card-actions,
300
- .card-footer,
301
- .card-header,
302
- .card-img,
303
- .card-img-bottom,
304
- .card-img-top {
305
- @include border-radius(0);
306
- }
353
+ .card-actions,
354
+ .card-body,
355
+ .card-footer,
356
+ .card-header,
357
+ .card-img,
358
+ .card-img-bottom,
359
+ .card-img-top {
360
+ @include border-radius(0);
307
361
  }
308
362
  }
309
363
  }
310
364
  }
365
+ }
311
366
 
312
- //
313
- // text and title
314
- //
315
- .card-blockquote {
316
- border-left: 0;
317
- margin-bottom: 0;
318
- padding: 0;
319
- }
320
367
 
321
- .card-subtitle {
322
- margin-top: ($card-spacer-inner-y * -1);
323
- margin-bottom: 0;
324
- @include typography-body-1;
368
+
369
+ // Text and title
370
+
371
+ .card-link {
372
+ @include active-focus-hover {
373
+ text-decoration: none;
325
374
  }
326
375
 
327
- .card-text {
328
- &:last-child {
329
- margin-bottom: 0;
330
- }
376
+ + .card-link {
377
+ margin-left: $card-inner-spacer-x;
331
378
  }
379
+ }
332
380
 
333
- .card-title {
334
- margin-bottom: $card-spacer-inner-y;
335
- @include typography-headline;
381
+ .card-subtitle {
382
+ @include typography-body-1;
336
383
 
337
- &:last-child {
338
- margin-bottom: 0;
339
- }
384
+ margin-top: ($card-inner-spacer-y * -1);
385
+ margin-bottom: 0;
386
+ }
340
387
 
341
- .card-block:not(:first-child) > &:first-child {
342
- margin-top: ($card-spacer-inner-y / 2);
343
- }
388
+ .card-text:last-child {
389
+ margin-bottom: 0;
390
+ }
344
391
 
345
- .card-img-top + .card-block > &:first-child {
346
- margin-top: 0;
347
- }
392
+ .card-title {
393
+ @include typography-headline;
394
+
395
+ margin-bottom: $card-inner-spacer-y;
396
+
397
+ &:last-child {
398
+ margin-bottom: 0;
348
399
  }
400
+ }