UNPKG

4.75 kBCSSView Raw
1/**
2 * A collection of mixins and CSS classes that can be used to apply elevation to a material
3 * element.
4 * See: https://www.google.com/design/spec/what-is-material/elevation-shadows.html
5 * Examples:
6 *
7 *
8 * .md-foo {
9 * @include $md-elevation(2);
10 *
11 * &:active {
12 * @include $md-elevation(8);
13 * }
14 * }
15 *
16 * <div id="external-card" class="md-elevation-z2"><p>Some content</p></div>
17 *
18 * For an explanation of the design behind how elevation is implemented, see the design doc at
19 * https://goo.gl/Kq0k9Z.
20 */
21/**
22 * The css property used for elevation. In most cases this should not be changed. It is exposed
23 * as a variable for abstraction / easy use when needing to reference the property directly, for
24 * example in a will-change rule.
25 */
26/** The default duration value for elevation transitions. */
27/** The default easing value for elevation transitions. */
28/**
29 * Applies the correct css rules to an element to give it the elevation specified by $zValue.
30 * The $zValue must be between 0 and 24.
31 */
32/**
33 * Returns a string that can be used as the value for a transition property for elevation.
34 * Calling this function directly is useful in situations where a component needs to transition
35 * more than one property.
36 *
37 * .foo {
38 * transition: md-elevation-transition-property-value(), opacity 100ms ease;
39 * will-change: $md-elevation-property, opacity;
40 * }
41 */
42/**
43 * Applies the correct css rules needed to have an element transition between elevations.
44 * This mixin should be applied to elements whose elevation values will change depending on their
45 * context (e.g. when active or disabled).
46 */
47md-card {
48 box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
49 transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
50 will-change: box-shadow;
51 display: block;
52 position: relative;
53 padding: 24px;
54 border-radius: 2px;
55 font-family: Roboto, "Helvetica Neue", sans-serif;
56 background: white;
57 color: black; }
58
59md-card:hover {
60 box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); }
61
62.md-card-flat {
63 box-shadow: none; }
64
65md-card-title, md-card-subtitle, md-card-content, md-card-actions {
66 display: block;
67 margin-bottom: 16px; }
68
69md-card-title {
70 font-size: 24px;
71 font-weight: 400; }
72
73md-card-subtitle {
74 font-size: 14px;
75 color: rgba(0, 0, 0, 0.54); }
76
77md-card-content {
78 font-size: 14px; }
79
80md-card-actions {
81 margin-left: -16px;
82 margin-right: -16px;
83 padding: 8px 0; }
84 md-card-actions[align='end'] {
85 display: flex;
86 justify-content: flex-end; }
87
88[md-card-image] {
89 width: calc(100% + 48px);
90 margin: 0 -24px 16px -24px; }
91
92[md-card-xl-image] {
93 width: 240px;
94 height: 240px;
95 margin: -8px; }
96
97md-card-footer {
98 position: absolute;
99 bottom: 0; }
100
101md-card-actions [md-button], md-card-actions [md-raised-button] {
102 margin: 0 4px; }
103
104/* HEADER STYLES */
105md-card-header {
106 display: flex;
107 flex-direction: row;
108 height: 40px;
109 margin: -8px 0 16px 0; }
110
111.md-card-header-text {
112 height: 40px;
113 margin: 0 8px; }
114
115[md-card-avatar] {
116 height: 40px;
117 width: 40px;
118 border-radius: 50%; }
119
120md-card-header md-card-title {
121 font-size: 14px; }
122
123/* TITLE-GROUP STYLES */
124[md-card-sm-image], [md-card-md-image], [md-card-lg-image] {
125 margin: -8px 0; }
126
127md-card-title-group {
128 display: flex;
129 justify-content: space-between;
130 margin: 0 -8px; }
131
132[md-card-sm-image] {
133 width: 80px;
134 height: 80px; }
135
136[md-card-md-image] {
137 width: 112px;
138 height: 112px; }
139
140[md-card-lg-image] {
141 width: 152px;
142 height: 152px; }
143
144/* MEDIA QUERIES */
145@media (max-width: 600px) {
146 md-card {
147 padding: 24px 16px; }
148 [md-card-image] {
149 width: calc(100% + 32px);
150 margin: 16px -16px; }
151 md-card-title-group {
152 margin: 0; }
153 [md-card-xl-image] {
154 margin-left: 0;
155 margin-right: 0; }
156 md-card-header {
157 margin: -8px 0 0 0; } }
158
159/* FIRST/LAST CHILD ADJUSTMENTS */
160md-card > :first-child, md-card-content > :first-child {
161 margin-top: 0; }
162
163md-card > :last-child, md-card-content > :last-child {
164 margin-bottom: 0; }
165
166[md-card-image]:first-child {
167 margin-top: -24px; }
168
169md-card > md-card-actions:last-child {
170 margin-bottom: -16px;
171 padding-bottom: 0; }
172
173md-card-actions [md-button]:first-child,
174md-card-actions [md-raised-button]:first-child {
175 margin-left: 0;
176 margin-right: 0; }
177
178md-card-title:not(:first-child), md-card-subtitle:not(:first-child) {
179 margin-top: -4px; }
180
181md-card-header md-card-subtitle:not(:first-child) {
182 margin-top: -8px; }
183
184md-card > [md-card-xl-image]:first-child {
185 margin-top: -8px; }
186
187md-card > [md-card-xl-image]:last-child {
188 margin-bottom: -8px; }
189
190/*# sourceMappingURL=card.css.map */