-
Notifications
You must be signed in to change notification settings - Fork 921
/
Button.astro
56 lines (49 loc) · 1.21 KB
/
Button.astro
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
const { style } = Astro.props;
---
<style lang="scss">
@use '../../public/styles/var' as *;
.btn {
box-sizing: border-box;
margin-top: 2px;
margin-bottom: 2px;
display: inline-block;
padding: 0.6em 1em 0.4em;
line-height: 1;
font-weight: bold;
font-size: 1.3em;
font-family: inherit;
letter-spacing: -0.025em;
font-family: 'Overpass', sans-serif;
white-space: nowrap;
text-align: center;
text-decoration: none;
vertical-align: middle;
background-color: #fefefe;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: 0 0px 2px 0 rgba(0, 0, 0, 0);
cursor: pointer;
text-decoration: none;
user-select: none;
transition: transform 100ms cubic-bezier(0.7, 0, 0.84, 0), box-shadow 100ms linear, border-color 40ms linear;
&:hover,
&:focus {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
border-color: #bbb;
transform: translateY(-1px);
}
&:focus {
border-color: #00f;
}
&__primary {
color: #fff;
background: linear-gradient(45deg, $rainbow-green, $rainbow-blue, $rainbow-purple);
border-color: $rainbow-blue;
&:hover {
border-color: $rainbow-blue;
}
}
}
</style>
<span class={`btn${style ? ` btn__${style}`: ''}`}><slot /></span>