Workers P3-Endprüfung W4: kein Zusatzabstand von 36 px zwischen den Abschnitten des Interessenten-Panels
Die globale Regel .page section + section traf den zweiten Abschnitt "Nachrichtenverlauf" und ergab 52 px statt 16 px vor der Trennlinie. Eine Regel mit Nachbar-Kombinator (0,3,0) nimmt den Zusatzabstand zurück; der Abstand kommt allein aus gap. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
20f51c6584
commit
62e7994508
2 files changed
+17
No files matched your search
@@ -24,3 +24,16 @@ test('workers.css: die Karte bleibt beim Anspringen unter der festen Leiste der
|
||||
const phone = css.slice(css.indexOf('@media (max-width: 860px)'))
|
||||
assert.match(phone, /\.wk-card\s*\{\s*scroll-margin-top:\s*64px/) // 52 px Leiste + Luft
|
||||
})
|
||||
test('workers.css: die globale Regel .page section + section (36 px) verlängert den Abstand der Panel-Abschnitte nicht (W4)', () => {
|
||||
const global = readFileSync(new URL('../../src/styles/global.css', import.meta.url), 'utf8').replace(/\/\*[\s\S]*?\*\//g, '')
|
||||
const css = readFileSync(new URL('../../src/styles/workers.css', import.meta.url), 'utf8').replace(/\/\*[\s\S]*?\*\//g, '')
|
||||
assert.match(global, /\.page section \+ section\s*\{\s*margin-top:\s*36px/) // die Regel, gegen die das Panel sich behaupten muss: Spezifität (0,1,2)
|
||||
const m = css.match(/(\.wk-prospect [^{}]*\.wk-prospect-section \+ \.wk-prospect-section)\s*\{([^}]*)\}/)
|
||||
assert.ok(m, 'Regel für zwei benachbarte Abschnitte im Panel')
|
||||
assert.match(m[2], /margin-top:\s*0\b/)
|
||||
// Spezifität: zwei Klassen (0,2,0) schlagen schon (0,1,2); eine einzelne Klasse (0,1,0) verlöre
|
||||
assert.ok((m[1].match(/\.[\w-]+/g) || []).length >= 2, 'mindestens zwei Klassen')
|
||||
// der Abstand der Abschnitte kommt aus gap, nicht aus einem eigenen margin-top
|
||||
assert.match(css, /\.wk-prospect\s*\{[^}]*gap:\s*16px/)
|
||||
assert.doesNotMatch(css.match(/\.wk-prospect-section\s*\{([^}]*)\}/)[1], /margin-top/)
|
||||
})
|
||||
Reference in new issue
Block a user