_site-featured-image.scss 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. // Featured image styles
  2. .site-header.featured-image {
  3. /* Hide overflow for overflowing featured image */
  4. overflow: hidden;
  5. /* Need relative positioning to properly align layers. */
  6. position: relative;
  7. /* Add text shadow to text, to increase readability. */
  8. text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  9. .main-navigation a,
  10. .main-navigation .main-menu > li,
  11. .main-navigation a + svg,
  12. .social-navigation a,
  13. .site-title a,
  14. .site-featured-image a {
  15. color: #fff;
  16. transition: opacity $link_transition ease-in-out;
  17. &:hover,
  18. &:active,
  19. &:hover + svg,
  20. &:active + svg {
  21. color: $color__text-light;
  22. opacity: 0.6;
  23. }
  24. &:focus,
  25. &:focus + svg {
  26. color: $color__background-body;
  27. }
  28. }
  29. .main-navigation .sub-menu a {
  30. opacity: inherit;
  31. }
  32. /* add focus state to social media icons */
  33. .social-navigation a {
  34. &:focus {
  35. color: $color__background-body;
  36. opacity: 1;
  37. border-bottom: 1px solid $color__background-body;
  38. }
  39. }
  40. .social-navigation svg,
  41. .site-featured-image svg {
  42. /* Use -webkit- only if supporting: Chrome < 54, iOS < 9.3, Android < 4.4.4 */
  43. -webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35) );
  44. filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35) );
  45. }
  46. /* Entry header */
  47. .site-featured-image {
  48. /* First layer: grayscale. */
  49. .post-thumbnail img {
  50. height: auto;
  51. left: 50%;
  52. max-width: 1000%;
  53. min-height: 100%;
  54. min-width: 100vw;
  55. position: absolute;
  56. top: 50%;
  57. transform: translateX(-50%) translateY(-50%);
  58. width: auto;
  59. z-index: 1;
  60. @supports ( object-fit: cover ) {
  61. height: 100%;
  62. left: 0;
  63. object-fit: cover;
  64. top: 0;
  65. transform: none;
  66. width: 100%;
  67. }
  68. /* When image filters are active, make it grayscale to colorize it blue. */
  69. .image-filters-enabled & {
  70. filter: grayscale(100%);
  71. }
  72. }
  73. .entry-header {
  74. margin-top: calc( 4 * #{$size__spacing-unit});
  75. margin-bottom: 0;
  76. margin-left: 0;
  77. margin-right: 0;
  78. text-align: center;
  79. @include media (tablet) {
  80. margin-left: $size__site-margins;
  81. margin-right: $size__site-margins;
  82. }
  83. .entry-title {
  84. &:before {
  85. background: $color__background-body;
  86. }
  87. }
  88. /* Entry meta */
  89. .entry-meta {
  90. font-weight: 500;
  91. text-align: center;
  92. > span {
  93. margin-right: $size__spacing-unit;
  94. display: inline-block;
  95. &:last-child {
  96. margin-right: 0;
  97. }
  98. }
  99. a {
  100. @include link-transition;
  101. color: currentColor;
  102. &:hover {
  103. text-decoration: none;
  104. }
  105. }
  106. .svg-icon {
  107. position: relative;
  108. display: inline-block;
  109. vertical-align: middle;
  110. margin-right: 0.5em;
  111. }
  112. .discussion-avatar-list {
  113. display: none;
  114. }
  115. }
  116. &.has-discussion {
  117. @include media (tablet) {
  118. .entry-meta {
  119. display: flex;
  120. position: relative;
  121. }
  122. .entry-title {
  123. padding-right: calc(1 * (100vw / 12) + #{$size__spacing-unit});
  124. }
  125. .entry-meta .comment-count {
  126. position: absolute;
  127. right: 0;
  128. }
  129. .entry-meta .discussion-avatar-list {
  130. display: block;
  131. position: absolute;
  132. bottom: 100%;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. /* Make sure important elements are above pseudo elements used for effects. */
  139. .site-branding {
  140. position: relative;
  141. z-index: 10;
  142. }
  143. .site-featured-image .entry-header {
  144. position: relative;
  145. z-index: 9;
  146. }
  147. /* Set up image filter layer positioning */
  148. .site-branding-container:after,
  149. .site-featured-image:before,
  150. .site-featured-image:after,
  151. &:after {
  152. display: block;
  153. position: absolute;
  154. top: 0; left: 0;
  155. content: "\020";
  156. width: 100%;
  157. height: 100%;
  158. }
  159. /* Background & Effects */
  160. /* Shared background settings between pseudo elements. */
  161. background-position: center;
  162. background-repeat: no-repeat;
  163. background-size: cover;
  164. /* The intensity of each blend mode is controlled via layer opacity. */
  165. /* Second layer: screen. */
  166. .image-filters-enabled & .site-featured-image:before {
  167. background: $color__link;
  168. mix-blend-mode: screen;
  169. opacity: 0.1;
  170. }
  171. /* Third layer: multiply. */
  172. /* When image filters are inactive, a black overlay is added. */
  173. .site-featured-image:after {
  174. background: #000;
  175. mix-blend-mode: multiply;
  176. opacity: .7;
  177. /* When image filters are active, a blue overlay is added. */
  178. .image-filters-enabled & {
  179. background: $color__link;
  180. opacity: .8;
  181. z-index: 3;
  182. /* Browsers supporting mix-blend-mode don't need opacity < 1 */
  183. @supports (mix-blend-mode: multiply) {
  184. opacity: 1;
  185. }
  186. }
  187. }
  188. /* Fourth layer: overlay. */
  189. .image-filters-enabled & .site-branding-container:after {
  190. background: rgba(0, 0, 0, 0.35);
  191. mix-blend-mode: overlay;
  192. opacity: 0.5;
  193. z-index: 4;
  194. /* Browsers supporting mix-blend-mode can have a light overlay */
  195. @supports (mix-blend-mode: overlay) {
  196. background: rgba($color__background-body, 0.35);
  197. }
  198. }
  199. /* Fifth layer: readability overlay */
  200. &:after {
  201. background: #000;
  202. /**
  203. * Add a transition to the readability overlay, to add a subtle
  204. * but smooth effect when resizing the screen.
  205. */
  206. transition: opacity 1200ms ease-in-out;
  207. opacity: 0.7;
  208. z-index: 5;
  209. /* When image filters are active, a blue overlay is added. */
  210. .image-filters-enabled & {
  211. background: mix($color__link, black, 12%);
  212. opacity: 0.38;
  213. @include media(tablet) {
  214. opacity: 0.18;
  215. }
  216. }
  217. }
  218. ::-moz-selection {
  219. background: rgba($color__background-body, 0.17);
  220. }
  221. ::selection {
  222. background: rgba($color__background-body, 0.17);
  223. }
  224. }