Making WordPress.org


Ignore:
Timestamp:
09/28/2022 11:18:13 PM (4 years ago)
Author:
adamwood
Message:

Learn: Sync with git WordPress/learn@f49e45d

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/css/components/_card.scss

    r12067 r12096  
    1 .card {
     1.card,
     2.card.button {
    23        background-color: #fbfbfc;
    34        border: 1px solid #ccd0d4;
    45        border-radius: 3px;
    56        color: #555d66;
    6         margin-bottom: 0.5rem;
    77        padding: 1.75rem;
    88        position: relative;
    … …  
    1010        /* Fix over-specific rule in the parent theme. */
    1111        body:not(.single):not(.search) .site-main &.post {
    12                 margin-bottom: 0.5rem;
     12                margin-bottom: 0;
     13                max-width: initial;
    1314        }
    1415
    … …  
    106107}
    107108
     109@mixin card-grid_1 {
     110        grid-template-columns: 1fr;
     111}
     112
     113@mixin card-grid_2 {
     114        grid-template-columns: 1fr 1fr;
     115}
     116
    108117.card-grid {
    109118        margin: 1.5rem 0;
     119        display: grid;
     120        gap: 1rem;
     121        grid-auto-rows: min-content;
    110122
    111         @media only screen and (min-width: $breakpoint-tablet) {
    112                 display: flex;
    113                 flex-direction: row;
    114                 flex-wrap: wrap;
    115                 align-content: flex-start;
    116                 justify-content: space-between;
    117                 margin-left: -0.5rem; /* Offset the padding in the grid */
    118                 margin-right: -0.5rem; /* Offset the padding in the grid */
     123        @include card-grid_1();
    119124
    120                 > * {
    121                         margin: 0.5rem;
    122                 }
     125        &_2 {
    123126
     127                @include card-grid_2();
     128        }
     129
     130        &_4 {
     131                grid-template-columns: 1fr 1fr 1fr 1fr;
     132        }
     133
     134        @media only screen and (max-width: $breakpoint-tablet-below) {
    124135                &_2 {
    125                         > * {
    126                                 flex-grow: 0;
    127                                 flex-shrink: 0;
    128                                 flex-basis: 48%;
    129                         }
     136
     137                        @include card-grid_1();
    130138                }
    131139
    132140                &_4 {
    133                         > * {
    134                                 flex-grow: 0;
    135                                 flex-shrink: 0;
    136                                 flex-basis: calc(25% - 1rem);
    137                         }
     141
     142                        @include card-grid_2();
    138143                }
     144        }
    139145
    140                 &.gap-64 {
    141                         margin-top: 4rem;
    142                         margin-bottom: 0.25rem;
     146        @media only screen and (max-width: $breakpoint-mobile) {
     147                &_4 {
     148
     149                        @include card-grid_1();
    143150                }
    144151        }
Note: See TracChangeset for help on using the changeset viewer.