CssShift logo CssShift — CSS Gradient Studio

Yellow to Green Gradient — CSS, Hex and Angles

Citrus and spring foliage — a fresh accent for eco and wellness products. The pair is #FACC15 → #22C55E, and on a 135° axis it reads as a diagonal wash. Everything below is generated from those two values, so the CSS you copy is exactly what the previews render.

0° · bottom to top
45°
135° · default
90° · left to right
radial
conic

Copy the CSS

CSS
.gradient {
  background: #FACC15; /* fallback for old browsers */
  background: -webkit-linear-gradient(135deg, #FACC15 0%, #22C55E 100%);
  background: -moz-linear-gradient(135deg, #FACC15 0%, #22C55E 100%);
  background: linear-gradient(135deg, #FACC15 0%, #22C55E 100%);
}
CSS-in-JS
const gradientStyle = {
  background: '#FACC15', // fallback
  backgroundImage: 'linear-gradient(135deg, #FACC15 0%, #22C55E 100%)',
};

The two endpoints

NameHexRGBHSLvs whitevs black
Yellow#FACC15rgb(250, 204, 21)hsl(48, 96%, 53%)1.53:113.71:1
Green#22C55Ergb(34, 197, 94)hsl(142, 71%, 45%)2.28:19.22:1

The midpoint is #8ec93a (rgb(142, 201, 58), saturation 57%). Close to the 83% the two ends average, so the transition stays saturated throughout.

What each angle does

AngleDirectionFunction value
0°bottom → toplinear-gradient(0deg, #FACC15 0%, #22C55E 100%)
45°bottom-left → top-rightlinear-gradient(45deg, #FACC15 0%, #22C55E 100%)
90°left → rightlinear-gradient(90deg, #FACC15 0%, #22C55E 100%)
135°top-left → bottom-rightlinear-gradient(135deg, #FACC15 0%, #22C55E 100%)
180°top → bottomlinear-gradient(180deg, #FACC15 0%, #22C55E 100%)
225°top-right → bottom-leftlinear-gradient(225deg, #FACC15 0%, #22C55E 100%)
270°right → leftlinear-gradient(270deg, #FACC15 0%, #22C55E 100%)
315°bottom-right → top-leftlinear-gradient(315deg, #FACC15 0%, #22C55E 100%)

The same pair as linear, radial and conic

TypeFunction value
linearlinear-gradient(135deg, #FACC15 0%, #22C55E 100%)
radialradial-gradient(circle at 50% 50%, #FACC15 0%, #22C55E 100%)
conicconic-gradient(from 0deg at 50% 50%, #FACC15 0%, #22C55E 100%)

Frequently asked

What is the CSS for a yellow to green gradient?
background: linear-gradient(135deg, #FACC15 0%, #22C55E 100%); — #FACC15 at 0% and #22C55E at 100%, on a 135° axis. Swap 135deg for to right if you want the direction to follow the element ratio instead of a fixed angle.

Does it need vendor prefixes?
Not for current browsers. Unprefixed linear-gradient has been supported everywhere for years, and the -webkit- / -moz- lines only matter for stacks that still ship to browsers older than 2013. The generator emits both, plus a solid #FACC15 fallback.

Why would the middle look muddy?
This pair does not: both ends are close enough in hue that a straight sRGB blend stays clean, with mid #8ec93a holding 57% saturation against 83% at the ends.

Can I put text straight onto it?
Check both ends, not the average. White text clears 4.5:1 against neither end and black text clears it against the yellow end. Measured ratios: Yellow is 1.53:1 on white and 13.71:1 on black; Green is 2.28:1 on white and 9.22:1 on black.

Related gradients