-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
discord.css
113 lines (97 loc) · 2.42 KB
/
discord.css
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
* File: discord.css
* Project: discord-rpc
* File Created: Sunday, 12th February 2023 6:59:21 pm
* Author: Tee ([email protected])
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:42 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
*/
/*
https://codepen.io/RobertAron/pen/jOrqjea
*/
:root {
--light-grey: hsl(218deg, 4%, 46%);
--green: hsl(152deg, 45%, 48%);
}
.checkbox-container {
display: grid;
gap: 8px;
grid-template-columns: max-content min-content;
grid-template-rows: max-content;
align-items: center;
}
.checkbox-container > input,
.checkbox-container > div {
grid-column: 2/3;
grid-row: 1/2;
}
.checkbox {
width: 100%;
height: 100%;
appearance: none;
margin: 0;
padding: 0;
}
.checkbox-visual {
position: relative;
background: var(--light-grey);
transition: 0.3s cubic-bezier(0.83, 0, 0.17, 1);
font-size: 1em;
width: 2em;
height: 1em;
padding: 0.1em;
border-radius: 9999px;
pointer-events: none;
}
.checkbox:checked ~ .checkbox-visual {
background: var(--green);
}
.checkbox ~ .checkbox-visual > div {
position: relative;
left: 0;
height: 0.8em;
width: 0.8em;
background: white;
pointer-events: none;
transition: inherit;
border-radius: 9999px;
display: grid;
justify-items: stretch;
align-items: stretch;
padding: 0.1em;
}
.checkbox:checked ~ .checkbox-visual > div {
left: calc(100%);
transform: translateX(-100%);
background: white;
display: grid;
}
.checkbox ~ .checkbox-visual > div:before,
.checkbox ~ .checkbox-visual > div:after {
content: "";
transition: inherit;
background-color: var(--light-grey);
grid-column: 1/2;
grid-row: 1/2;
}
.checkbox:checked ~ .checkbox-visual > div:before,
.checkbox:checked ~ .checkbox-visual > div:after {
background-color: var(--green);
}
.checkbox ~ .checkbox-visual > div:before {
clip-path: polygon(20% 0%, 0% 20%, 80% 100%, 100% 80%);
}
.checkbox:checked ~ .checkbox-visual > div:before {
clip-path: polygon(25% 75%, 33% 100%, 100% 20%, 80% 0%);
}
.checkbox ~ .checkbox-visual > div:after {
clip-path: polygon(0% 80%, 20% 100%, 100% 20%, 80% 0%);
}
.checkbox:checked ~ .checkbox-visual > div:after {
clip-path: polygon(20% 45%, 0% 65%, 33.33% 100%, 45% 75%);
}