Skip to content

Commit c908da4

Browse files
committed
Fix heading color and margin in colored containers and nav
- Headings inside .bg-* containers inherit inverse color for readability - Remove heading margin-bottom inside nav elements
1 parent 9924b92 commit c908da4

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

css/mu.colors.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
.bg-pop { background-color: var(--mu-pop); color: var(--mu-primary-inverse); }
3232
.bg-spark { background-color: var(--mu-spark); color: var(--mu-primary-inverse); }
3333

34-
/* Links inside filled backgrounds inherit inverse color */
34+
/* Links and headings inside filled backgrounds inherit inverse color */
3535
:is(.bg-primary, .bg-secondary, .bg-tertiary, .bg-contrast,
3636
.bg-accent, .bg-success, .bg-info, .bg-warning,
37-
.bg-error, .bg-pop, .bg-spark) a {
37+
.bg-error, .bg-pop, .bg-spark) :is(a, h1, h2, h3, h4, h5, h6) {
3838
color: inherit;
3939
}
4040

css/mu.component.nav.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ body > header:has(> nav:only-child) {
6464
padding-block: 0;
6565
}
6666

67+
/* Remove heading margin inside nav (PicoCSS headings have margin-bottom by default) */
68+
nav :is(h1, h2, h3, h4, h5, h6) {
69+
margin-bottom: 0;
70+
}
71+
6772
/* PicoCSS bugfix: nav dropdown full-width on Firefox (picocss/pico#701) — remove when fixed upstream */
6873
nav details.dropdown {
6974
display: inline-block;

documentation/mu.utilities.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,22 @@ When used on a `<nav>`, these classes automatically add `z-index: 100` and `box-
7474

7575
---
7676

77+
## Cursor
78+
79+
| Class | Effect |
80+
|-------|--------|
81+
| `.clickable` | `cursor: pointer` — shows a pointer cursor on hover |
82+
83+
Use `.clickable` on elements that are interactive via JavaScript but are not `<a>` or `<button>` (which already show a pointer cursor natively).
84+
85+
```html
86+
<tr class="clickable" onclick="openDetail(this)">
87+
<td>Row content</td>
88+
</tr>
89+
```
90+
91+
---
92+
7793
## Color utilities
7894

7995
Text, background, and border color classes are documented in [µColors](mu.colors.md#utility-classes).

0 commit comments

Comments
 (0)