Skip to content

Commit 8fa46aa

Browse files
committed
Use easing gradients
1 parent 641633a commit 8fa46aa

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

.changeset/sparkly-papers-flow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'hexo-theme-cupertino': minor
3+
---
4+
5+
Turn linear gradient masks in cover images to the easing ones.

source/css/post.scss

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,26 @@ body {
6161

6262
& > .cover-img {
6363
--h: 300px;
64-
mask-image: linear-gradient(to bottom, #000, transparent);
64+
/* https://larsenwork.com/easing-gradients/ */
65+
mask-image: linear-gradient(
66+
to bottom,
67+
hsl(0, 0%, 0%) 0%,
68+
hsla(0, 0%, 0%, 0.987) 8.1%,
69+
hsla(0, 0%, 0%, 0.951) 15.5%,
70+
hsla(0, 0%, 0%, 0.896) 22.5%,
71+
hsla(0, 0%, 0%, 0.825) 29%,
72+
hsla(0, 0%, 0%, 0.741) 35.3%,
73+
hsla(0, 0%, 0%, 0.648) 41.2%,
74+
hsla(0, 0%, 0%, 0.55) 47.1%,
75+
hsla(0, 0%, 0%, 0.45) 52.9%,
76+
hsla(0, 0%, 0%, 0.352) 58.8%,
77+
hsla(0, 0%, 0%, 0.259) 64.7%,
78+
hsla(0, 0%, 0%, 0.175) 71%,
79+
hsla(0, 0%, 0%, 0.104) 77.5%,
80+
hsla(0, 0%, 0%, 0.049) 84.5%,
81+
hsla(0, 0%, 0%, 0.013) 91.9%,
82+
hsla(0, 0%, 0%, 0) 100%
83+
);
6584
mask-composite: destination-in;
6685
height: var(--h);
6786
margin-bottom: calc(var(--h) * -0.6);

0 commit comments

Comments
 (0)