_site-featured-image.scss 5.4 KB

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