Skip to content

Commit e5ac729

Browse files
committed
Fix preset/copy buttons picking up Stop button styling
A global `button:last-of-type` rule (originally meant to make the Stop button grey) was matching whichever button was last in any sibling group: Wobble (last preset), and the copy buttons (only button in their row, so also last-of-type). Wobble in particular always looked highlighted on page load. Scope the styling to #play and #stop directly. Also added focus handling so the focus ring only shows for keyboard users, not mouse clicks.
1 parent 47d940a commit e5ac729

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/style.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
8282
}
8383
.field input:focus { outline: 1px solid #58a6ff; }
8484

85-
button {
86-
background: #238636;
85+
#play, #stop {
8786
color: white;
8887
border: none;
8988
border-radius: 4px;
@@ -92,9 +91,10 @@ button {
9291
cursor: pointer;
9392
font: inherit;
9493
}
95-
button:hover { background: #2ea043; }
96-
button:last-of-type { background: #6e7681; }
97-
button:last-of-type:hover { background: #8b949e; }
94+
#play { background: #238636; }
95+
#play:hover { background: #2ea043; }
96+
#stop { background: #6e7681; }
97+
#stop:hover { background: #8b949e; }
9898

9999
.basic-row {
100100
display: flex;
@@ -182,3 +182,5 @@ canvas {
182182
cursor: pointer;
183183
}
184184
.preset-btn:hover { background: #30363d; border-color: #58a6ff; }
185+
.preset-btn:focus { outline: none; }
186+
.preset-btn:focus-visible { outline: 2px solid #58a6ff; outline-offset: 1px; }

0 commit comments

Comments
 (0)