_site-featured-image.scss 6.1 KB

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