_image.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. ///
  2. /// Paradigm Shift by HTML5 UP
  3. /// html5up.net | @ajlkn
  4. /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
  5. ///
  6. /* Image */
  7. .image {
  8. border: 0;
  9. display: inline-block;
  10. position: relative;
  11. img {
  12. display: block;
  13. }
  14. &[data-position] {
  15. img {
  16. @include vendor('object-fit', 'cover');
  17. display: block;
  18. position: absolute;
  19. top: 0;
  20. left: 0;
  21. width: 100%;
  22. height: 100%;
  23. }
  24. }
  25. &[data-position="top left"] {
  26. img {
  27. @include vendor('object-position', 'top left');
  28. }
  29. }
  30. &[data-position="top"] {
  31. img {
  32. @include vendor('object-position', 'top');
  33. }
  34. }
  35. &[data-position="top right"] {
  36. img {
  37. @include vendor('object-position', 'top right');
  38. }
  39. }
  40. &[data-position="right"] {
  41. img {
  42. @include vendor('object-position', 'right');
  43. }
  44. }
  45. &[data-position="bottom right"] {
  46. img {
  47. @include vendor('object-position', 'bottom right');
  48. }
  49. }
  50. &[data-position="bottom"] {
  51. img {
  52. @include vendor('object-position', 'bottom');
  53. }
  54. }
  55. &[data-position="bottom left"] {
  56. img {
  57. @include vendor('object-position', 'bottom left');
  58. }
  59. }
  60. &[data-position="left"] {
  61. img {
  62. @include vendor('object-position', 'left');
  63. }
  64. }
  65. &[data-position="center"] {
  66. img {
  67. @include vendor('object-position', 'center');
  68. }
  69. }
  70. &[data-position="25% 25%"] {
  71. img {
  72. @include vendor('object-position', '25% 25%');
  73. }
  74. }
  75. &[data-position="75% 25%"] {
  76. img {
  77. @include vendor('object-position', '75% 25%');
  78. }
  79. }
  80. &[data-position="75% 75%"] {
  81. img {
  82. @include vendor('object-position', '75% 75%');
  83. }
  84. }
  85. &[data-position="25% 75%"] {
  86. img {
  87. @include vendor('object-position', '25% 75%');
  88. }
  89. }
  90. &.left,
  91. &.right {
  92. max-width: 40%;
  93. img {
  94. width: 100%;
  95. }
  96. }
  97. &.left {
  98. float: left;
  99. margin: 0 2rem 2rem 0;
  100. top: 0.25rem;
  101. }
  102. &.right {
  103. float: right;
  104. margin: 0 0 2rem 2rem;
  105. top: 0.25rem;
  106. }
  107. &.fit {
  108. display: block;
  109. margin: 0 0 _size(element-margin) 0;
  110. width: 100%;
  111. img {
  112. width: 100%;
  113. }
  114. }
  115. &.main {
  116. display: block;
  117. margin: (_size(element-margin) * 1.5) 0;
  118. width: 100%;
  119. img {
  120. width: 100%;
  121. }
  122. &:first-child {
  123. margin-top: 0;
  124. }
  125. }
  126. &.fill {
  127. height: 100%;
  128. left: 0;
  129. position: absolute;
  130. top: 0;
  131. width: 100%;
  132. img {
  133. //@include vendor('object-fit', 'cover');
  134. //@include vendor('object-position', 'center');
  135. height: 100%;
  136. left: 0;
  137. position: absolute;
  138. top: 0;
  139. width: 100%;
  140. }
  141. }
  142. }