Skip to content

Commit c591cdc

Browse files
committed
styles.css: five rules merges had left open, which swallowed every rule after them on production (comment threads' list on other builds, the compared-with line, self-managed GitLab instances' form, the staff email previews, the screenshots lightbox and Compare two PDFs' phone layout); a test fails when a rule starts before the previous one closed
1 parent 8099246 commit c591cdc

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { describe, expect, it } from 'vitest'
2+
import styles from '../styles.css?raw'
3+
4+
// A rule left open (a merge that dropped a closing brace) swallows every rule after it, and nothing else catches it:
5+
// the build and the type check pass. Each rule must close before the next one starts.
6+
describe('styles.css', () => {
7+
it('closes every rule before the next one starts', () => {
8+
const css = styles.replace(/\/\*[\s\S]*?\*\//g, '')
9+
// One entry per open block: the line it opened on, and whether it's an at-rule (@media), which may hold rules.
10+
const stack: { line: number; at: boolean }[] = []
11+
css.split('\n').forEach((text, i) => {
12+
const top = stack[stack.length - 1]
13+
if (/^[.#a-z:[*@]/i.test(text) && top && !top.at) {
14+
throw new Error(`line ${i + 1} ("${text.slice(0, 40)}") starts inside the rule opened on line ${top.line}`)
15+
}
16+
for (const c of text) {
17+
if (c === '{') stack.push({ line: i + 1, at: text.trimStart().startsWith('@') })
18+
else if (c === '}') stack.pop()
19+
}
20+
})
21+
expect(stack.map((b) => b.line)).toEqual([])
22+
})
23+
})

‎server/frontend/src/styles.css‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4669,6 +4669,12 @@ html.vci-signed-in .site-auth-out {
46694669
}
46704670

46714671
.threads-elsewhere li {
4672+
display: flex;
4673+
align-items: center;
4674+
gap: var(--space-2);
4675+
min-width: 0;
4676+
}
4677+
46724678
/* ---------- GitLab webhook setup (sc-8515) ---------- */
46734679
.webhook-setup {
46744680
display: grid;
@@ -4724,6 +4730,8 @@ html.vci-signed-in .site-auth-out {
47244730
display: inline-flex;
47254731
align-items: center;
47264732
gap: var(--space-2);
4733+
}
4734+
47274735
.kv code {
47284736
overflow-wrap: anywhere;
47294737
min-width: 0;
@@ -4768,6 +4776,7 @@ html.vci-signed-in .site-auth-out {
47684776
display: grid;
47694777
gap: var(--space-3);
47704778
max-width: 560px;
4779+
}
47714780

47724781
/* Staff: page-head actions side by side. */
47734782
.row-actions {
@@ -4914,6 +4923,9 @@ html.vci-signed-in .site-auth-out {
49144923

49154924
.shots-lightbox-list figure {
49164925
margin: 0;
4926+
display: grid;
4927+
gap: var(--space-2);
4928+
}
49174929

49184930
/* ---------- Compare two PDFs (visualci.com/tools/compare-pdfs/) ---------- */
49194931
.pdf-compare {
@@ -5004,6 +5016,7 @@ html.vci-signed-in .site-auth-out {
50045016
height: auto;
50055017
border: 1px solid var(--color-rule);
50065018
border-radius: var(--radius);
5019+
}
50075020

50085021
@media (max-width: 640px) {
50095022
.pdf-drops {

0 commit comments

Comments
 (0)