Skip to content

Commit 916b427

Browse files
committed
Remove unwanted header padding on navbar wrapper pattern.
When <header> is used solely as a full-width colored wrapper around <nav> (e.g. <header class="bg-primary"><nav class="container">), PicoCSS body > header padding-block creates excessive height. Neutralize it when <nav> is the only child.
1 parent 39b6b9f commit 916b427

22 files changed

Lines changed: 31 additions & 21 deletions

css/mu.component.nav.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ nav a {
5454
:is(nav, :has(> nav)).bg-pop { --nav-bg: var(--mu-pop); }
5555
:is(nav, :has(> nav)).bg-spark { --nav-bg: var(--mu-spark); }
5656

57+
/*
58+
* Remove PicoCSS body > header padding when <header> is used solely as a
59+
* full-width colored wrapper around <nav> (e.g. <header class="bg-primary"><nav class="container">).
60+
* PicoCSS adds padding-block to body > header for structural headers with text content;
61+
* when the only child is a <nav>, that padding creates unwanted extra height.
62+
*/
63+
body > header:has(> nav:only-child) {
64+
padding-block: 0;
65+
}
66+
5767
/* PicoCSS bugfix: nav dropdown full-width on Firefox (picocss/pico#701) — remove when fixed upstream */
5868
nav details.dropdown {
5969
display: inline-block;

dist/mu.amber.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mu.azure.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mu.blue.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mu.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mu.cyan.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mu.fuchsia.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mu.green.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mu.grey.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mu.indigo.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)