Begin work on a custom element for incrementer

This commit is contained in:
Oliver-Akins 2024-04-03 23:00:57 -06:00
parent 1c2ced321b
commit d5429b7b34
7 changed files with 137 additions and 7 deletions

View file

@ -0,0 +1,55 @@
/*
Disclaimer: This CSS is used by a custom web component and is scoped to JUST
the corresponding web component. Importing this into other files is forbidden.
*/
$default-border-radius: 4px;
:host {
min-width: max-content;
}
div {
display: grid;
grid-template-columns: auto 50px auto;
// I dunno why this is needed for the height to not be calculated as 17px,
// but it is for some arcane reason
grid-template-rows: 1fr;
}
input {
border: none;
outline: none;
font-family: inherit;
text-align: center;
padding: 0;
background: green;
&::-webkit-inner-spin-button, &::-webkit-outer-spin-button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
margin: 0
}
}
button {
border: none;
outline: none;
height: 100%;
aspect-ratio: 1 / 1;
padding: 4px;
background: darkgreen;
max-width: 100%;
&:hover {
cursor: pointer;
}
}
.increment {
border-radius: 0 var(--border-radius, $default-border-radius) var(--border-radius, 4px) 0;
}
.decrement {
border-radius: var(--border-radius, $default-border-radius) 0 0 var(--border-radius, $default-border-radius);
}

View file

@ -68,7 +68,7 @@
.bytes-panel {
display: grid;
grid-template-columns: 1fr min-content 50px min-content;
grid-template-columns: 1fr auto;
gap: 8px;
align-items: center;