summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/content-src/components/Base/_Base.scss
blob: 7e13fe9a90246fc2409af14ac0847dce19380426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.outer-wrapper {
  color: var(--newtab-text-primary-color);
  display: flex;
  flex-grow: 1;
  min-height: 100vh;
  padding: ($section-spacing + $section-vertical-padding) $base-gutter $base-gutter;

  &.ds-outer-wrapper-breakpoint-override {
    padding: 30px 0 32px;

    @media(min-width: $break-point-medium) {
      padding: 30px 32px 32px;
    }
  }

  &.only-search {
    display: block;
    padding-top: 134px;
  }

  a {
    color: var(--newtab-primary-action-background);
  }
}

main {
  margin: auto;
  width: $wrapper-default-width;
  padding: 0;

  section {
    margin-bottom: $section-spacing;
    position: relative;
  }

  .hide-main & {
    visibility: hidden;
  }

  @media (min-width: $break-point-medium) {
    width: $wrapper-max-width-medium;
  }

  @media (min-width: $break-point-large) {
    width: $wrapper-max-width-large;
  }

  @media (min-width: $break-point-widest) {
    width: $wrapper-max-width-widest;
  }

  &.has-snippet {
    // Offset the snippets container so things at the bottom of the page are still
    // visible when snippets are visible. Adjust for other spacing.
    padding-bottom: $snippets-container-height - $section-spacing - $base-gutter;
  }
}

.below-search-snippet.withButton {
  margin: auto;
  width: 100%;
}

.ds-outer-wrapper-search-alignment {
  main {
    // This override is to ensure while Discovery Stream loads,
    // the search bar does not jump around. (it sticks to the top)
    margin: 0 auto;
  }
}

.ds-outer-wrapper-breakpoint-override {
  main {
    width: 266px;
    padding-bottom: 0;

    @media (min-width: $break-point-medium) {
      width: 510px;
    }

    @media (min-width: $break-point-large) {
      width: 746px;
    }

    @media (min-width: $break-point-widest) {
      width: 986px;
    }

    &.has-snippet {
      // Offset the snippets container so things at the bottom of the page are still
      // visible when snippets are visible. Adjust for other spacing.
      padding-bottom: $snippets-container-height - $section-spacing - $base-gutter;
    }
  }
}

.base-content-fallback {
  // Make the error message be centered against the viewport
  height: 100vh;
}

.body-wrapper {
  // Hide certain elements so the page structure is fixed, e.g., placeholders,
  // while avoiding flashes of changing content, e.g., icons and text
  $selectors-to-hide: '.section-title, .sections-list .section:last-of-type, .topics';

  #{$selectors-to-hide} {
    opacity: 0;
  }

  &.on {
    #{$selectors-to-hide} {
      opacity: 1;
    }
  }
}

.non-collapsible-section {
  padding: 0 $section-horizontal-padding;
}

.prefs-button {
  button {
    background-color: transparent;
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    inset-inline-end: 15px;
    padding: 15px;
    position: fixed;
    top: 15px;
    z-index: 1000;

    &:hover,
    &:focus {
      background-color: var(--newtab-element-hover-color);
    }

    &:active {
      background-color: var(--newtab-element-active-color);
    }
  }
}