- If the product UI is strong, make the screenshot the image and keep the background in CSS.
- A mesh glow is two to four radial gradients at 0.15 to 0.4 alpha, brightest behind the product.
- Animate blurred blobs with transform only and stop them under prefers-reduced-motion.
- Store glow, line and base colors as tokens so light and dark themes stay in sync.
A SaaS hero background has one job: make the product easy to see in the first second. Glows, grids and grain all help with that job or work against it. You can tell which by measuring contrast, bytes and paint time. If you work with a team that offers SaaS app development services, such as YuSMP Group, the hero is usually the first screen they build and the one that gets rebuilt most often. It is worth getting the background layer right once and turning it into a reusable pattern.
Every snippet below uses unprefixed CSS that works in current Chrome, Safari and Firefox.
What does a SaaS hero background have to do?
A SaaS hero usually holds four things: a headline, a one-line value statement, a call to action and a picture of the product. The background sits behind all four. It should do three things and nothing else.
- Separate the hero from the rest of the page. A change in color or texture tells the eye where the pitch ends and the details begin.
- Point at the product. A glow behind the screenshot or a grid that fades toward it pulls attention to the thing you sell.
- Carry the brand palette. One or two brand colors at low intensity are enough. The logo and the button already do the loud work.
What it should not do: compete with the headline, hide text behind busy detail or delay the first render. If removing the background makes the hero easier to read, the background is too strong.
Which background type fits your product?
If the product UI is good, let it be the image and keep the background in CSS. If the product is invisible, such as an API or a backend service, use a pattern or a render that hints at what it does. The table below compares six common types. For the trade-off between drawn and photographic layers in general, see CSS gradients vs image backgrounds.
Most SaaS heroes use one of these six background types or a mix of two. The right one depends on what you have to show and how much weight you can afford above the fold.
| Background type | Best for | Typical cost | Main risk |
|---|---|---|---|
| Mesh gradient glow | Products with a strong UI screenshot | 0 image requests, pure CSS | Banding on large dark areas |
| Grid or dot pattern | Developer tools, data and infrastructure products | 0 image requests, pure CSS | Moiré on high-density screens if lines are too fine |
| Grain over a gradient | Brands that want a softer, printed feel | One small tile, 2 to 10 KB | Muddy text contrast if grain is too strong |
| Photo or 3D render | Hardware, field teams, physical outcomes | 80 to 250 KB in AVIF or WebP | Becomes the LCP element and slows the page |
| Product screenshot on flat color | Early MVPs with one clear screen | The screenshot only | Looks unfinished if the screenshot is weak |
| Animated gradient or canvas | Launch pages and AI products that sell motion | CPU and GPU time on every frame | Battery drain and jank on low-end phones |
How do you build a mesh-gradient glow in CSS?
The soft color clouds behind many SaaS screenshots are not images. They are two to four radial gradients stacked on a dark base. Each gradient is a colored ellipse that fades to transparent.
.hero {
background-color: #0b0b12;
background-image:
radial-gradient(40% 50% at 20% 30%, rgb(124 58 237 / .35), transparent 70%),
radial-gradient(35% 45% at 80% 20%, rgb(59 130 246 / .25), transparent 70%),
radial-gradient(50% 40% at 50% 100%, rgb(236 72 153 / .18), transparent 70%);
}Three details make it look smooth instead of flat:
- Fade to transparent, not to the base color. Overlapping gradients then blend into each other instead of leaving hard edges.
- Keep alpha between 0.15 and 0.4. Higher values look like spotlights and fight the headline for attention.
- Place the brightest cloud behind the screenshot, not behind the text. Text needs a calm area, and the product benefits from a halo.
Large dark gradients can show visible bands on 8-bit screens. A faint grain layer on top breaks the bands up. Our guide to grain and noise in web design shows how to build that tile. If you want a ready-made raster version, the soft gradient mesh backgrounds set gives you the same look as a file you can crop.
How do you add a grid or dot pattern without an image?
Developer-facing products often use a thin grid or a dot field that fades out toward the edges. Both are two lines of CSS plus a mask.
.hero-grid {
background-image:
linear-gradient(rgb(255 255 255 / .06) 1px, transparent 1px),
linear-gradient(90deg, rgb(255 255 255 / .06) 1px, transparent 1px);
background-size: 48px 48px;
mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 40%, transparent 100%);
}
.hero-dots {
background-image: radial-gradient(rgb(255 255 255 / .12) 1px, transparent 1px);
background-size: 24px 24px;
}The mask is what makes the pattern look designed instead of like graph paper. It keeps the lines strongest around the product and lets them disappear before they reach the page edges.
Keep line opacity under about 0.1 on dark themes and spacing at 24 px or more. Thin 1 px lines spaced closer than that tend to shimmer when the page scrolls on phones with fractional pixel ratios. For curved or irregular motifs, an inline SVG tile gives you more freedom. See SVG pattern backgrounds for that route.
How should the product screenshot sit on the background?
On most SaaS pages the screenshot, not the background, is the largest element above the fold. That means it is usually the Largest Contentful Paint element, and its loading strategy matters more than any gradient. Google treats an LCP of 2.5 seconds or less as good, measured at the 75th percentile of visits (web.dev on LCP).
- Ship the screenshot as an
<img>, not a CSS background. The browser discovers it earlier, and you can addfetchpriority="high",widthandheight. - Export at 2x the displayed width, then compress. A 1200 px wide frame needs a 2400 px source. In AVIF or WebP a dense dashboard often lands around 120 to 250 KB.
- Give it a frame, not a fake device. A thin border, an 8 to 12 px radius and a soft shadow separate it from the glow. Heavy device mockups add bytes and date quickly.
- Let the glow overlap the frame edge. A cloud that starts behind the screenshot and spills past it ties the two layers together.
.shot {
border: 1px solid rgb(255 255 255 / .1);
border-radius: 12px;
box-shadow: 0 30px 80px -20px rgb(124 58 237 / .45);
}Gradients themselves are not LCP candidates, so a CSS background will not compete with the screenshot. A photo used as background-image can be, which is one more reason to keep raster files out of the hero layer. More on loading order is in Fast background images.
What does an animated background cost?
Slowly drifting gradient blobs are popular on AI product pages. They look cheap and are not. The cost depends on what you animate.
| Technique | What the browser does each frame | Verdict |
|---|---|---|
Animate background-position of a gradient | Repaints the whole hero | Avoid on large areas |
Animate transform of blurred blob elements | Moves layers on the compositor | Fine with 2 to 3 blobs |
filter: blur(80px) recalculated while animating | Re-blurs a large texture | Expensive, especially on phones |
| Looping video | Decodes frames continuously | Heavy in bytes and battery |
| Canvas or WebGL shader | Runs JavaScript or GPU work per frame | Only when motion is the product |
The safe pattern is to blur each blob once and then move it with transform only. Pause everything for visitors who ask for less motion. The prefers-reduced-motion media query exposes that setting (MDN reference).
.blob {
filter: blur(80px);
animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
to { transform: translate3d(8%, -6%, 0) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
.blob { animation: none; }
}Keep the cycle long, 20 seconds or more. Fast motion behind a headline reads as a loading state, not as atmosphere.
How do you keep light and dark themes in sync?
Many SaaS products ship both themes, and the landing page often follows the visitor's system setting. A glow tuned for a black base turns into a stain on white. The fix is to treat background values as design tokens instead of hard-coding them in each section.
:root {
--hero-base: #ffffff;
--hero-glow-1: rgb(124 58 237 / .14);
--hero-glow-2: rgb(59 130 246 / .10);
--hero-line: rgb(15 23 42 / .06);
}
@media (prefers-color-scheme: dark) {
:root {
--hero-base: #0b0b12;
--hero-glow-1: rgb(124 58 237 / .35);
--hero-glow-2: rgb(59 130 246 / .25);
--hero-line: rgb(255 255 255 / .06);
}
}As a starting point, give light themes about half the glow alpha of dark ones, because color on white looks stronger. Grid lines flip from white-on-dark to dark-on-light at about the same low opacity. Body text over the hero still has to reach a 4.5:1 contrast ratio in both themes. Check it at the brightest point of the glow, not the average. Our notes on backgrounds for dark mode and text contrast on backgrounds cover the tests in more depth.
Pre-launch checklist for a SaaS hero background
- The headline and button stay readable at 4.5:1 or better over the brightest part of the background, in both themes.
- The background is CSS only, or any raster layer is under about 100 KB and is not the LCP element.
- The product screenshot is an
<img>withwidth,heightandfetchpriority="high". - The brightest glow sits behind the product, not behind the text.
- Grid or dot lines fade out with a mask and do not shimmer on a phone while scrolling.
- Any animation moves with
transformonly and stops underprefers-reduced-motion: reduce. - Large dark gradients have a grain layer or show no visible banding on a laptop screen.
- Background colors come from tokens shared with the product UI, so a palette change updates both.
If you need a texture layer rather than a pure gradient, the subtle grain gradient set works as a base under a CSS glow. Crop it, tint it toward your palette and keep it under the text-contrast limit.



