diff options
| Commit | c811cb46631e66772a108c393f6ef53a83ca010b (patch) | |
|---|---|---|
| Author | 2017-09-01 15:34:29 +0800 | |
| Committer | 2017-09-01 15:34:29 +0800 | |
| Files | cc78dfa6f7398e9e77dd81d8865bcca939b9549d /src/_media.scss | |
| Spectre-Dark-Gruvbox-0.4.0.tar Spectre-Dark-Gruvbox-0.4.0.tar.gz Spectre-Dark-Gruvbox-0.4.0.zip | ||
| Parent | 66c492fd05c2d720c81e2be8d6845560b868e7ff (diff) | |
| Parent | cca094ecbf55e8a4f552e55219b37373d3c07d9e (diff) | |
Merge pull request #266 from picturepan2/0.4.0 v0.4.0
0.4.0
1 files changed, 70 insertions, 0 deletions
| -rw-r--r-- | src/_media.scss | 70 |
diff --git a/src/_media.scss b/src/_media.scss new file mode 100644 index 0000000..9b6aa1d --- /dev/null +++ b/src/_media.scss @@ -0,0 +1,70 @@ +// Media +.img-responsive { + display: block; + height: auto; + max-width: 100%; +} + +// object-fit support is coming to Microsoft Edge +// https://developer.microsoft.com/en-us/microsoft-edge/platform/status/objectfitandobjectposition/ +.img-fit-cover { + object-fit: cover; +} + +.img-fit-contain { + object-fit: contain; +} + +// Video responsive +.video-responsive { + display: block; + overflow: hidden; + padding: 0; + position: relative; + width: 100%; + &::before { + content: ""; + display: block; + padding-bottom: 56.25%; // Default ratio 16:9, you can calculate this value by dividing 9 by 16 + } + + iframe, + object, + embed { + border: 0; + bottom: 0; + height: 100%; + left: 0; + position: absolute; + right: 0; + top: 0; + width: 100%; + } + + video { + height: auto; + max-width: 100%; + width: 100%; + } +} + +.video-responsive-4-3 { + &::before { + padding-bottom: 75%; // Ratio 4:3 + } +} + +.video-responsive-1-1 { + &::before { + padding-bottom: 100%; // Ratio 1:1 + } +} + +.figure { + margin: 0 0 $layout-spacing 0; + + .figure-caption { + color: $gray-color-dark; + margin-top: $layout-spacing; + } +} |