tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

_CardGrid.scss (4799B)


      1 .ds-card-grid .ds-card {
      2  background: var(--newtab-background-color-secondary);
      3  border-radius: var(--border-radius-small);
      4 
      5  &:not(.placeholder) {
      6    border-radius: var(--border-radius-medium);
      7    box-shadow: $shadow-card;
      8 
      9    img,
     10    .placeholder-image {
     11      border-radius: var(--border-radius-medium) var(--border-radius-medium) 0 0;
     12    }
     13  }
     14 }
     15 
     16 .ds-card.refined-cards:not(.placeholder) {
     17  .img-wrapper .img {
     18    height: 160px;
     19    width: 100%;
     20  }
     21 }
     22 
     23 .ds-card-grid {
     24  display: grid;
     25  grid-gap: var(--space-xlarge);
     26  position: relative;
     27 
     28  &.ds-card-grid-compact {
     29    grid-gap: var(--space-large);
     30  }
     31 
     32  &.ad-sizing-variant-a,
     33  &.ad-sizing-variant-b {
     34    row-gap: var(--space-xlarge);
     35    column-gap: var(--space-large);
     36  }
     37 
     38  .ds-card-link:focus {
     39    @include ds-focus;
     40 
     41    transition: none;
     42    border-radius: var(--border-radius-medium);
     43  }
     44 
     45  // "2/3 width layout"
     46  .ds-column-5 &,
     47  .ds-column-6 &,
     48  .ds-column-7 &,
     49  .ds-column-8 & {
     50    grid-template-columns: repeat(2, 1fr);
     51  }
     52 
     53  // "Full width layout"
     54  .ds-column-9 &,
     55  .ds-column-10 &,
     56  .ds-column-11 &,
     57  .ds-column-12 & {
     58    grid-template-columns: repeat(1, 1fr);
     59 
     60    @media (min-width: $break-point-medium) {
     61      grid-template-columns: repeat(2, 1fr);
     62    }
     63 
     64    @media (min-width: $break-point-large) {
     65      grid-template-columns: repeat(3, 1fr);
     66    }
     67 
     68    .title {
     69      font-size: var(--font-size-large);
     70    }
     71 
     72    .excerpt {
     73      @include limit-visible-lines(3, 24, 15);
     74    }
     75  }
     76 
     77  &.empty {
     78    grid-template-columns: auto;
     79  }
     80 
     81  @mixin small-cards {
     82    .ds-card {
     83      &.placeholder {
     84        min-height: 247px;
     85      }
     86 
     87      .meta {
     88        .story-footer {
     89          margin-block-start: var(--space-small);
     90        }
     91 
     92        .source,
     93        .story-sponsored-label,
     94        .status-message .story-context-label {
     95          color: var(--newtab-text-secondary-color);
     96          -webkit-line-clamp: 2;
     97        }
     98 
     99        .source,
    100        .story-sponsored-label {
    101          font-size: var(--font-size-small);
    102        }
    103 
    104        .status-message .story-context-label {
    105          font-size: var(--font-size-small);
    106        }
    107 
    108        .story-badge-icon {
    109          margin-inline-end: var(--space-xxsmall);
    110          margin-block-end: var(--space-xxsmall);
    111          height: 14px;
    112          width: 14px;
    113          background-size: 14px;
    114        }
    115 
    116        .title {
    117          font-size: inherit;
    118        }
    119 
    120        .info-wrap {
    121          flex-grow: 0;
    122        }
    123      }
    124    }
    125  }
    126 
    127  &.ds-card-grid-four-card-variant {
    128    // "Full width layout"
    129    .ds-column-9 &,
    130    .ds-column-10 &,
    131    .ds-column-11 &,
    132    .ds-column-12 & {
    133      grid-template-columns: repeat(1, 1fr);
    134 
    135      @media (min-width: $break-point-medium) {
    136        grid-template-columns: repeat(2, 1fr);
    137      }
    138 
    139      @media (min-width: $break-point-large) {
    140        grid-template-columns: repeat(3, 1fr);
    141      }
    142 
    143      @media (min-width: $break-point-widest) {
    144        grid-template-columns: repeat(4, 1fr);
    145      }
    146    }
    147 
    148    @include small-cards;
    149  }
    150 
    151  &.ds-card-grid-hybrid-layout {
    152    .ds-column-9 &,
    153    .ds-column-10 &,
    154    .ds-column-11 &,
    155    .ds-column-12 & {
    156      grid-template-columns: repeat(1, 1fr);
    157 
    158      @media (min-width: $break-point-medium) {
    159        grid-template-columns: repeat(2, 1fr);
    160      }
    161 
    162      @media (min-width: $break-point-large) {
    163        grid-template-columns: repeat(3, 1fr);
    164      }
    165 
    166      @media (height <= 1065px) {
    167        .excerpt {
    168          display: none;
    169        }
    170      }
    171 
    172      @media (max-width: $break-point-widest) {
    173        @include small-cards;
    174      }
    175 
    176      @media (min-width: $break-point-widest) and (height <= 964px) {
    177        @include small-cards;
    178 
    179        grid-template-columns: repeat(4, 1fr);
    180      }
    181    }
    182  }
    183 }
    184 
    185 .outer-wrapper .ds-card-grid.ds-card-grid-hide-background .ds-card,
    186 .outer-wrapper.newtab-experience .ds-card-grid.ds-card-grid-hide-background .ds-card {
    187  &:not(.placeholder) {
    188    box-shadow: none;
    189    background: none;
    190 
    191    .ds-card-link:focus {
    192      box-shadow: none;
    193 
    194      .img-wrapper .img img {
    195        @include ds-focus;
    196      }
    197    }
    198 
    199    .img-wrapper .img img {
    200      border-radius: var(--border-radius-medium);
    201      box-shadow: $shadow-card;
    202    }
    203 
    204    .meta {
    205      padding: var(--space-medium) 0 0;
    206    }
    207  }
    208 }
    209 
    210 .ds-layout {
    211  .ds-sub-header {
    212    margin-block-start: var(--space-xlarge);
    213 
    214    .section-title-container {
    215      flex-direction: row;
    216      align-items: baseline;
    217      justify-content: space-between;
    218      display: flex;
    219    }
    220 
    221    .section-sub-link {
    222      color: var(--newtab-primary-action-background);
    223      font-size: inherit;
    224      cursor: pointer;
    225 
    226      &:hover {
    227        text-decoration: underline;
    228      }
    229 
    230      &:active {
    231        color: var(--newtab-primary-element-active-color);
    232      }
    233    }
    234  }
    235 }