Nicer settings CSS

This commit is contained in:
Adam Gastineau 2024-12-13 08:03:04 -08:00
parent 0138b5d1e4
commit 198b7be0ef
2 changed files with 21 additions and 19 deletions

View file

@ -15,26 +15,27 @@
*/
.settings-view {
display: flex;
flex: none;
padding: 4px 0px;
row-gap: 8px;
user-select: none;
}
.settings-view .setting label {
.settings-view .setting {
display: flex;
flex-direction: row;
align-items: center;
margin: 4px 2px;
}
.settings-view .setting label {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
}
.settings-view .setting:first-of-type label {
margin-top: 2px;
}
.settings-view .setting:last-of-type label {
margin-bottom: 2px;
}
.settings-view .setting input {
margin-right: 5px;
flex-shrink: 0;
}

View file

@ -30,16 +30,17 @@ export const SettingsView: React.FunctionComponent<{
return (
<div className='vbox settings-view'>
{settings.map(({ value, set, name, title }) => {
const labelId = `setting-${name}`;
return (
<div key={name} className='setting' title={title}>
<label>
<input
type='checkbox'
checked={value}
onChange={() => set(!value)}
/>
{name}
</label>
<input
type='checkbox'
id={labelId}
checked={value}
onChange={() => set(!value)}
/>
<label htmlFor={labelId}>{name}</label>
</div>
);
})}