You are here

blazy.ratio.css in Blazy 8.2

Same filename and directory in other branches
  1. 8 css/components/blazy.ratio.css
  2. 7 css/components/blazy.ratio.css

The CSS and class names below are based on Slick media for easy migration.

File

css/components/blazy.ratio.css
View source
  1. /**
  2. * @file
  3. * The CSS and class names below are based on Slick media for easy migration.
  4. */
  5. /**
  6. * Aspect ratio element wrapper. So can use dynamic/fluid ratio via JS which is
  7. * not possible using ::pseudo selector approach.
  8. */
  9. .media.media--ratio {
  10. display: block;
  11. height: 0;
  12. /* Fixed for overflowing video with hard-coded width like lightboxes. */
  13. max-width: 100%;
  14. min-height: 1px;
  15. overflow: hidden;
  16. position: relative;
  17. width: 100%;
  18. }
  19. /* Trying to be nice to minimize abrupt changes. */
  20. .media--ratio.is-b-loaded {
  21. transition: padding-bottom .2s;
  22. }
  23. /* 1:1 ratio */
  24. .media--ratio--11 {
  25. padding-bottom: 100%;
  26. }
  27. /* 3:2 ratio */
  28. .media--ratio--32 {
  29. padding-bottom: 66.66%;
  30. }
  31. /* 4:3 ratio */
  32. .media--ratio--43 {
  33. padding-bottom: 75%;
  34. }
  35. /* 8:5 ratio */
  36. .media--ratio--85 {
  37. padding-bottom: 62.5%;
  38. }
  39. /* 16:9 ratio */
  40. .media--ratio--169 {
  41. padding-bottom: 56.25%;
  42. }