tor-browser

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

_Base.scss (4653B)


      1 .outer-wrapper {
      2  color: var(--newtab-text-primary-color);
      3  display: flex;
      4  flex-grow: 1;
      5  min-height: 100vh;
      6  padding: var(--space-xxlarge);
      7 
      8  &.ds-outer-wrapper-breakpoint-override {
      9    padding: var(--space-xxlarge) 0;
     10 
     11    @media(min-width: $break-point-medium) {
     12      padding: var(--space-xxlarge);
     13    }
     14  }
     15 
     16  &.only-search {
     17    display: block;
     18    // Bug 1967304 - Large number (128px)
     19    padding-block-start: calc(var(--space-xxlarge) * 4);
     20  }
     21 
     22  a {
     23    color: var(--newtab-primary-action-background);
     24  }
     25 }
     26 
     27 main {
     28  margin: 0 auto;
     29  display: flex;
     30  flex-direction: column;
     31  justify-content: center;
     32  width: $wrapper-default-width;
     33  padding: 0;
     34 
     35  &.newtab-main {
     36    min-width: min-content;
     37  }
     38 
     39  .vertical-center-wrapper {
     40    margin: auto 0;
     41  }
     42 
     43  section {
     44    margin-block-end: var(--space-medium);
     45    position: relative;
     46  }
     47 
     48  .hide-main & {
     49    visibility: hidden;
     50  }
     51 
     52  @media (min-width: $break-point-medium) {
     53    width: $wrapper-max-width-medium;
     54  }
     55 
     56  @media (min-width: $break-point-large) {
     57    width: $wrapper-max-width-large;
     58  }
     59 
     60  @media (min-width: $break-point-widest) {
     61    width: $wrapper-max-width-widest;
     62  }
     63 }
     64 
     65 // Edge case for if search is turned off (compact layout)
     66 .no-search main {
     67  margin-block-start: var(--space-xxlarge);
     68 }
     69 
     70 .ds-outer-wrapper-search-alignment {
     71  main {
     72    // This override is to ensure while Discovery Stream loads,
     73    // the search bar does not jump around. (it sticks to the top)
     74    margin: 0 auto;
     75  }
     76 }
     77 
     78 .ds-outer-wrapper-breakpoint-override {
     79  main {
     80    width: auto;
     81    padding-block-end: 0;
     82 
     83    .ds-card {
     84      // Note: This differs when the Sections layout is enabled
     85      width: var(--newtab-card-grid-layout-width);
     86    }
     87 
     88    .ds-card-grid:not(.ds-section-grid) {
     89      grid-gap: var(--space-large);
     90 
     91      &.empty {
     92        grid-template-columns: auto;
     93      }
     94    }
     95 
     96    .body-wrapper {
     97      width: 346px;
     98      margin: 0 auto;
     99    }
    100 
    101    @media (min-width: $break-point-medium) {
    102      width: auto;
    103 
    104      .ds-card-grid:not(.ds-section-grid) {
    105        grid-template-columns: repeat(1, 1fr);
    106      }
    107 
    108      .body-wrapper {
    109        width: 346px;
    110      }
    111    }
    112 
    113    @media (min-width: $break-point-layout-variant) {
    114      width: auto;
    115 
    116      .ds-card-grid:not(.ds-section-grid) {
    117        grid-template-columns: repeat(2, 1fr);
    118      }
    119 
    120      .body-wrapper {
    121        width: 659px;
    122      }
    123    }
    124 
    125    @media (min-width: $break-point-widest) {
    126      width: auto;
    127 
    128      .ds-card-grid:not(.ds-section-grid) {
    129        grid-template-columns: repeat(3, 1fr);
    130        grid-gap: var(--space-xlarge);
    131      }
    132 
    133      .body-wrapper {
    134        width: 989px;
    135      }
    136    }
    137 
    138    @media (min-width: $break-point-ultra-wide) {
    139      width: auto;
    140 
    141      .body-wrapper {
    142        display: flex;
    143        flex-direction: column;
    144        width: 1311px;
    145      }
    146 
    147      .ds-highlights .card-outer {
    148        min-width: 216px;
    149      }
    150 
    151      .ds-card-grid:not(.ds-section-grid) {
    152        grid-template-columns: repeat(4, 1fr);
    153      }
    154    }
    155 
    156  }
    157 }
    158 
    159 .base-content-fallback {
    160  // Make the error message be centered against the viewport
    161  height: 100vh;
    162 }
    163 
    164 .body-wrapper {
    165  // Hide certain elements so the page structure is fixed, e.g., placeholders,
    166  // while avoiding flashes of changing content, e.g., icons and text
    167  $selectors-to-hide: '.section-title, .sections-list .section:last-of-type, .topics';
    168 
    169  #{$selectors-to-hide} {
    170    opacity: 0;
    171  }
    172 
    173  &.on {
    174    #{$selectors-to-hide} {
    175      opacity: 1;
    176    }
    177  }
    178 }
    179 
    180 .non-collapsible-section {
    181  padding: 0;
    182 }
    183 
    184 .prefs-button {
    185  button {
    186    background-color: transparent;
    187    border: 0;
    188    border-radius: var(--button-border-radius);
    189    cursor: pointer;
    190    padding: var(--space-large);
    191    position: fixed;
    192    inset-inline-end: var(--space-large);
    193    inset-block-start: var(--space-large);
    194    z-index: 1000;
    195 
    196    &:hover,
    197    &:focus {
    198      background-color: var(--newtab-element-hover-color);
    199    }
    200 
    201    &:active {
    202      background-color: var(--newtab-element-active-color);
    203    }
    204  }
    205 }
    206 
    207 .wallpaper-attribution {
    208  padding: 0 var(--space-xlarge);
    209  font-size: var(--font-size-small);
    210  color: var(--newtab-contextual-text-primary-color);
    211  position: absolute;
    212  inset-block-end: var(--space-large);
    213  inset-inline-start: 0;
    214 
    215  // Contrast fix for users who have wallpapers set
    216  @include wallpaper-contrast-fix;
    217 
    218  &.theme-light {
    219    display: inline-block;
    220 
    221    @include dark-theme-only {
    222      display: none;
    223    }
    224  }
    225 
    226  &.theme-dark {
    227    display: none;
    228 
    229    @include dark-theme-only {
    230      display: inline-block;
    231    }
    232  }
    233 
    234  a {
    235    color: inherit;
    236 
    237    &:hover {
    238      text-decoration: none;
    239    }
    240  }
    241 }