_site-featured-image.scss 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. &:before {
  94. background: $color__background-body;
  95. }
  96. }
  97. /* Entry meta */
  98. .entry-meta {
  99. font-weight: 500;
  100. > span {
  101. margin-right: $size__spacing-unit;
  102. display: inline-block;
  103. &:last-child {
  104. margin-right: 0;
  105. }
  106. }
  107. a {
  108. @include link-transition;
  109. color: currentColor;
  110. &:hover {
  111. text-decoration: none;
  112. }
  113. }
  114. .svg-icon {
  115. position: relative;
  116. display: inline-block;
  117. vertical-align: middle;
  118. margin-right: 0.5em;
  119. }
  120. .discussion-avatar-list {
  121. display: none;
  122. }
  123. }
  124. &.has-discussion {
  125. @include media (tablet) {
  126. .entry-meta {
  127. display: flex;
  128. position: relative;
  129. }
  130. .entry-title {
  131. padding-right: calc(1 * (100vw / 12) + #{$size__spacing-unit});
  132. }
  133. .entry-meta .comment-count {
  134. position: absolute;
  135. right: 0;
  136. }
  137. .entry-meta .discussion-avatar-list {
  138. display: block;
  139. position: absolute;
  140. bottom: 100%;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. /* Custom Logo Link */
  147. .custom-logo-link {
  148. background: $color__background-body;
  149. box-shadow: 0 0 0 0 rgba($color__background-body, 0);
  150. &:hover,
  151. &:active,
  152. &:focus {
  153. box-shadow: 0 0 0 2px rgba($color__background-body, 1);
  154. }
  155. }
  156. /* Make sure important elements are above pseudo elements used for effects. */
  157. .site-branding {
  158. position: relative;
  159. z-index: 10;
  160. }
  161. .site-featured-image .entry-header {
  162. position: relative;
  163. z-index: 9;
  164. }
  165. /* Set up image filter layer positioning */
  166. .site-branding-container:after,
  167. .site-featured-image:before,
  168. .site-featured-image:after,
  169. &:after {
  170. display: block;
  171. position: absolute;
  172. top: 0; left: 0;
  173. content: "\020";
  174. width: 100%;
  175. height: 100%;
  176. }
  177. /* Background & Effects */
  178. /* Shared background settings between pseudo elements. */
  179. background-position: center;
  180. background-repeat: no-repeat;
  181. background-size: cover;
  182. /* The intensity of each blend mode is controlled via layer opacity. */
  183. /* Second layer: screen. */
  184. .image-filters-enabled & .site-featured-image:before {
  185. background: $color__link;
  186. mix-blend-mode: screen;
  187. opacity: 0.1;
  188. }
  189. /* Third layer: multiply. */
  190. /* When image filters are inactive, a black overlay is added. */
  191. .site-featured-image:after {
  192. background: #000;
  193. mix-blend-mode: multiply;
  194. opacity: .7;
  195. /* When image filters are active, a blue overlay is added. */
  196. .image-filters-enabled & {
  197. background: $color__link;
  198. opacity: .8;
  199. z-index: 3;
  200. /* Browsers supporting mix-blend-mode don't need opacity < 1 */
  201. @supports (mix-blend-mode: multiply) {
  202. opacity: 1;
  203. }
  204. }
  205. }
  206. /* Fourth layer: overlay. */
  207. .image-filters-enabled & .site-branding-container:after {
  208. background: rgba(0, 0, 0, 0.35);
  209. mix-blend-mode: overlay;
  210. opacity: 0.5;
  211. z-index: 4;
  212. /* Browsers supporting mix-blend-mode can have a light overlay */
  213. @supports (mix-blend-mode: overlay) {
  214. background: rgba($color__background-body, 0.35);
  215. }
  216. }
  217. /* Fifth layer: readability overlay */
  218. &:after {
  219. background: #000;
  220. /**
  221. * Add a transition to the readability overlay, to add a subtle
  222. * but smooth effect when resizing the screen.
  223. */
  224. transition: opacity 1200ms ease-in-out;
  225. opacity: 0.7;
  226. z-index: 5;
  227. /* When image filters are active, a blue overlay is added. */
  228. .image-filters-enabled & {
  229. background: mix($color__link, black, 12%);
  230. opacity: 0.38;
  231. @include media(tablet) {
  232. opacity: 0.18;
  233. }
  234. }
  235. }
  236. ::-moz-selection {
  237. background: rgba($color__background-body, 0.17);
  238. }
  239. ::selection {
  240. background: rgba($color__background-body, 0.17);
  241. }
  242. }