blazy.ratio.css in Blazy 7
Same filename and directory in other branches
The CSS and class names below are based on Slick media for easy migration.
File
css/components/blazy.ratio.cssView source
- /**
- * @file
- * The CSS and class names below are based on Slick media for easy migration.
- */
-
- /* Touch me not! */
- .media {
- position: relative;
- }
-
- /**
- * Aspect ratio element wrapper. So can use dynamic/fluid ratio via JS which is
- * not possible using ::pseudo selector approach.
- */
- .media.media--ratio {
- display: block;
- height: 0;
- overflow: hidden;
- width: 100%;
- }
-
- /* Aspect ratio element: IMG, IFRAME, DIV. */
- .media--ratio .media__element {
- display: block;
- height: 100%;
- left: 0;
- position: absolute;
- top: 0;
- width: 100%;
- z-index: 0;
- /** Temp fix, also to fix the VIDEO element to max width, not only IMG. */
- object-fit: cover;
- }
-
- /* 1:1 ratio */
- .media--ratio--11 {
- padding-bottom: 100%;
- }
-
- /* 3:2 ratio */
- .media--ratio--32 {
- padding-bottom: 66.66%;
- }
-
- /* 4:3 ratio */
- .media--ratio--43 {
- padding-bottom: 75%;
- }
-
- /* 8:5 ratio */
- .media--ratio--85 {
- padding-bottom: 62.5%;
- }
-
- /* 16:9 ratio */
- .media--ratio--169 {
- padding-bottom: 56.25%;
- }