Hero section backgrounds for SaaS landing pages

Glows, grids and grain behind a product screenshot. Here is how to choose one, build it in CSS and keep it from slowing the page.

8 min read
Laptop screen floating over a dark grid with a violet mesh-gradient wave behind it
In short
  • 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.
0Image requests for a CSS mesh glow
2.5sGood LCP at the 75th percentile
4.5:1Minimum contrast for body text

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 typeBest forTypical costMain risk
Mesh gradient glowProducts with a strong UI screenshot0 image requests, pure CSSBanding on large dark areas
Grid or dot patternDeveloper tools, data and infrastructure products0 image requests, pure CSSMoiré on high-density screens if lines are too fine
Grain over a gradientBrands that want a softer, printed feelOne small tile, 2 to 10 KBMuddy text contrast if grain is too strong
Photo or 3D renderHardware, field teams, physical outcomes80 to 250 KB in AVIF or WebPBecomes the LCP element and slows the page
Product screenshot on flat colorEarly MVPs with one clear screenThe screenshot onlyLooks unfinished if the screenshot is weak
Animated gradient or canvasLaunch pages and AI products that sell motionCPU and GPU time on every frameBattery 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:

  1. Fade to transparent, not to the base color. Overlapping gradients then blend into each other instead of leaving hard edges.
  2. Keep alpha between 0.15 and 0.4. Higher values look like spotlights and fight the headline for attention.
  3. 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 add fetchpriority="high", width and height.
  • 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.

TechniqueWhat the browser does each frameVerdict
Animate background-position of a gradientRepaints the whole heroAvoid on large areas
Animate transform of blurred blob elementsMoves layers on the compositorFine with 2 to 3 blobs
filter: blur(80px) recalculated while animatingRe-blurs a large textureExpensive, especially on phones
Looping videoDecodes frames continuouslyHeavy in bytes and battery
Canvas or WebGL shaderRuns JavaScript or GPU work per frameOnly 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

  1. The headline and button stay readable at 4.5:1 or better over the brightest part of the background, in both themes.
  2. The background is CSS only, or any raster layer is under about 100 KB and is not the LCP element.
  3. The product screenshot is an <img> with width, height and fetchpriority="high".
  4. The brightest glow sits behind the product, not behind the text.
  5. Grid or dot lines fade out with a mask and do not shimmer on a phone while scrolling.
  6. Any animation moves with transform only and stops under prefers-reduced-motion: reduce.
  7. Large dark gradients have a grain layer or show no visible banding on a laptop screen.
  8. 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.

Questions about SaaS hero backgrounds

What is the best background for a SaaS hero section?

For most products, a CSS mesh-gradient glow behind a real product screenshot. It costs no image requests, carries the brand palette and keeps attention on the UI. Use a grid or dot pattern for developer tools, and a photo or 3D render only when the product has a physical side.

Should the hero screenshot be an img tag or a CSS background?

An img tag. The browser finds it earlier, you can set width, height and fetchpriority="high", and it is usually the LCP element, so its loading strategy matters most. Keep CSS backgrounds for gradients and patterns.

Do animated gradient backgrounds hurt performance?

They can. Animating background-position or a live blur filter repaints a large area on every frame. Blurring blobs once and moving them with transform is much cheaper. Always stop the animation for visitors who set prefers-reduced-motion.

How do I stop banding in dark gradients?

Add a faint grain layer on top, either a small noise tile or an SVG turbulence filter rendered once. The noise breaks up visible color steps on 8-bit screens without changing the overall look.

How strong should the glow be in a light theme?

About half the alpha you use on a dark base. Color on white reads stronger, so a 0.35 glow on dark becomes roughly 0.14 to 0.18 on light. Check text contrast at the brightest point of the glow in both themes.

Keep reading

Built for the web.
Free to download.