Begin making the proper CSS for the component
This commit is contained in:
parent
566faf61d2
commit
e0a3b4985b
3 changed files with 10 additions and 9 deletions
|
|
@ -1,8 +1,11 @@
|
||||||
/**
|
/**
|
||||||
Attributes:
|
Attributes:
|
||||||
@property {number} value
|
@property {string} name - The path to the value to update
|
||||||
@property {number} stepSize
|
@property {number} value - The actual value of the input
|
||||||
@property {number} largeStepSize
|
|
||||||
|
Styling:
|
||||||
|
- `--height`: Controls the height of the element + the width of the buttons (default: 1.25rem)
|
||||||
|
- `--width`: Controls the width of the number input (default 50px)
|
||||||
*/
|
*/
|
||||||
export class DotDungeonIncrementer extends HTMLElement {
|
export class DotDungeonIncrementer extends HTMLElement {
|
||||||
static elementName = `dd-incrementer`;
|
static elementName = `dd-incrementer`;
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,9 @@ the corresponding web component. Importing this into other files is forbidden.
|
||||||
$default-border-radius: 4px;
|
$default-border-radius: 4px;
|
||||||
$default-height: 1.25rem;
|
$default-height: 1.25rem;
|
||||||
|
|
||||||
:host {
|
|
||||||
min-width: max-content;
|
|
||||||
}
|
|
||||||
|
|
||||||
div {
|
div {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: var(--height, $default-height) 50px var(--height, $default-height);
|
grid-template-columns: var(--height, $default-height) var(--width, 50px) var(--height, $default-height);
|
||||||
// I dunno why this is needed for the height to not be calculated as 17px,
|
// I dunno why this is needed for the height to not be calculated as 17px,
|
||||||
// but it is for some arcane reason
|
// but it is for some arcane reason
|
||||||
grid-template-rows: var(--height, $default-height);
|
grid-template-rows: var(--height, $default-height);
|
||||||
|
|
@ -41,6 +37,7 @@ button {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
background-color: color-mix(in lab, white 5%, transparent);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@
|
||||||
>
|
>
|
||||||
Supplies
|
Supplies
|
||||||
</label>
|
</label>
|
||||||
<dd-incrementer value="{{system.supplies}}"></dd-incrementer>
|
<dd-incrementer name="system.supplies" value="{{system.supplies}}"></dd-incrementer>
|
||||||
|
{{!-- <input is="dd-incrementer"> --}}
|
||||||
{{!-- <button
|
{{!-- <button
|
||||||
type="button"
|
type="button"
|
||||||
class="icon"
|
class="icon"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue