Skip to content

Commit

Permalink
Add forms checkbox fallback on Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dunn committed Nov 14, 2023
1 parent dcdb5c7 commit e990f2f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions css/barrel.css
Original file line number Diff line number Diff line change
Expand Up @@ -1026,17 +1026,29 @@ header:not(.undecorated) .tool-bar {
width: 100%;
max-width: 100%;
}
}

& label:has(input[type=radio], input[type=checkbox]) {
flex-direction: row;
&:has(input[type="radio"], input[type="checkbox"]) {
flex-direction: row;
}
}


& :is(input:not([type='checkbox'], [type="radio"]), select, label) {
min-width: 6em;
}
}

/*This is a fallback for Firefox. It's not great but it makes
it usable. Remove when FF fully supports :has()*/
.stacked-form *::has(input[type="radio"], input[type="checkbox"]) {
flex-direction: row;
}

.stacked-form label input[type='checkbox'],
.stacked-form label input[type='radio'] {
place-self: baseline;
}

.flex-col {
display: flex;
flex-wrap: wrap;
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ <h4>The .stacked-form class</h4>
<label>Another group<input></label>
<label>More groups<input size="15"></label>
</p>
<label><input type="checkbox">A checkbox</label>


<fieldset>
Expand Down

0 comments on commit e990f2f

Please sign in to comment.