summaryrefslogtreecommitdiffstats
path: root/browser/components/storybook/.storybook/preview-head.html
blob: 206972e7144b313a5daadcf43adea7b001467729 (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
   - You can obtain one at http://mozilla.org/MPL/2.0/. -->

<link
  rel="stylesheet"
  href="chrome://global/skin/design-system/text-and-typography.css"
/>
<link
  rel="stylesheet"
  href="chrome://global/skin/design-system/tokens-brand.css"
/>

<style>
  :root {
    font-size: var(--font-size-root);
  }

  a {
    color: var(--link-color) !important;
    text-decoration: underline !important;
  }

  div:has(p, .toc-wrapper) {
    width: unset !important;
    min-width: 10rem !important;
  }

  .toc-wrapper {
    margin-inline-end: 8px;
  }

  /* Override the default Storybook padding in favour of styles
   provided by our WithCommonStyles wrapper */
  .sb-show-main.sb-main-padded {
    padding: 0;
  }

  /* Ensure WithCommonStyles can grow to fit the page */
  #root-inner {
    height: 100vh;
  }

  /* Docs stories are being given unnecessary height, possibly because we
   turned off certain controls */
  .docs-story div div {
    height: unset;
  }

  /* Typography preview and design tokens table */
  table.sb-preview-design-tokens {
    -moz-osx-font-smoothing: auto;
    border-collapse: separate;
    table-layout: fixed;
    text-align: left;
    width: 100%;

    & h1.sb-preview-font-size-xxlarge {
      font-size: var(--font-size-xxlarge);
    }

    & th {
      background: #ebf5fc;
    }

    & tr td,
    & tr th {
      padding: 8px;
    }

    & td {
      background: #ffffff;
    }
  }

  td.sb-preview-chrome-typescale {
    & .docs-story {
      * {
        font: message-box;
      }

      & h1 {
        font-weight: var(--font-weight-bold) !important;
      }
    }

    &.sb-preview-chrome-menu .docs-story * {
      font: menu;
    }
  }

  h1.sb-preview-chrome-typescale {
    font: message-box;
    font-weight: var(--font-weight-bold) !important;

    &.sb-preview-chrome-menu {
      font: menu;
    }
  }

  table .sb-preview-font-size-small {
    font-size: var(--font-size-small);
  }

  .box {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    &.width-max-content {
      width: max-content;
    }

    &.relative {
      position: relative;
    }
    &.absolute {
      position: absolute;
    }

    &.justify-center {
      justify-content: center;
    }

    &.align-center {
      align-items: center;
    }

    &.align-end {
      align-items: flex-end;
    }

    &.vertical {
      flex-direction: column;
    }

    &.left {
      left: 0;
    }

    &.right {
      right: 0;
    }

    &.top {
      top: 0;
    }

    & + h1,
    & + h2,
    & + h3 {
      margin-top: 16px !important;
    }
  }

  .post-it {
    align-items: center;
    background: linear-gradient(
          to left bottom,
          transparent 50%,
          rgba(0, 0, 0, 0.4) 0
        )
        no-repeat 100% 0 / 1em 1em,
      linear-gradient(-135deg, transparent 0.7em, var(--color-red-05) 0);
    display: flex;
    font-size: 14px !important;
    height: 85px;
    justify-content: center;
    margin: 12px 0;
    position: relative;
    text-align: center;
    width: 85px;

    &.green {
      background: linear-gradient(
            to left bottom,
            transparent 50%,
            rgba(0, 0, 0, 0.4) 0
          )
          no-repeat 100% 0 / 1em 1em,
        linear-gradient(-135deg, transparent 0.7em, var(--color-green-05) 0);
    }

    &.blue {
      background: linear-gradient(
            to left bottom,
            transparent 50%,
            rgba(0, 0, 0, 0.4) 0
          )
          no-repeat 100% 0 / 1em 1em,
        linear-gradient(-135deg, transparent 0.7em, var(--color-blue-05) 0);
    }

    &.orange {
      background: linear-gradient(
            to left bottom,
            transparent 50%,
            rgba(0, 0, 0, 0.4) 0
          )
          no-repeat 100% 0 / 1em 1em,
        linear-gradient(-135deg, transparent 0.7em, var(--color-yellow-05) 0);
    }

    &.big {
      height: 160px;
      width: 160px;
    }

    &.disabled {
      opacity: 0.4;
    }
  }

  .container-width-large {
    min-width: 968px;
  }
</style>