feat(button): reduce to minimal css
This commit is contained in:
parent
f478b988f8
commit
d4299dec71
1 changed files with 13 additions and 22 deletions
|
|
@ -48,22 +48,20 @@ export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) {
|
|||
display: inline-block;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
height: 40px; /* src = https://www.smashingmagazine.com/2012/02/finger-friendly-design-ideal-mobile-touchscreen-target-sizes/ */
|
||||
min-height: 40px; /* src = https://www.smashingmagazine.com/2012/02/finger-friendly-design-ideal-mobile-touchscreen-target-sizes/ */
|
||||
outline: 0;
|
||||
background-color: transparent;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.btn {
|
||||
height: 24px;
|
||||
min-height: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
border: 1px solid black;
|
||||
border-radius: 8px;
|
||||
background: whitesmoke;
|
||||
color: black;
|
||||
background: #eee; /* minimal styling to make it recognizable as btn */
|
||||
padding: 7px 15px;
|
||||
outline: none; /* focus style handled below, else it follows boundaries of click-area */
|
||||
}
|
||||
|
||||
:host .btn ::slotted(button) {
|
||||
|
|
@ -81,27 +79,20 @@ export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
:host(:focus) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
:host(:focus) .btn {
|
||||
border-color: lightblue;
|
||||
box-shadow: 0 0 8px lightblue, 0 0 0 1px lightblue;
|
||||
/* if you extend, please overwrite */
|
||||
outline: 2px solid #bde4ff;
|
||||
}
|
||||
|
||||
:host(:hover) .btn {
|
||||
background: black;
|
||||
color: whitesmoke;
|
||||
}
|
||||
|
||||
:host(:hover) .btn ::slotted(lion-icon) {
|
||||
fill: whitesmoke;
|
||||
/* if you extend, please overwrite */
|
||||
background: #f4f6f7;
|
||||
}
|
||||
|
||||
:host(:active) .btn,
|
||||
.btn[active] {
|
||||
background: grey;
|
||||
/* if you extend, please overwrite */
|
||||
background: gray;
|
||||
}
|
||||
|
||||
:host([disabled]) {
|
||||
|
|
@ -109,10 +100,10 @@ export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) {
|
|||
}
|
||||
|
||||
:host([disabled]) .btn {
|
||||
/* if you extend, please overwrite */
|
||||
background: lightgray;
|
||||
color: gray;
|
||||
fill: gray;
|
||||
border-color: gray;
|
||||
color: #adadad;
|
||||
fill: #adadad;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue