Recreate a circle gradient border

So I'm creating a website based on a design and I have to recreate the reviews section (which has the reviews all around the circles), which has those interesting circles with gradients. I was wondering which way is more logical - doing with a gradient or with border? Here's a link to the design - https://dribbble.com/shots/25168170-Web-App-Landing-Page. Thanks in advance!
8 Replies
MarkBoots
MarkBootsā€¢2w ago
you could do both, but i think a border might render more nicely
YN20
YN20ā€¢2w ago
Can you combine border and gradient that would be fun
GeorgeCraft225
GeorgeCraft225OPā€¢2w ago
OK, so I tried doing with a border and a gradient... xD However, border-radius won't apply to it... Here's the code: https://github.com/GeorgeDash/alpine-cargo. I'm using Tailwind CSS.
capt_uhu
capt_uhuā€¢2w ago
unfortunately border-radius and border-image don't work together and probably never will... but you can recreate this with layered background images with different background-origin values: https://codepen.io/jsnkuhn/pen/LEPePXp
nilaallj
nilaalljā€¢2w ago
If you for whatever reason need a transparent background you can use the approach from this pen; putting the gradient on a pseudo element with some masking. The pen also includes a much simpler solution for browsers with support for background-clip: border-area (only Safari for the time being). https://codepen.io/nilaallj/pen/dyBLqbV
GeorgeCraft225
GeorgeCraft225OPā€¢2w ago
OMG, thank you so much! I really appreciate it; I'm gonna try it later and see if it works for me! Thank you, too! OK, so I tried it and it worked! Thank you so much again, both of you! @nilaallj Is there a way to change the size of the gradient?
nilaallj
nilaalljā€¢2w ago
Not sure exactly what you mean by that. If you want to change the size of the border you change the border width (which is a variable in this solution in order to work with the pseudo element). If you want to change the size of the entire element you use width and hight. The gradient itself is a background image of the entire element, you can change it with the gradient variable. šŸ˜ƒ
GeorgeCraft225
GeorgeCraft225OPā€¢2w ago
Yeah, I meant with the width and the height, thanks! šŸ˜Š

Did you find this page helpful?