Skip to content

Commit d4299de

Browse files
daKmoRMikhail Bashkirov
authored andcommitted
feat(button): reduce to minimal css
1 parent f478b98 commit d4299de

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

packages/button/src/LionButton.js

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,20 @@ export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) {
4848
display: inline-block;
4949
padding-top: 2px;
5050
padding-bottom: 2px;
51-
height: 40px; /* src = https://www.smashingmagazine.com/2012/02/finger-friendly-design-ideal-mobile-touchscreen-target-sizes/ */
51+
min-height: 40px; /* src = https://www.smashingmagazine.com/2012/02/finger-friendly-design-ideal-mobile-touchscreen-target-sizes/ */
5252
outline: 0;
5353
background-color: transparent;
5454
box-sizing: border-box;
5555
}
5656
5757
.btn {
58-
height: 24px;
58+
min-height: 24px;
5959
display: flex;
6060
align-items: center;
6161
position: relative;
62-
border: 1px solid black;
63-
border-radius: 8px;
64-
background: whitesmoke;
65-
color: black;
62+
background: #eee; /* minimal styling to make it recognizable as btn */
6663
padding: 7px 15px;
64+
outline: none; /* focus style handled below, else it follows boundaries of click-area */
6765
}
6866
6967
:host .btn ::slotted(button) {
@@ -81,38 +79,31 @@ export class LionButton extends DelegateMixin(SlotMixin(LionLitElement)) {
8179
padding: 0;
8280
}
8381
84-
:host(:focus) {
85-
outline: none;
86-
}
87-
8882
:host(:focus) .btn {
89-
border-color: lightblue;
90-
box-shadow: 0 0 8px lightblue, 0 0 0 1px lightblue;
83+
/* if you extend, please overwrite */
84+
outline: 2px solid #bde4ff;
9185
}
9286
9387
:host(:hover) .btn {
94-
background: black;
95-
color: whitesmoke;
96-
}
97-
98-
:host(:hover) .btn ::slotted(lion-icon) {
99-
fill: whitesmoke;
88+
/* if you extend, please overwrite */
89+
background: #f4f6f7;
10090
}
10191
10292
:host(:active) .btn,
10393
.btn[active] {
104-
background: grey;
94+
/* if you extend, please overwrite */
95+
background: gray;
10596
}
10697
10798
:host([disabled]) {
10899
pointer-events: none;
109100
}
110101
111102
:host([disabled]) .btn {
103+
/* if you extend, please overwrite */
112104
background: lightgray;
113-
color: gray;
114-
fill: gray;
115-
border-color: gray;
105+
color: #adadad;
106+
fill: #adadad;
116107
}
117108
`,
118109
];

0 commit comments

Comments
 (0)