Changeset 44149 for trunk/src/wp-content/themes/twentynineteen/sass/site/header/_site-featured-image.scss
- Timestamp:
- 12/14/2018 02:32:33 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43808,43821,43842,43860,43892,43904,43909,43926-43929,43956,43961-43963
- Property svn:mergeinfo changed
-
trunk/src/wp-content/themes/twentynineteen/sass/site/header/_site-featured-image.scss
r43808 r44149 2 2 3 3 .site-header.featured-image { 4 5 /* Hide overflow for overflowing featured image */ 6 overflow: hidden; 4 7 5 8 /* Need relative positioning to properly align layers. */ … … 7 10 8 11 /* Add text shadow to text, to increase readability. */ 9 text-shadow: 0 1px 2px rgba( black, 0.35);12 text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); 10 13 11 14 /* Set white text color when featured image is set. */ … … 18 21 .entry-meta, 19 22 .entry-title { 20 color: white;23 color: $color__background-body; 21 24 } 22 25 23 26 .main-navigation a, 27 .main-navigation a + svg, 24 28 .social-navigation a, 25 29 .site-title a, 26 . hentrya {27 color: white;30 .site-featured-image a { 31 color: $color__background-body; 28 32 transition: opacity $link_transition ease-in-out; 29 33 30 34 &:hover, 31 &:active { 32 color: white; 35 &:active, 36 &:hover + svg, 37 &:active + svg { 38 color: $color__background-body; 33 39 opacity: 0.6; 34 40 } 35 41 36 &:focus { 37 color: white; 38 } 39 } 40 41 // add focus state to social media icons 42 &:focus, 43 &:focus + svg { 44 color: $color__background-body; 45 } 46 } 47 48 /* add focus state to social media icons */ 42 49 .social-navigation a { 43 50 &:focus { 44 color: white;51 color: $color__background-body; 45 52 opacity: 1; 46 border-bottom: 1px solid white;53 border-bottom: 1px solid $color__background-body; 47 54 } 48 55 } 49 56 50 57 .social-navigation svg, 51 . hentrysvg {58 .site-featured-image svg { 52 59 /* Use -webkit- only if supporting: Chrome < 54, iOS < 9.3, Android < 4.4.4 */ 53 -webkit-filter: drop-shadow(0 1px 2px rgba(black, 0.35) ); 54 filter: drop-shadow(0 1px 2px rgba(black, 0.35) ); 55 } 56 57 /* Post header styles */ 58 .hentry .entry-header { 59 60 margin-left: 0; 61 margin-right: 0; 62 63 @include media (tablet) { 64 65 margin-left: calc(2 * (100vw / 12)); 66 margin-right: calc(2 * (100vw / 12)); 67 } 68 69 .entry-title { 70 71 &:before { 72 background: white; 60 -webkit-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35) ); 61 filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35) ); 62 } 63 64 /* Entry header */ 65 .site-featured-image { 66 67 /* First layer: grayscale. */ 68 .post-thumbnail img { 69 height: auto; 70 left: 50%; 71 max-width: 1000%; 72 min-height: 100%; 73 min-width: 100vw; 74 position: absolute; 75 top: 50%; 76 transform: translateX(-50%) translateY(-50%); 77 width: auto; 78 z-index: 1; 79 80 @supports ( object-fit: cover ) { 81 height: 100%; 82 left: 0; 83 object-fit: cover; 84 top: 0; 85 transform: none; 86 width: 100%; 87 } 88 89 /* When image filters are active, make it grayscale to colorize it blue. */ 90 .image-filters-enabled & { 91 filter: grayscale(100%); 92 } 93 } 94 95 .entry-header { 96 97 margin-top: calc( 4 * #{$size__spacing-unit}); 98 margin-bottom: 0; 99 margin-left: 0; 100 margin-right: 0; 101 102 @include media (tablet) { 103 104 margin-left: $size__site-margins; 105 margin-right: $size__site-margins; 106 } 107 108 .entry-title { 109 110 &:before { 111 background: $color__background-body; 112 } 113 } 114 115 /* Entry meta */ 116 117 .entry-meta { 118 119 font-weight: 500; 120 121 > span { 122 123 margin-right: $size__spacing-unit; 124 display: inline-block; 125 126 &:last-child { 127 margin-right: 0; 128 } 129 } 130 131 a { 132 133 @include link-transition; 134 color: currentColor; 135 136 &:hover { 137 text-decoration: none; 138 } 139 } 140 141 .svg-icon { 142 position: relative; 143 display: inline-block; 144 vertical-align: middle; 145 margin-right: 0.5em; 146 } 147 148 .discussion-avatar-list { 149 display: none; 150 } 151 } 152 153 &.has-discussion { 154 155 @include media (tablet) { 156 157 .entry-meta { 158 display: flex; 159 position: relative; 160 } 161 162 .entry-title { 163 padding-right: calc(1 * (100vw / 12) + #{$size__spacing-unit}); 164 } 165 166 .entry-meta .comment-count { 167 position: absolute; 168 right: 0; 169 } 170 171 .entry-meta .discussion-avatar-list { 172 display: block; 173 position: absolute; 174 bottom: 100%; 175 } 176 } 73 177 } 74 178 } … … 79 183 .custom-logo-link { 80 184 81 background: white;82 box-shadow: 0 0 0 0 rgba( white, 0);185 background: $color__background-body; 186 box-shadow: 0 0 0 0 rgba($color__background-body, 0); 83 187 84 188 &:hover, 85 189 &:active, 86 190 &:focus { 87 box-shadow: 0 0 0 2px rgba( white, 1);191 box-shadow: 0 0 0 2px rgba($color__background-body, 1); 88 192 } 89 193 } 90 194 91 195 /* Make sure important elements are above pseudo elements used for effects. */ 92 .site-branding ,93 .hentry .entry-header {196 .site-branding { 197 position: relative; 94 198 z-index: 10; 95 199 } 96 200 201 .site-featured-image .entry-header { 202 position: relative; 203 z-index: 9; 204 } 205 97 206 /* Set up image filter layer positioning */ 98 .site-branding-container:before,99 207 .site-branding-container:after, 100 . hentry:before,101 . hentry:after,208 .site-featured-image:before, 209 .site-featured-image:after, 102 210 &:after { 103 211 display: block; … … 110 218 111 219 /* Background & Effects */ 112 /* Shared background settings between pseudo elements. See .site-branding-container*/220 /* Shared background settings between pseudo elements. */ 113 221 background-position: center; 114 222 background-repeat: no-repeat; … … 117 225 /* The intensity of each blend mode is controlled via layer opacity. */ 118 226 119 /* First layer: grayscale. */120 .site-branding-container:before {121 background-position: center;122 background-repeat: no-repeat;123 background-size: cover;124 filter: grayscale(100%);125 z-index: 1;126 }127 128 227 /* Second layer: screen. */ 129 . hentry:before {228 .image-filters-enabled & .site-featured-image:before { 130 229 background: $color__link; 131 230 mix-blend-mode: screen; 132 231 opacity: 0.1; 133 z-index: 2;134 232 } 135 233 136 234 /* Third layer: multiply. */ 137 .hentry:after { 138 background: $color__link; 235 /* When image filters are inactive, a black overlay is added. */ 236 .site-featured-image:after { 237 background: #000; 139 238 mix-blend-mode: multiply; 140 opacity: 1; 141 z-index: 3; 239 opacity: .7; 240 241 /* When image filters are active, a blue overlay is added. */ 242 .image-filters-enabled & { 243 background: $color__link; 244 opacity: .8; 245 z-index: 3; 246 247 /* Browsers supporting mix-blend-mode don't need opacity < 1 */ 248 @supports (mix-blend-mode: multiply) { 249 opacity: 1; 250 } 251 } 142 252 } 143 253 144 254 /* Fourth layer: overlay. */ 145 146 background: rgba( white, 0.35);255 .image-filters-enabled & .site-branding-container:after { 256 background: rgba(0, 0, 0, 0.35); 147 257 mix-blend-mode: overlay; 148 258 opacity: 0.5; 149 259 z-index: 4; 260 261 /* Browsers supporting mix-blend-mode can have a light overlay */ 262 @supports (mix-blend-mode: overlay) { 263 background: rgba($color__background-body, 0.35); 264 } 150 265 } 151 266 152 267 /* Fifth layer: readability overlay */ 153 268 &:after { 154 background: mix($color__link, black, 12%); 155 269 background: #000; 156 270 /** 157 271 * Add a transition to the readability overlay, to add a subtle … … 159 273 */ 160 274 transition: opacity 1200ms ease-in-out; 161 275 opacity: 0.7; 162 276 z-index: 5; 163 opacity: 0.38; 164 165 @include media(tablet) { 166 opacity: 0.18; 167 } 168 169 @include media(desktop) { 170 opacity: 0.1; 171 } 172 } 277 278 /* When image filters are active, a blue overlay is added. */ 279 .image-filters-enabled & { 280 background: mix($color__link, black, 12%); 281 opacity: 0.38; 282 283 @include media(tablet) { 284 opacity: 0.18; 285 } 286 } 287 } 288 173 289 174 290 ::-moz-selection { 175 background: rgba( white, 0.17);291 background: rgba($color__background-body, 0.17); 176 292 } 177 293 178 294 ::selection { 179 background: rgba( white, 0.17);295 background: rgba($color__background-body, 0.17); 180 296 } 181 297 }
Note: See TracChangeset
for help on using the changeset viewer.