DEV Community

Cover image for Different use for CSS gradients
Raja Krishna
Raja Krishna

Posted on

2

Different use for CSS gradients

Recently i was working on a small project of making a digital clock chrome extension. I wanted to keep the design as minimal as possible and also reduce the size of the extension. So instead of regular BORING backgrounds, i tried to use CSS gradients to see if i could come up with something.

Tried every possible way and the gradients were bad. So as a last resort i googled to see if i could have a multi-colored CSS gradient without actually having a transition from color to color. Then i stumbled upon this post:
https://blog.prototypr.io/css-only-multi-color-backgrounds-4d96a5569a20

The simple logic here is that we stop the first color at x% and start the second color at x% or <x%. This removes the gradient from the linear-gradient and defines a clear edge between both colors giving the background a multi-colored-material effect. You can check out more in the post.

You can check out the extension here: https://chrome.google.com/webstore/detail/simple-clock/fngkigemfllijjloedplghepagidclef

GitHub link to the project: https://github.com/Raja-Krishna/Simple-Clock

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay