2017-02-08 11:43:28 -05:00
|
|
|
|
// ==========================================================================
|
|
|
|
|
|
// Generic / Media
|
|
|
|
|
|
// ==========================================================================
|
2016-12-18 15:45:44 -05:00
|
|
|
|
|
2017-02-08 11:43:28 -05:00
|
|
|
|
// 1. Setting `vertical-align` removes the whitespace that appears under `img`
|
|
|
|
|
|
// elements when they are dropped into a page as-is. Safer alternative to
|
|
|
|
|
|
// using `display: block;`.
|
2022-05-12 16:15:44 +02:00
|
|
|
|
|
2016-12-18 15:45:44 -05:00
|
|
|
|
audio,
|
|
|
|
|
|
canvas,
|
|
|
|
|
|
iframe,
|
|
|
|
|
|
img,
|
|
|
|
|
|
svg,
|
|
|
|
|
|
video {
|
2022-05-12 16:15:44 +02:00
|
|
|
|
vertical-align: middle; // [1]
|
2016-12-18 15:45:44 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-08 11:43:28 -05:00
|
|
|
|
// Add the correct display in iOS 4-7.
|
2022-05-12 16:15:44 +02:00
|
|
|
|
|
2016-12-18 15:45:44 -05:00
|
|
|
|
audio:not([controls]) {
|
|
|
|
|
|
display: none;
|
|
|
|
|
|
height: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-08 11:43:28 -05:00
|
|
|
|
// 2. Fluid media for responsive purposes.
|
2022-05-12 16:15:44 +02:00
|
|
|
|
|
2016-12-18 15:45:44 -05:00
|
|
|
|
img,
|
|
|
|
|
|
svg {
|
2022-05-12 16:15:44 +02:00
|
|
|
|
max-width: 100%; // [2]
|
2017-04-27 16:00:45 -04:00
|
|
|
|
height: auto;
|
2016-12-18 15:45:44 -05:00
|
|
|
|
|
2022-05-17 12:08:01 +02:00
|
|
|
|
// 4. If a `width` and/or `height` attribute have been explicitly defined,
|
|
|
|
|
|
// let’s not make the image fluid.
|
2022-05-12 16:15:44 +02:00
|
|
|
|
|
|
|
|
|
|
&[width], // [4]
|
2017-04-27 16:00:45 -04:00
|
|
|
|
&[height] {
|
2022-05-12 16:15:44 +02:00
|
|
|
|
// [4]
|
2016-12-18 15:45:44 -05:00
|
|
|
|
max-width: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-08 11:43:28 -05:00
|
|
|
|
// 4. Offset `alt` text from surrounding copy.
|
2022-05-12 16:15:44 +02:00
|
|
|
|
|
2016-12-18 15:45:44 -05:00
|
|
|
|
img {
|
2022-05-12 16:15:44 +02:00
|
|
|
|
font-style: italic; // [4]
|
2016-12-18 15:45:44 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-02-08 11:43:28 -05:00
|
|
|
|
// 5. SVG elements should fallback to their surrounding text color.
|
2022-05-12 16:15:44 +02:00
|
|
|
|
|
2016-12-18 15:45:44 -05:00
|
|
|
|
svg {
|
2022-05-12 16:15:44 +02:00
|
|
|
|
fill: currentColor; // [5]
|
2016-12-18 15:45:44 -05:00
|
|
|
|
}
|