-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.scala
More file actions
35 lines (28 loc) · 783 Bytes
/
Copy pathButton.scala
File metadata and controls
35 lines (28 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package pureframes.tetrio.app.components
import pureframes.css.*
import pureframes.tetrio.app.AppMsg
import tyrian.Html.*
import tyrian.*
object Button extends Styled:
def apply[M](attributes: Attr[M]*)(str: String): Html[M] =
apply(attributes*)(text(str))
def apply[M](attributes: Attr[M]*)(children: Elem[M]*): Html[M] =
button(
(cls := styles.className) +: attributes.toList
)(children.toList)
val styles = css"""
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-weight: 500;
font-family: inherit;
cursor: pointer;
transition: border-color 0.25s;
&:hover {
border-color: #646cff;
}
&:focus,
&:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}
"""