Skip to content

Commit cfa75d6

Browse files
committed
style: allow verbose background customization with --green-check-bg
1 parent 6b5aaad commit cfa75d6

2 files changed

Lines changed: 18 additions & 36 deletions

File tree

.changeset/long-moles-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vnphanquang/green-check': patch
3+
---
4+
5+
allow verbose background customization with `--green-check-bg`

src/template.css

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
@property --green-check-fg {
2-
inherits: true;
3-
initial-value: #000;
4-
syntax: '<color>';
5-
}
6-
7-
@property --green-check-bg-gradient-start {
8-
inherits: true;
9-
initial-value: #06ff06;
10-
syntax: '<color>';
11-
}
12-
13-
@property --green-check-bg-gradient-stop {
14-
inherits: true;
15-
initial-value: #dffcdd;
16-
syntax: '<color>';
17-
}
18-
19-
@property --green-check-bg {
20-
inherits: true;
21-
initial-value: #fff;
22-
syntax: '<color>';
23-
}
24-
251
@font-face {
262
font-family: 'TWK Everett';
273
src: url('https://www.thegreenwebfoundation.org/wp-content/themes/tgwf-2020/assets/fonts/twkeverett/twkeverett-regular.woff2')
@@ -30,9 +6,12 @@
306

317
:host {
328
--green-check-fg: #000;
33-
--green-check-bg-gradient-start: #6c6c6c;
34-
--green-check-bg-gradient-stop: #dedede;
35-
--green-check-bg: #fff;
9+
--green-check-bg: linear-gradient(
10+
45deg,
11+
#6c6c6c 4%,
12+
#dedede 24%,
13+
#fff 32%
14+
);
3615

3716
display: block;
3817
width: fit-content;
@@ -42,9 +21,12 @@
4221

4322
:host([green]:not([green='false'])) {
4423
--green-check-fg: #000;
45-
--green-check-bg-gradient-start: #06ff06;
46-
--green-check-bg-gradient-stop: #dffcdd;
47-
--green-check-bg: #fff;
24+
--green-check-bg: linear-gradient(
25+
45deg,
26+
#06ff06 4%,
27+
#dffcdd 24%,
28+
#fff 32%
29+
);
4830
}
4931

5032
* {
@@ -67,12 +49,7 @@ a {
6749
color: var(--green-check-fg);
6850
letter-spacing: 0;
6951

70-
background-image: linear-gradient(
71-
45deg,
72-
var(--green-check-bg-gradient-start) 4%,
73-
var(--green-check-bg-gradient-stop) 24%,
74-
var(--green-check-bg) 32%
75-
);
52+
background: var(--green-check-bg);
7653
border: 2px solid currentcolor;
7754
border-radius: 8px;
7855
}

0 commit comments

Comments
 (0)