| OLD | NEW |
| (Empty) | |
| 1 /** |
| 2 * Copyright 2017 Google Inc. All Rights Reserved. |
| 3 * |
| 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 * you may not use this file except in compliance with the License. |
| 6 * You may obtain a copy of the License at |
| 7 * |
| 8 * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 * |
| 10 * Unless required by applicable law or agreed to in writing, software |
| 11 * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 * See the License for the specific language governing permissions and |
| 14 * limitations under the License. |
| 15 **/ |
| 16 /** |
| 17 * The css property used for elevation. In most cases this should not be changed
. It is exposed |
| 18 * as a variable for abstraction / easy use when needing to reference the proper
ty directly, for |
| 19 * example in a `will-change` rule. |
| 20 */ |
| 21 /** |
| 22 * The default duration value for elevation transitions. |
| 23 */ |
| 24 /** |
| 25 * The default easing value for elevation transitions. |
| 26 */ |
| 27 /** |
| 28 * Applies the correct css rules to an element to give it the elevation specifie
d by $z-value. |
| 29 * The $z-value must be between 0 and 24. |
| 30 */ |
| 31 /** |
| 32 * Returns a string that can be used as the value for a `transition` property fo
r elevation. |
| 33 * Calling this function directly is useful in situations where a component need
s to transition |
| 34 * more than one property. |
| 35 * |
| 36 * ```scss |
| 37 * .foo { |
| 38 * transition: mdc-elevation-transition-rule(), opacity 100ms ease; |
| 39 * will-change: $mdc-elevation-property, opacity; |
| 40 * } |
| 41 * ``` |
| 42 */ |
| 43 /** |
| 44 * Applies the correct css rules needed to have an element transition between el
evations. |
| 45 * This mixin should be applied to elements whose elevation values will change d
epending on their |
| 46 * context (e.g. when active or disabled). |
| 47 */ |
| 48 /* |
| 49 Precomputed linear color channel values, for use in contrast calculations. |
| 50 See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests |
| 51 |
| 52 Algorithm, for c in 0 to 255: |
| 53 f(c) { |
| 54 c = c / 255; |
| 55 return c < 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4); |
| 56 } |
| 57 |
| 58 This lookup table is needed since there is no `pow` in SASS. |
| 59 */ |
| 60 /** |
| 61 * Calculate the luminance for a color. |
| 62 * See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests |
| 63 */ |
| 64 /** |
| 65 * Calculate the contrast ratio between two colors. |
| 66 * See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests |
| 67 */ |
| 68 /** |
| 69 * Determine whether to use dark or light text on top of given color. |
| 70 * Returns "dark" for dark text and "light" for light text. |
| 71 */ |
| 72 /* |
| 73 Main theme colors. |
| 74 If you're a user customizing your color scheme in SASS, these are probably the
only variables you need to change. |
| 75 */ |
| 76 /* Indigo 500 */ |
| 77 /* Pink A200 */ |
| 78 /* White */ |
| 79 /* Which set of text colors to use for each main theme color (light or dark) */ |
| 80 /* Text colors according to light vs dark and text type */ |
| 81 /* Primary text colors for each of the theme colors */ |
| 82 /** |
| 83 * Applies the correct theme color style to the specified property. |
| 84 * $property is typically color or background-color, but can be any CSS property
that accepts color values. |
| 85 * $style should be one of the map keys in $mdc-theme-property-values (_variable
s.scss). |
| 86 */ |
| 87 /** |
| 88 * Creates a rule to be used in MDC-Web components for dark theming, and applies
the provided contents. |
| 89 * Should provide the $root-selector option if applied to anything other than th
e root selector. |
| 90 * When used with a modifier class, provide a second argument of `true` for the
$compound parameter |
| 91 * to specify that this should be attached as a compound class. |
| 92 * |
| 93 * Usage example: |
| 94 * |
| 95 * ```scss |
| 96 * .mdc-foo { |
| 97 * color: black; |
| 98 * |
| 99 * @include mdc-theme-dark { |
| 100 * color: white; |
| 101 * } |
| 102 * |
| 103 * &__bar { |
| 104 * background: black; |
| 105 * |
| 106 * @include mdc-theme-dark(".mdc-foo") { |
| 107 * background: white; |
| 108 * } |
| 109 * } |
| 110 * } |
| 111 * |
| 112 * .mdc-foo--disabled { |
| 113 * opacity: .38; |
| 114 * |
| 115 * @include mdc-theme-dark(".mdc-foo", true) { |
| 116 * opacity: .5; |
| 117 * } |
| 118 * } |
| 119 * ``` |
| 120 */ |
| 121 /* TODO(sgomes): Figure out what to do about desktop font sizes. */ |
| 122 /* TODO(sgomes): Figure out what to do about i18n and i18n font sizes. */ |
| 123 /** |
| 124 * Creates a rule that will be applied when an MDC-Web component is within the c
ontext of an RTL layout. |
| 125 * |
| 126 * Usage Example: |
| 127 * ```scss |
| 128 * .mdc-foo { |
| 129 * position: absolute; |
| 130 * left: 0; |
| 131 * |
| 132 * @include mdc-rtl { |
| 133 * left: auto; |
| 134 * right: 0; |
| 135 * } |
| 136 * |
| 137 * &__bar { |
| 138 * margin-left: 4px; |
| 139 * @include mdc-rtl(".mdc-foo") { |
| 140 * margin-left: auto; |
| 141 * margin-right: 4px; |
| 142 * } |
| 143 * } |
| 144 * } |
| 145 * |
| 146 * .mdc-foo--mod { |
| 147 * padding-left: 4px; |
| 148 * |
| 149 * @include mdc-rtl { |
| 150 * padding-left: auto; |
| 151 * padding-right: 4px; |
| 152 * } |
| 153 * } |
| 154 * ``` |
| 155 * |
| 156 * Note that this works by checking for [dir="rtl"] on an ancestor element. Whil
e this will work |
| 157 * in most cases, it will in some cases lead to false negatives, e.g. |
| 158 * |
| 159 * ```html |
| 160 * <html dir="rtl"> |
| 161 * <!-- ... --> |
| 162 * <div dir="ltr"> |
| 163 * <div class="mdc-foo">Styled incorrectly as RTL!</div> |
| 164 * </div> |
| 165 * </html> |
| 166 * ``` |
| 167 * |
| 168 * In the future, selectors such as :dir (http://mdn.io/:dir) will help us mitig
ate this. |
| 169 */ |
| 170 /** |
| 171 * Takes a base box-model property - e.g. margin / border / padding - along with
a default |
| 172 * direction and value, and emits rules which apply the value to the |
| 173 * "<base-property>-<default-direction>" property by default, but flips the dire
ction |
| 174 * when within an RTL context. |
| 175 * |
| 176 * For example: |
| 177 * |
| 178 * ```scss |
| 179 * .mdc-foo { |
| 180 * @include mdc-rtl-reflexive-box(margin, left, 8px); |
| 181 * } |
| 182 * ``` |
| 183 * is equivalent to: |
| 184 * |
| 185 * ```scss |
| 186 * .mdc-foo { |
| 187 * margin-left: 8px; |
| 188 * |
| 189 * @include mdc-rtl { |
| 190 * margin-right: 8px; |
| 191 * margin-left: 0; |
| 192 * } |
| 193 * } |
| 194 * ``` |
| 195 * whereas: |
| 196 * |
| 197 * ```scss |
| 198 * .mdc-foo { |
| 199 * @include mdc-rtl-reflexive-box(margin, right, 8px); |
| 200 * } |
| 201 * ``` |
| 202 * is equivalent to: |
| 203 * |
| 204 * ```scss |
| 205 * .mdc-foo { |
| 206 * margin-right: 8px; |
| 207 * |
| 208 * @include mdc-rtl { |
| 209 * margin-right: 0; |
| 210 * margin-left: 8px; |
| 211 * } |
| 212 * } |
| 213 * ``` |
| 214 * |
| 215 * You can also pass a 4th optional $root-selector argument which will be forwar
ded to `mdc-rtl`, |
| 216 * e.g. `@include mdc-rtl-reflexive-box-property(margin, left, 8px, ".mdc-compon
ent")`. |
| 217 * |
| 218 * Note that this function will always zero out the original value in an RTL con
text. If you're |
| 219 * trying to flip the values, use mdc-rtl-reflexive-property(). |
| 220 */ |
| 221 /** |
| 222 * Takes a base property and emits rules that assign <base-property>-left to <le
ft-value> and |
| 223 * <base-property>-right to <right-value> in a LTR context, and vice versa in a
RTL context. |
| 224 * For example: |
| 225 * |
| 226 * ```scss |
| 227 * .mdc-foo { |
| 228 * @include mdc-rtl-reflexive-property(margin, auto, 12px); |
| 229 * } |
| 230 * ``` |
| 231 * is equivalent to: |
| 232 * |
| 233 * ```scss |
| 234 * .mdc-foo { |
| 235 * margin-left: auto; |
| 236 * margin-right: 12px; |
| 237 * |
| 238 * @include mdc-rtl { |
| 239 * margin-left: 12px; |
| 240 * margin-right: auto; |
| 241 * } |
| 242 * } |
| 243 * ``` |
| 244 * |
| 245 * A 4th optional $root-selector argument can be given, which will be passed to
`mdc-rtl`. |
| 246 */ |
| 247 /** |
| 248 * Takes an argument specifying a horizontal position property (either "left" or
"right") as well |
| 249 * as a value, and applies that value to the specified position in a LTR context
, and flips it in a |
| 250 * RTL context. For example: |
| 251 * |
| 252 * ```scss |
| 253 * .mdc-foo { |
| 254 * @include mdc-rtl-reflexive-position(left, 0); |
| 255 * position: absolute; |
| 256 * } |
| 257 * ``` |
| 258 * is equivalent to: |
| 259 * |
| 260 * ```scss |
| 261 * .mdc-foo { |
| 262 * position: absolute; |
| 263 * left: 0; |
| 264 * right: initial; |
| 265 * |
| 266 * @include mdc-rtl { |
| 267 * right: 0; |
| 268 * left: initial; |
| 269 * } |
| 270 * } |
| 271 * ``` |
| 272 * An optional third $root-selector argument may also be given, which is passed
to `mdc-rtl`. |
| 273 */ |
| 274 .mdc-card { |
| 275 box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0,
0.14); |
| 276 display: flex; |
| 277 flex-direction: column; |
| 278 justify-content: flex-end; |
| 279 padding: 0; |
| 280 box-sizing: border-box; } |
| 281 .mdc-card__primary { |
| 282 padding: 16px; } |
| 283 .mdc-card__primary .mdc-card__title--large { |
| 284 padding-top: 8px; } |
| 285 .mdc-card__primary:last-child { |
| 286 padding-bottom: 24px; } |
| 287 .mdc-card__supporting-text { |
| 288 padding: 8px 16px; |
| 289 box-sizing: border-box; |
| 290 font-family: Roboto, sans-serif; |
| 291 -moz-osx-font-smoothing: grayscale; |
| 292 -webkit-font-smoothing: antialiased; |
| 293 font-size: 0.875rem; |
| 294 font-weight: 400; |
| 295 letter-spacing: 0.04em; |
| 296 line-height: 1.25rem; |
| 297 color: rgba(0, 0, 0, 0.87); |
| 298 color: var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87)); } |
| 299 .mdc-card--theme-dark .mdc-card__supporting-text, .mdc-theme--dark .mdc-card
__supporting-text { |
| 300 color: white; |
| 301 color: var(--mdc-theme-text-primary-on-dark, white); } |
| 302 .mdc-card__primary + .mdc-card__supporting-text { |
| 303 margin-top: -8px; |
| 304 padding-top: 0; } |
| 305 .mdc-card__supporting-text:last-child { |
| 306 padding-bottom: 24px; } |
| 307 .mdc-card__actions { |
| 308 display: flex; |
| 309 padding: 8px; |
| 310 box-sizing: border-box; } |
| 311 .mdc-card--theme-dark .mdc-card__actions, .mdc-theme--dark .mdc-card__action
s { |
| 312 color: white; |
| 313 color: var(--mdc-theme-text-primary-on-dark, white); } |
| 314 .mdc-card__actions .mdc-card__action { |
| 315 margin: 0 8px 0 0; } |
| 316 [dir="rtl"] .mdc-card__actions .mdc-card__action, .mdc-card__actions .mdc-
card__action[dir="rtl"] { |
| 317 margin: 0 0 0 8px; } |
| 318 .mdc-card__actions .mdc-card__action:last-child { |
| 319 margin-left: 0; |
| 320 margin-right: 0; } |
| 321 [dir="rtl"] .mdc-card__actions .mdc-card__action:last-child, .mdc-card__ac
tions .mdc-card__action:last-child[dir="rtl"] { |
| 322 margin-left: 0; |
| 323 margin-right: 0; } |
| 324 .mdc-card__actions--vertical { |
| 325 flex-flow: column; |
| 326 align-items: flex-start; } |
| 327 .mdc-card__actions--vertical .mdc-card__action { |
| 328 margin: 0 0 4px; } |
| 329 .mdc-card__actions--vertical .mdc-card__action:last-child { |
| 330 margin-bottom: 0; } |
| 331 .mdc-card__media { |
| 332 display: flex; |
| 333 flex-direction: column; |
| 334 justify-content: flex-end; |
| 335 padding: 16px; |
| 336 box-sizing: border-box; } |
| 337 .mdc-card__media-item { |
| 338 display: inline-block; |
| 339 width: auto; |
| 340 height: 80px; |
| 341 margin: 16px 0 0; |
| 342 padding: 0; } |
| 343 .mdc-card__media-item--1dot5x { |
| 344 width: auto; |
| 345 height: 120px; } |
| 346 .mdc-card__media-item--2x { |
| 347 width: auto; |
| 348 height: 160px; } |
| 349 .mdc-card__media-item--3x { |
| 350 width: auto; |
| 351 height: 240px; } |
| 352 .mdc-card__title { |
| 353 font-family: Roboto, sans-serif; |
| 354 -moz-osx-font-smoothing: grayscale; |
| 355 -webkit-font-smoothing: antialiased; |
| 356 font-size: 0.875rem; |
| 357 font-weight: 500; |
| 358 letter-spacing: 0.04em; |
| 359 line-height: 1.5rem; |
| 360 color: rgba(0, 0, 0, 0.87); |
| 361 color: var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87)); |
| 362 margin: -.063rem 0; } |
| 363 .mdc-card--theme-dark .mdc-card__title, .mdc-theme--dark .mdc-card__title { |
| 364 color: white; |
| 365 color: var(--mdc-theme-text-primary-on-dark, white); } |
| 366 .mdc-card__title--large { |
| 367 font-family: Roboto, sans-serif; |
| 368 -moz-osx-font-smoothing: grayscale; |
| 369 -webkit-font-smoothing: antialiased; |
| 370 font-size: 1.5rem; |
| 371 font-weight: 400; |
| 372 letter-spacing: normal; |
| 373 line-height: 2rem; |
| 374 margin: 0; } |
| 375 .mdc-card__subtitle { |
| 376 font-family: Roboto, sans-serif; |
| 377 -moz-osx-font-smoothing: grayscale; |
| 378 -webkit-font-smoothing: antialiased; |
| 379 font-size: 0.875rem; |
| 380 font-weight: 400; |
| 381 letter-spacing: 0.04em; |
| 382 line-height: 1.25rem; |
| 383 color: rgba(0, 0, 0, 0.87); |
| 384 color: var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87)); |
| 385 margin: -.063rem 0; } |
| 386 .mdc-card--theme-dark .mdc-card__subtitle, .mdc-theme--dark .mdc-card__subti
tle { |
| 387 color: white; |
| 388 color: var(--mdc-theme-text-primary-on-dark, white); } |
| 389 .mdc-card__horizontal-block { |
| 390 display: flex; |
| 391 flex-direction: row; |
| 392 align-items: flex-start; |
| 393 justify-content: space-between; |
| 394 box-sizing: border-box; |
| 395 padding: 0; |
| 396 padding-left: 0; |
| 397 padding-right: 16px; } |
| 398 [dir="rtl"] .mdc-card__horizontal-block, .mdc-card__horizontal-block[dir="rt
l"] { |
| 399 padding-left: 16px; |
| 400 padding-right: 0; } |
| 401 .mdc-card__horizontal-block .mdc-card__actions--vertical { |
| 402 margin: 16px; } |
| 403 .mdc-card__horizontal-block .mdc-card__media-item { |
| 404 margin-left: 16px; |
| 405 margin-right: 0; } |
| 406 [dir="rtl"] .mdc-card__horizontal-block .mdc-card__media-item, .mdc-card__
horizontal-block .mdc-card__media-item[dir="rtl"] { |
| 407 margin-left: 0; |
| 408 margin-right: 16px; } |
| 409 .mdc-card__horizontal-block .mdc-card__media-item--3x { |
| 410 margin-bottom: 16px; } |
| 411 |
| 412 /*# sourceMappingURL=mdc-card.css.map */ |
| OLD | NEW |