robin/maivi

a tiny cute lua web framework

git clone https://git.robinwobin.dev/robin/maivi

robindocs: wip897859d

push-srxvuswpkqxx
7.9 KiB295 linesraw
1@layer components {
2  :root {
3    --text-margin: .8rem;
4  }
5
6  .text {
7
8    /* paragraphs */
9    p {
10      line-height: 1.6;
11      overflow-wrap: anywhere;
12
13      margin: var(--text-margin) 0;
14
15      color: var(--text);
16
17      strong,
18      b {
19        color: var(--aqua);
20      }
21
22      em,
23      i {
24        color: var(--skye);
25      }
26    }
27
28    /* inline code */
29    :not(pre)>code {
30      background: var(--surface0);
31      color: var(--subtext0);
32
33      padding: .0rem .4rem;
34    }
35
36    .subtle {
37      color: var(--subtext0);
38    }
39
40    del {
41      color: var(--red);
42    }
43
44    ins {
45      color: var(--green);
46    }
47
48    mark {
49      background-color: var(--yellow);
50    }
51
52    /* text blocks */
53    aside,
54    blockquote {
55      --border: var(--overlay0);
56      margin: var(--text-margin) 0;
57      padding-left: 1rem;
58
59      border-left: 4px solid var(--border, var(--default-border));
60      transition: border-color .2s;
61
62      p {
63        color: var(--subtext1);
64      }
65    }
66
67    /* quote */
68    blockquote.quote {
69      p {
70        color: var(--subtext0);
71
72        &.quote__body {
73          font-style: italic;
74        }
75      }
76    }
77
78    q {
79      color: var(--subtext0);
80      font-style: italic;
81
82      &::before {
83        content: open-quote;
84      }
85
86      &::after {
87        content: close-quote;
88      }
89    }
90
91    aside {
92      --icon: url('data:image/svg+xml;charset=utf-8,<svg viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"> <path d="M16 36.4141V34C16 28.4772 20.4772 24 26 24C28.2091 24 30 22.2091 30 20C30 17.7909 28.2091 16 26 16C16.0589 16 8 24.0589 8 34V53C8 58.0351 11.383 62.2801 16 63.5859" stroke-linecap="round" stroke-linejoin="round" /> <path d="M16 36.4141C16.9537 36.1443 17.96 36 19 36H25C31.0751 36 36 40.9249 36 47V53C36 59.0751 31.0751 64 25 64H19C17.96 64 16.9537 63.8557 16 63.5859" stroke-linecap="round" stroke-linejoin="round" /> <path d="M52 36.4141V34C52 28.4772 56.4772 24 62 24C64.2091 24 66 22.2091 66 20C66 17.7909 64.2091 16 62 16C52.0589 16 44 24.0589 44 34V53C44 58.0351 47.383 62.2801 52 63.5859" stroke-linecap="round" stroke-linejoin="round" /> <path d="M52 36.4141C52.9537 36.1443 53.96 36 55 36H61C67.0751 36 72 40.9249 72 47V53C72 59.0751 67.0751 64 61 64H55C53.96 64 52.9537 63.8557 52 63.5859" stroke-linecap="round" stroke-linejoin="round" /> </svg>');
93
94      /* callouts */
95      h6 {
96        &::before {
97          content: '';
98          display: inline-block;
99          height: 1rem;
100          aspect-ratio: 1/1;
101          vertical-align: middle;
102
103          margin: 0 .8rem 0 0;
104
105          mask: var(--icon);
106          background-color: var(--border);
107        }
108
109        color: var(--border);
110      }
111
112      &.info {
113        --border: var(--blue);
114        --icon: url('data:image/svg+xml;charset=utf-8,<svg viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"> <path d="M68 40C68 55.464 55.464 68 40 68C24.536 68 12 55.464 12 40C12 24.536 24.536 12 40 12C55.464 12 68 24.536 68 40Z" stroke-linecap="round" stroke-linejoin="round" /> <path d="M40.1494 53.5252V31.1252H31.1494M31 53.5252H49" stroke-linecap="round" stroke-linejoin="round" /> <path d="M40 23.9253V25.5253" stroke-linecap="round" stroke-linejoin="round" /> </svg>');
115      }
116
117      &.warn {
118        --border: var(--yellow);
119        --icon: url('data:image/svg+xml;charset=utf-8,<svg width="80" height="80" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"> <path d="M68 40C68 55.464 55.464 68 40 68C24.536 68 12 55.464 12 40C12 24.536 24.536 12 40 12C55.464 12 68 24.536 68 40Z" stroke-linecap="round" stroke-linejoin="round" /> <path d="M39.9678 24V46.4" stroke-linecap="round" stroke-linejoin="round" /> <path d="M39.9678 53.6001V55.2001" stroke-linecap="round" stroke-linejoin="round" /> </svg>');
120      }
121
122      &.caution {
123        --border: var(--red);
124        --icon: url('data:image/svg+xml;charset=utf-8,<svg width="80" height="80" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"> <path d="M38.2635 15.039C39.0313 13.6953 40.9687 13.6953 41.7364 15.039L70.2901 65.0078C71.052 66.3412 70.0892 68.0001 68.5536 68.0001H11.4463C9.91067 68.0001 8.94794 66.3412 9.70983 65.0078L38.2635 15.039Z" stroke-linecap="round" stroke-linejoin="round" /> <path d="M39.9678 28.4746V50.8746" stroke-linecap="round" stroke-linejoin="round" /> <path d="M39.9678 58.0745V59.6745" stroke-linecap="round" stroke-linejoin="round" /> </svg>');
125      }
126
127      &.note {
128        --border: var(--aqua);
129        --icon: url('data:image/svg+xml;charset=utf-8,<svg width="80" height="80" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"> <path d="M19 16C19 13.7909 20.7909 12 23 12H59C61.2091 12 63 13.7909 63 16V64C63 66.2091 61.2091 68 59 68H23C20.7909 68 19 66.2091 19 64V16Z" stroke-linecap="round" stroke-linejoin="round" /> <path d="M21 28H17M21 20H17M21 36H17M21 52H17M21 60H17M21 44H17" stroke-linecap="round" stroke-linejoin="round" /> <path d="M29 24H53" stroke-linecap="round" stroke-linejoin="round" /> <path d="M29 32H45" stroke-linecap="round" stroke-linejoin="round" /> <path d="M29 40H53" stroke-linecap="round" stroke-linejoin="round" /> <path d="M29 48H45" stroke-linecap="round" stroke-linejoin="round" /> <path d="M29 56H53" stroke-linecap="round" stroke-linejoin="round" /> </svg>');
130      }
131    }
132
133    --h-margin-b: .8rem;
134
135    /* headers */
136    h1 {
137      margin: 2.25rem 0 var(--h-margin-b);
138      font-size: 1.75rem;
139
140      &:first-child {
141        margin-top: 1.2rem;
142      }
143
144      @media not (min-width: 1280px) {
145        font-size: 1.4rem;
146      }
147    }
148
149    h2 {
150      margin: 1.9rem 0 var(--h-margin-b);
151      font-size: 1.4rem;
152
153      @media not (min-width: 1280px) {
154        font-size: 1.25rem;
155      }
156    }
157
158    h3 {
159      margin: 1.62rem 0 var(--h-margin-b);
160      font-size: 1.12rem
161    }
162
163    h4,
164    h5,
165    h6 {
166      margin: 1.5rem 0 var(--h-margin-b);
167      font-size: 1rem
168    }
169
170    h6:not(:has(> .heading-anchor)):after {
171      content: '~';
172      margin-inline: 1rem 0;
173      color: var(--overlay2);
174    }
175
176    /* lists */
177    ul,
178    ol {
179      list-style-position: inside;
180
181      li {
182        margin: .6rem 0;
183
184        padding: 0 0 0 .5rem;
185        text-indent: hanging .5em;
186
187        &::marker {
188          color: var(--overlay2);
189        }
190
191        p {
192          display: inline;
193        }
194      }
195
196      li a.rainbow {
197        text-decoration: wavy underline;
198        text-decoration-thickness: 1px;
199      }
200
201      >:nth-child(6n+1) .rainbow {
202        color: var(--red);
203      }
204
205      >:nth-child(6n+2) .rainbow {
206        color: var(--orange);
207      }
208
209      >:nth-child(6n+3) .rainbow {
210        color: var(--yellow);
211      }
212
213      >:nth-child(6n+4) .rainbow {
214        color: var(--green);
215      }
216
217      >:nth-child(6n+5) .rainbow {
218        color: var(--aqua);
219      }
220
221      >:nth-child(6n+6) .rainbow {
222        color: var(--skye);
223      }
224    }
225
226    ul {
227      list-style-type: '- ';
228    }
229
230    p>img {
231      border: 6px solid var(--surface1);
232      border-radius: 8px;
233    }
234  }
235
236  p.subtitle {
237    margin-top: 0;
238
239    .text :has(+ &) {
240      margin-bottom: 0;
241    }
242  }
243
244  .text pre:has(>code) {
245    --cb-padding: 1rem;
246    --gutter-size: 2rem;
247    margin: .5rem 0;
248    padding: var(--cb-padding) var(--gutter-size, var(--cb-padding));
249    border-radius: .3rem;
250
251    background: var(--mantle) !important;
252
253    overflow: auto;
254
255    /* The line numbers already provide some kind of left/right padding */
256    &[data-linenos] {
257      padding: var(--cb-padding) 0;
258    }
259
260    table td {
261      padding: 0;
262
263      /* The line number cells */
264      &:nth-of-type(1) {
265        text-align: center;
266        user-select: none;
267
268        width: var(--gutter-size);
269
270        color: var(--overlay0);
271      }
272    }
273
274    mark {
275      /* If you want your highlights to take the full width */
276      display: block;
277      /* The default background colour of a mark is bright yellow */
278      background-color: rgba(254, 252, 232, 0.9);
279    }
280
281    table {
282      width: 100%;
283      border-collapse: collapse;
284    }
285  }
286
287  /* spacing */
288  hr {
289    background-color: var(--surface1);
290    border: none;
291    width: 100%;
292    height: 1px;
293    margin: 2rem auto;
294  }
295}