WordPress.org

Make WordPress Core

Changeset 52198


Ignore:
Timestamp:
11/17/2021 05:18:09 PM (2 months ago)
Author:
joedolson
Message:

Toolbar: Prevent adminbar from hiding in-page anchors.

Use scroll-padding-top to offset scroll position on in-page anchors when adminbar is active. Also adjusts existing scroll padding for core themes that implement it.

Props afercia, kingkero, audrasjb, dufresnesteven, thimalw, sabernhardt, costdev.
Fixes #46371.

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/rtl.css

    r47405 r52198  
    167167}
    168168
    169 .entry-content p span[id^="more-"] {
    170     float: right;
    171 }
    172 
    173169
    174170/**
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r51455 r52198  
    9696    -webkit-text-size-adjust: 100%;
    9797    -ms-text-size-adjust:     100%;
     98    scroll-padding-top: calc( var(--wp-admin--admin-bar--height, 0px) + 48px );
    9899}
    99100
     
    13051306}
    13061307
    1307 .site-content .entry-content {
    1308     padding-top: 22px;
    1309 }
    1310 
    13111308.page .entry-content {
    13121309    padding-top: 0;
     
    13931390}
    13941391
    1395 .entry-content span[id^="more-"] {
    1396     display: block;
    1397     padding-top: 52px;
    1398     margin-top: -76px;
    1399 }
    1400 
    1401 .admin-bar .entry-content span[id^="more-"] {
    1402     padding-top: 84px;
    1403     margin-top: -108px;
    1404 }
    1405 
    1406 .entry-content span[id^="more-"] + blockquote,
    1407 .entry-content span[id^="more-"] + div,
    1408 .entry-content span[id^="more-"] + figure,
    1409 .entry-content span[id^="more-"] + hr,
    1410 .entry-content span[id^="more-"] + ol,
    1411 .entry-content span[id^="more-"] + ul,
    1412 .entry-content span[id^="more-"] + p,
    1413 .entry-content span[id^="more-"] + pre {
    1414     margin-top: 24px;
    1415 }
    1416 
    1417 .entry-content p span[id^="more-"] {
    1418     width: 1px;
    1419     height: 24px;
    1420     float: left;
    1421 }
    1422 
    14231392/* Mediaelements */
    14241393
  • trunk/src/wp-content/themes/twentyseventeen/style.css

    r52031 r52198  
    33833383
    33843384@media screen and (min-width: 48em) {
     3385    html {
     3386        scroll-padding-top: calc( var(--wp-admin--admin-bar--height, 0px) + 72px );
     3387    }
    33853388
    33863389    /* Typography */
  • trunk/src/wp-content/themes/twentysixteen/style.css

    r51455 r52198  
    27752775
    27762776@media screen and (min-width: 44.375em) {
     2777    html {
     2778        scroll-padding-top: calc( var(--wp-admin--admin-bar--height, 0px) + 21px );
     2779    }
     2780
    27772781    body:not(.custom-background-image):before,
    27782782    body:not(.custom-background-image):after {
  • trunk/src/wp-includes/css/admin-bar.css

    r51672 r52198  
    11html {
    22    --wp-admin--admin-bar--height: 32px;
     3    scroll-padding-top: var(--wp-admin--admin-bar--height);
    34}
    45
Note: See TracChangeset for help on using the changeset viewer.