Today I read "While You Weren’t Looking, CSS Gradients Got Better" by Ana Tudor. Ana’s articles are always full of CSS knowledge, and I can only recommend following her and her work.

The article includes a nifty little CSS gradient trick. Let’s say you have a linear-gradient that includes "hard color stops". Then your CSS looks like the following:

.element {
/* some styles */
background: linear-gradient(
#fc6262 20%,     /* start at 0 and end at 20% */
#50bbf6 20% 40%, /* start at 20% and end at 40% */
#aaffef 40% 60%, /* start at 40% and end at 60% */
#f9e699 60% 80%, /* and so on... */
#2c3749 80%
);
}

This approach works fine, but it has one downside. To d…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help