Background Triangle Pattern

Background Triangle Pattern

A clever technique for creating triangles using CSS border (width: 0; height: 0; border: ... solid transparent). The transparent side and top borders allow border-bottom to form a triangle, and its color is cyclically changed via the SCSS selector :nth-child(5n+...).

See the Pen Background Triangle Pattern.

The Half-Rombes Pattern

The Half-Rombes Pattern

The use of the atan() function in SCSS to calculate the angles for a conic-gradient, which allows for the creation of a complex geometric pattern. The entire page background is set with a single background property, demonstrating the power and conciseness of modern CSS.

See the Pen The Half-Rombes Pattern.

Another CSS Pattern

Another CSS Pattern

A sophisticated pure CSS geometric pattern created using layered conic gradients and custom properties. This lightweight and scalable background solution ensures high frontend performance and easy customization via CSS variables, eliminating the need for external image assets.

See the Pen Another CSS Pattern.

Colored Paper

Colored Paper

A vibrant multi-colored chevron pattern built entirely with SCSS and a complex stack of linear gradients. This performant snippet leverages mathematical calculations for offsets and color functions like darken(), offering a scalable, image-free background solution for modern frontend development.

See the Pen Colored Paper.

Random Triangle Background

A dynamic geometric pattern powered by SCSS loops and randomized color palettes for a vibrant kaleidoscope effect. This snippet leverages pure CSS animations and border-width tricks to create a high-performance, interactive background ideal for modern and creative UI/UX designs.

See the Pen Random Triangle Background.

Responsive Triangle Background Images

Responsive Triangle Background Images

A modern technique for creating a responsive background layout using the CSS clip-path property. This snippet showcases how to split the viewport into triangular sections with background images, offering a high-performance, JavaScript-free solution for striking hero sections.

Triangle Pattern

Triangle Pattern

A minimalist pure CSS geometric pattern constructed with a single linear gradient for optimal rendering performance. This snippet allows for instant customization of scale and color through SCSS variables, providing a lightweight, image-free solution for modern web backgrounds.

See the Pen Triangle Pattern.

Triangles Animation

A dynamic geometric background built with SVG polygons and CSS keyframe animations. This performance-oriented snippet creates a professional drifting effect with layered depth, making it an ideal lightweight solution for modern frontend interfaces and tech-focused hero sections.

See the Pen Triangles Animation.

Triangular Grid

Triangular Grid

A sophisticated pure CSS geometric pattern implemented as a Stylus mixin using mathematical trigonometric calculations. This snippet creates a seamless triangle background through layered linear gradients, ensuring high frontend performance and easy customization with zero external image assets.

See the Pen Triangular Grid.

Pure CSS Triangle Grid Tile Flip

CSS 3D tile flip animation with triangular tiles in a grid (12 rows × 7 columns). Each .tile uses ::before / ::after pseudo-elements to form the two faces of an equilateral triangle via clip-path: polygon(...). Tiles alternate parity (--p: 0/1) for staggered timing. The @keyframes r rotates each tile 180° around the X axis (0.5turn → 1turn). The @keyframes f animates brightness for a lighting effect.

Triangle Background

Triangle Background

A single <div> creates a repeating triangle pattern using two linear-gradient layers. background-image uses linear-gradient(120deg, transparent 114px, #65b1b3 114px) and linear-gradient(240deg, ...) with background-size: 93px 92px to tile teal triangles on a white background.

See the Pen Triangle Background.

Two Triangles Background

Two Triangles Background

A single <div class="box"> creates a diagonal split background. The div fills the viewport with background-color: white. Its ::after pseudo-element uses the border trick — border-top: 100vh solid #008ce6 and border-right: 100vw solid transparent — forming a blue triangle that covers the top-right half. The result is a two-tone diagonal background.

See the Pen Two Triangles Background.

3D Triangles Tessellated Pattern. No Div. Pure CSS

3D Triangles Tessellated Pattern. No Div. Pure CSS

Pure CSS 3D tessellated triangle pattern — no HTML elements, no JavaScript. Built entirely with conic-gradient and linear-gradient layers on the <html> element. Uses five dark shades (#050505 to #363636) and custom properties (--u for unit scaling, --gp for repeating tile size). The stacked gradients create an isometric 3D triangle grid with shading and depth.

Triangle Pattern

Triangle Pattern

A 5×5 CSS grid of alternating up/down triangles using the border trick (CSS-Tricks “Shapes of CSS”). .tr-up uses border-top, .tr-down uses border-bottom to form triangles. Silver triangles point up, gold triangles point down in a checkerboard pattern.

See the Pen Triangle Pattern.

Frequently Asked Questions

What is the most performant way to create triangle backgrounds in CSS?

Use clip-path: polygon() with background-image on pseudo-elements — this renders entirely on the compositor thread. The legacy border trick creates triangles by rendering transparent borders, but it generates extra box geometry that increases paint complexity on complex layouts.

How can I create a seamless low-poly tessellation using only CSS?

Layer multiple linear-gradient() functions with sharp color stops at precise angles (30deg, 60deg) within a single background-image declaration. Combine this with precise background-size values that create repeating triangular units without gaps or overlapping artifacts.

How do triangle backgrounds affect INP and layout stability?

Triangle backgrounds using clip-path or gradients add zero layout shift — they are purely visual and do not affect the layout tree. However, using the border trick on actual DOM elements for triangles forces the browser to compute extra border geometry, increasing main-thread paint time.

How to make triangle backgrounds responsive across different screen sizes?

Define the clip-path polygon coordinates and background-size using relative units (%, vw) combined with CSS Container Queries. This scales triangle angles and density proportionally without duplicating the background definition per breakpoint.

What fallback works for browsers that don’t support clip-path: polygon()?

Layer a solid background-color as the first declaration, then override it with the triangle pattern inside a @supports (clip-path: polygon(0 0)) rule. For the border-based triangle technique, it works natively in all browsers down to IE8 without any feature detection.