Make WordPress Core


Ignore:
Timestamp:
12/14/2018 02:32:33 AM (6 years ago)
Author:
pento
Message:

Default Themes: Import Twenty Nineteen from the 5.0 branch.

Merges [43808,43821,43842,43860,43892,43904,43909,43926-43929,43956,43961-43963] from the 5.0 branch to trunk.

Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, jorbin, netweb, b-07, khleomix, audrasjb, nielslange, mmaumio, richsalvucci, littlebigthing, dimadin, joyously, anevins, peterwilsoncc, dannycooper, iCaleb, siriokun, technosiren, travel_girl, azchughtai, ianbelanger, nadim1992, ismailelkorchi, nativeinside, chetan200891, grapplerulrich, ocean90, joshfeck, frankew, AbdulWahab610, mendezcode, eliorivero, melchoyce, joen, laurelfulford, mdawaffe, kraftbj, dsmart, nao, mayukojpn, enodekciw, ketuchetan, atanasangelovdev, poena, sharaz, artisticasad, mukesh27, burhandodhy, crunnells, aprakasa, themeroots, imonly_ik, tlxo, youthkee, brentswisher, smyoon315, mrahmadawais, desideveloper, Kau-Boy, mor10, mikeyarce, dingo_bastard, xkon, twoabove.

Fixes #45424.

Location:
trunk
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-content/themes/twentynineteen/sass/site/header/_site-featured-image.scss

    r43808 r44149  
    22
    33.site-header.featured-image {
     4
     5    /* Hide overflow for overflowing featured image */
     6    overflow: hidden;
    47
    58    /* Need relative positioning to properly align layers. */
     
    710
    811    /* 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);
    1013
    1114    /* Set white text color when featured image is set. */
     
    1821    .entry-meta,
    1922    .entry-title {
    20         color: white;
     23        color: $color__background-body;
    2124    }
    2225
    2326    .main-navigation a,
     27    .main-navigation a + svg,
    2428    .social-navigation a,
    2529    .site-title a,
    26     .hentry a {
    27         color: white;
     30    .site-featured-image a {
     31        color: $color__background-body;
    2832        transition: opacity $link_transition ease-in-out;
    2933
    3034        &:hover,
    31         &:active {
    32             color: white;
     35        &:active,
     36        &:hover + svg,
     37        &:active + svg {
     38            color: $color__background-body;
    3339            opacity: 0.6;
    3440        }
    3541
    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 */
    4249    .social-navigation a {
    4350        &:focus {
    44             color: white;
     51            color: $color__background-body;
    4552            opacity: 1;
    46             border-bottom: 1px solid white;
     53            border-bottom: 1px solid $color__background-body;
    4754        }
    4855    }
    4956
    5057    .social-navigation svg,
    51     .hentry svg {
     58    .site-featured-image svg {
    5259        /* 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                }
    73177            }
    74178        }
     
    79183    .custom-logo-link {
    80184
    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);
    83187
    84188        &:hover,
    85189        &:active,
    86190        &:focus {
    87             box-shadow: 0 0 0 2px rgba(white, 1);
     191            box-shadow: 0 0 0 2px rgba($color__background-body, 1);
    88192        }
    89193    }
    90194
    91195    /* Make sure important elements are above pseudo elements used for effects. */
    92     .site-branding,
    93     .hentry .entry-header {
     196    .site-branding {
     197        position: relative;
    94198        z-index: 10;
    95199    }
    96200
     201    .site-featured-image .entry-header {
     202        position: relative;
     203        z-index: 9;
     204    }
     205
    97206    /* Set up image filter layer positioning */
    98     .site-branding-container:before,
    99207    .site-branding-container:after,
    100     .hentry:before,
    101     .hentry:after,
     208    .site-featured-image:before,
     209    .site-featured-image:after,
    102210    &:after {
    103211        display: block;
     
    110218
    111219    /* Background & Effects */
    112     /* Shared background settings between pseudo elements. See .site-branding-container */
     220    /* Shared background settings between pseudo elements. */
    113221    background-position: center;
    114222    background-repeat: no-repeat;
     
    117225    /* The intensity of each blend mode is controlled via layer opacity. */
    118226
    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 
    128227    /* Second layer: screen. */
    129     .hentry:before {
     228    .image-filters-enabled & .site-featured-image:before {
    130229        background: $color__link;
    131230        mix-blend-mode: screen;
    132231        opacity: 0.1;
    133         z-index: 2;
    134232    }
    135233
    136234    /* 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;
    139238        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        }
    142252    }
    143253
    144254    /* Fourth layer: overlay. */
    145     .site-branding-container:after {
    146         background: rgba(white, 0.35);
     255    .image-filters-enabled & .site-branding-container:after {
     256        background: rgba(0, 0, 0, 0.35);
    147257        mix-blend-mode: overlay;
    148258        opacity: 0.5;
    149259        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        }
    150265    }
    151266
    152267    /* Fifth layer: readability overlay */
    153268    &:after {
    154         background: mix($color__link, black, 12%);
    155 
     269        background: #000;
    156270        /**
    157271         * Add a transition to the readability overlay, to add a subtle
     
    159273         */
    160274        transition: opacity 1200ms ease-in-out;
    161 
     275        opacity: 0.7;
    162276        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
    173289
    174290    ::-moz-selection {
    175         background: rgba(white, 0.17);
     291        background: rgba($color__background-body, 0.17);
    176292    }
    177293
    178294    ::selection {
    179         background: rgba(white, 0.17);
     295        background: rgba($color__background-body, 0.17);
    180296    }
    181297}
Note: See TracChangeset for help on using the changeset viewer.