CSS Logos: 17 Logo Marks Built in Pure CSS

CSS logos are marks the browser paints from styled HTML elements, so there is no image file and no logo request. They stay sharp at any size and recolor from custom properties.

Below are 18 famous logos rebuilt in pure CSS that you can try and copy, followed by a guide to the techniques, accessibility, and when an image file still wins.

By Bogdan Sandu ยท Updated October 26, 2026

Logos from circles and border-radius

Famous marks that come down to circles, ellipses and rounded corners, with ::before and ::after adding the extra shapes. These marks are trademarks of their owners and are rebuilt here only to demonstrate CSS techniques. Each one is a single role="img" element with the brand name as its aria-label.

Mastercard

  • border-radius: 50%
  • overflow: hidden
  • copied circle for the overlap

Two circles in the official red and yellow. The orange overlap is a copy of the red circle placed inside the yellow one, which has overflow: hidden and a round radius, so only the lens where both circles meet shows. That gives the exact brand orange, which mix-blend-mode cannot produce from these two colors.

View code
.lo-mc {
  position: relative;
  width: 160px;
  height: 99px;
}
.lo-mc::before,
.lo-mc__right {
  content: "";
  position: absolute;
  top: 0;
  width: 99px;
  height: 99px;
  border-radius: 50%;
}
.lo-mc::before {
  left: 0;
  background: #eb001b;
}
.lo-mc__right {
  left: 61px;
  overflow: hidden;
  background: #f79e1b;
}
.lo-mc__right::before {
  content: "";
  position: absolute;
  top: 0;
  left: -61px;
  width: 99px;
  height: 99px;
  border-radius: 50%;
  background: #ff5f00;
}

Target bullseye

  • border as a ring
  • box-sizing: border-box
  • centered ::after

The outer red ring is a border, the white ring is the element background, and the center dot is ::after. With box-sizing: border-box and three equal bands of one sixth of the width each, the proportions match the bullseye at any size.

View code
.lo-tg {
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  box-sizing: border-box;
  border: 21px solid #cc0000;
  border-radius: 50%;
  background: #fff;
}
.lo-tg::after {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #cc0000;
}

Pepsi globe

  • rotated ellipses
  • overflow: hidden
  • border-radius: 50%

The approach Skillcrush describes for its Pepsi build: ellipses from border-radius, rotated into place. A white circle with overflow: hidden holds a red ellipse at the top and a blue one at the bottom, and the white left between them is the wave.

View code
.lo-pep {
  position: relative;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px #d5d9e2;
  overflow: hidden;
}
.lo-pep::before,
.lo-pep::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.lo-pep::before {
  top: -84%;
  left: -50%;
  width: 190%;
  height: 124%;
  background: #e32934;
  transform: rotate(-10deg);
}
.lo-pep::after {
  top: 53%;
  left: -40%;
  width: 200%;
  height: 130%;
  background: #004b93;
  transform: rotate(-18deg);
}

Toyota ovals

  • elliptical border-radius
  • uneven border widths
  • absolute layering

Three ellipses drawn as borders: the wide outer oval, a tall inner oval that touches it top and bottom, and a short wide oval across the top. Thicker side borders than top and bottom borders give the strokes the swelling the real mark has.

View code
.lo-toy {
  position: relative;
  width: 168px;
  height: 112px;
}
.lo-toy::before,
.lo-toy::after,
.lo-toy span {
  content: "";
  position: absolute;
  box-sizing: border-box;
  border: solid #eb0a1e;
  border-radius: 50%;
}
.lo-toy::before {
  inset: 0;
  border-width: 10px 15px;
}
.lo-toy::after {
  top: 0;
  left: 50%;
  width: 60px;
  height: 112px;
  margin-left: -30px;
  border-width: 7px 11px;
}
.lo-toy span {
  top: 6px;
  left: 50%;
  width: 118px;
  height: 56px;
  margin-left: -59px;
  border-width: 7px 13px;
}

Instagram glyph

  • bordered box
  • ::before ring
  • ::after dot

The build Code With Random walks through: a rounded square with a thick border is the camera body, ::before is the lens ring and ::after is the dot in the upper right. This is the one-color glyph version, which needs no gradient.

View code
.lo-ig {
  position: relative;
  width: 112px;
  height: 112px;
  box-sizing: border-box;
  border: 10px solid #000;
  border-radius: 32px;
}
.lo-ig::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  box-sizing: border-box;
  border: 10px solid #000;
  border-radius: 50%;
}
.lo-ig::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #000;
}

McDonald's golden arches

  • three-sided border
  • elliptical top radius
  • negative margin

Each arch is a box with a thick border on the top and sides only, and a radius of 50% / 100% on the top corners turns that border into a tall curve. A negative margin makes the two inner legs share one stroke, which forms the M.

View code
.lo-mcd {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 132px;
  height: 132px;
  box-sizing: border-box;
  padding-bottom: 22px;
  border-radius: 14px;
  background: #da291c;
}
.lo-mcd span {
  width: 56px;
  height: 84px;
  box-sizing: border-box;
  border: 13px solid #ffc72c;
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.lo-mcd span + span {
  margin-left: -13px;
}

Logos cut with clip-path polygons

Marks with straight cuts, points and slants. clip-path: polygon() takes percentage coordinates, so every point stays in proportion when the box is resized.

Mitsubishi three diamonds

  • clip-path: polygon()
  • transform-origin
  • rotate 120deg

One rhombus clipped from a rectangle, used three times. Its short diagonal equals its side, which gives the 60 degree tip, and each copy rotates 120 degrees around its bottom point with transform-origin: 50% 100%, so the three tips meet in the center.

View code
.lo-mit {
  position: relative;
  width: 170px;
  height: 150px;
}
.lo-mit span {
  position: absolute;
  top: 6px;
  left: 59px;
  width: 52px;
  height: 90px;
  background: #e60012;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform-origin: 50% 100%;
}
.lo-mit span:nth-child(2) {
  transform: rotate(120deg);
}
.lo-mit span:nth-child(3) {
  transform: rotate(240deg);
}

Chevrolet bowtie

  • twelve-point polygon
  • scaled copy as outline
  • percentage points

The bowtie is one twelve-point polygon with every slanted edge on the same angle. The dark outline is the element itself and the gold face is ::after with the same polygon, scaled down a little in each direction.

View code
.lo-chev {
  position: relative;
  width: min(220px, 100%);
  aspect-ratio: 5 / 2;
  background: #4a4d52;
  clip-path: polygon(33% 0, 62% 0, 63.4% 27.5%, 97.5% 27.5%, 99.8% 72.5%, 65.6% 72.5%, 67% 100%, 38% 100%, 36.6% 72.5%, 2.2% 72.5%, 0 27.5%, 34.4% 27.5%);
}
.lo-chev::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #d1a23b;
  clip-path: polygon(33% 0, 62% 0, 63.4% 27.5%, 97.5% 27.5%, 99.8% 72.5%, 65.6% 72.5%, 67% 100%, 38% 100%, 36.6% 72.5%, 2.2% 72.5%, 0 27.5%, 34.4% 27.5%);
  transform: scale(.95, .84);
}

YouTube play button

  • elliptical border-radius
  • clip-path triangle
  • place-items: center

A red rectangle with elliptical corners (22% / 32%) gets close to the rounded play button shape, and ::after is a three-point clip-path triangle. The triangle is nudged right of center, as in the real icon, so it looks optically centered.

View code
.lo-yt {
  display: grid;
  place-items: center;
  width: 150px;
  height: 105px;
  border-radius: 22% / 32%;
  background: #ff0000;
}
.lo-yt::after {
  content: "";
  width: 36px;
  height: 42px;
  margin-left: 6px;
  background: #fff;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

Deutsche Bank slash in a square

  • border
  • rotate(45deg)
  • matched stroke width

The square is a border and the slash is ::after, rotated 45 degrees with the same width as the border so both strokes match. Leaving space between the slash ends and the frame is what makes it read as this mark and not a crossed-out box.

View code
.lo-db {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  box-sizing: border-box;
  border: 13px solid #0018a8;
}
.lo-db::after {
  content: "";
  width: 13px;
  height: 82px;
  background: #0018a8;
  transform: rotate(45deg);
}

Logos from grids and bars

Squares, stripes and rounded bars placed with CSS grid, absolute positioning and transforms. These are the most faithful CSS rebuilds, because the original marks are already made of rectangles.

Microsoft four squares

  • CSS grid
  • gap
  • nth-child colors

A two by two grid with a gap about a tenth of the square size, and the four official colors set with nth-child. Grid does the whole layout, so resizing the mark means changing one track size.

View code
.lo-ms {
  display: grid;
  grid-template-columns: repeat(2, 52px);
  grid-auto-rows: 52px;
  gap: 5px;
}
.lo-ms span:nth-child(1) {
  background: #f25022;
}
.lo-ms span:nth-child(2) {
  background: #7fba00;
}
.lo-ms span:nth-child(3) {
  background: #00a4ef;
}
.lo-ms span:nth-child(4) {
  background: #ffb900;
}

Netflix N

  • two pseudo-element bars
  • clip-path parallelogram
  • shade for depth

The two upright bars are ::before and ::after in a darker red, and the diagonal is a span clipped to a parallelogram in the brighter brand red, painted on top. The color difference is what gives the N its folded ribbon look.

View code
.lo-nf {
  position: relative;
  width: 74px;
  height: 128px;
}
.lo-nf::before,
.lo-nf::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 27px;
  background: #b1060f;
}
.lo-nf::before {
  left: 0;
}
.lo-nf::after {
  right: 0;
}
.lo-nf span {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #e50914;
  clip-path: polygon(0 0, 36.5% 0, 100% 100%, 63.5% 100%);
}

Adidas three bars

  • rotate around a corner
  • overflow: hidden as the flat cut
  • stepped heights

Three bars of rising length rotate 30 degrees around their bottom-left corners, and the parent has overflow: hidden, so the part of each bar that swings below the baseline is cut off flat. The ends stay square to the bars, as in the real mark.

View code
.lo-adi {
  position: relative;
  width: 196px;
  height: 104px;
  overflow: hidden;
}
.lo-adi span {
  position: absolute;
  bottom: 0;
  width: 33px;
  background: #000;
  transform-origin: 0 100%;
  transform: rotate(30deg);
}
.lo-adi span:nth-child(1) {
  left: 0;
  height: 44px;
}
.lo-adi span:nth-child(2) {
  left: 48px;
  height: 80px;
}
.lo-adi span:nth-child(3) {
  left: 96px;
  height: 116px;
}

Slack hash

  • rounded bars
  • per-corner radius
  • four-way symmetry

Eight rounded bars on a five-unit grid, two per brand color: a long pill and a short stub with one round end. Each color pair is the previous one turned 90 degrees, so once one pair is right the others are the same numbers swapped.

View code
.lo-sl {
  --lo-u: 24px;
  position: relative;
  width: calc(var(--lo-u) * 5);
  height: calc(var(--lo-u) * 5);
}
.lo-sl i {
  position: absolute;
  border-radius: calc(var(--lo-u) / 2);
}
.lo-sl i:nth-child(1),
.lo-sl i:nth-child(2) {
  background: #36c5f0;
}
.lo-sl i:nth-child(3),
.lo-sl i:nth-child(4) {
  background: #2eb67d;
}
.lo-sl i:nth-child(5),
.lo-sl i:nth-child(6) {
  background: #ecb22e;
}
.lo-sl i:nth-child(7),
.lo-sl i:nth-child(8) {
  background: #e01e5a;
}
.lo-sl i:nth-child(1) {
  left: 0;
  top: calc(var(--lo-u) * 1.4);
  width: calc(var(--lo-u) * 2.4);
  height: var(--lo-u);
}
.lo-sl i:nth-child(2) {
  left: calc(var(--lo-u) * 1.4);
  top: 0;
  width: var(--lo-u);
  height: calc(var(--lo-u) * 1.2);
  border-radius: calc(var(--lo-u) / 2) calc(var(--lo-u) / 2) 3px 3px;
}
.lo-sl i:nth-child(3) {
  left: calc(var(--lo-u) * 2.6);
  top: 0;
  width: var(--lo-u);
  height: calc(var(--lo-u) * 2.4);
}
.lo-sl i:nth-child(4) {
  left: calc(var(--lo-u) * 3.8);
  top: calc(var(--lo-u) * 1.4);
  width: calc(var(--lo-u) * 1.2);
  height: var(--lo-u);
  border-radius: 3px calc(var(--lo-u) / 2) calc(var(--lo-u) / 2) 3px;
}
.lo-sl i:nth-child(5) {
  left: calc(var(--lo-u) * 2.6);
  top: calc(var(--lo-u) * 2.6);
  width: calc(var(--lo-u) * 2.4);
  height: var(--lo-u);
}
.lo-sl i:nth-child(6) {
  left: calc(var(--lo-u) * 2.6);
  top: calc(var(--lo-u) * 3.8);
  width: var(--lo-u);
  height: calc(var(--lo-u) * 1.2);
  border-radius: 3px 3px calc(var(--lo-u) / 2) calc(var(--lo-u) / 2);
}
.lo-sl i:nth-child(7) {
  left: calc(var(--lo-u) * 1.4);
  top: calc(var(--lo-u) * 2.6);
  width: var(--lo-u);
  height: calc(var(--lo-u) * 2.4);
}
.lo-sl i:nth-child(8) {
  left: 0;
  top: calc(var(--lo-u) * 2.6);
  width: calc(var(--lo-u) * 1.2);
  height: var(--lo-u);
  border-radius: calc(var(--lo-u) / 2) 3px 3px calc(var(--lo-u) / 2);
}

LinkedIn in

  • letters from shapes
  • counter cut with ::after
  • percentage placement

No font involved: the i is a rectangle plus a circle, and the n is a white block with a rounded top-right corner whose counter is cut out by a blue ::after. Every position is a percentage of the tile, so the letters stay in place at any size.

View code
.lo-li {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 12px;
  background: #0a66c2;
}
.lo-li__i,
.lo-li__n,
.lo-li__i::before,
.lo-li__n::after {
  position: absolute;
}
.lo-li__i {
  left: 15%;
  top: 39%;
  width: 15%;
  height: 46%;
  background: #fff;
}
.lo-li__i::before {
  content: "";
  left: -6%;
  top: -54%;
  width: 112%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}
.lo-li__n {
  left: 37%;
  top: 37%;
  width: 49%;
  height: 48%;
  border-radius: 0 46% 0 0 / 0 40% 0 0;
  background: #fff;
}
.lo-li__n::after {
  content: "";
  left: 31%;
  bottom: 0;
  width: 37%;
  height: 66%;
  border-radius: 50% 50% 0 0 / 34% 34% 0 0;
  background: #0a66c2;
}

Logos from rings, borders and conic stops

Rings drawn with borders, overlapped with negative margins, and quartered or split with a hard-stop conic-gradient where the segments need it.

Audi four rings

  • border rings
  • negative margins
  • flexbox row

Four transparent circles with a thick border sit in a flex row, and a negative left margin of about a quarter of the diameter pulls each one into the previous ring. Borders paint over each other, so the overlaps need no extra shapes.

View code
.lo-audi {
  display: flex;
}
.lo-audi span {
  flex: none;
  width: 72px;
  height: 72px;
  box-sizing: border-box;
  border: 8px solid #000;
  border-radius: 50%;
}
.lo-audi span + span {
  margin-left: -19px;
}

BMW roundel

  • hard-stop conic-gradient
  • rotate + translateY letters
  • background-clip ring

The quarters are a conic-gradient with hard stops, the one case here where a gradient is the shape. The black ring is the element background, and each letter is rotated around the center and pushed out with translateY so it sits on the ring.

View code
.lo-bmw {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: #111;
  box-shadow: inset 0 0 0 3px #8c9196;
}
.lo-bmw::before {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: conic-gradient(#fff 0 25%, #0066b1 0 50%, #fff 0 75%, #0066b1 0);
  box-shadow: 0 0 0 3px #8c9196;
}
.lo-bmw span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  color: #fff;
  font-size: 23px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}
.lo-bmw span:nth-child(1) {
  transform: rotate(-42deg) translateY(-52px);
}
.lo-bmw span:nth-child(2) {
  transform: translateY(-52px);
}
.lo-bmw span:nth-child(3) {
  transform: rotate(42deg) translateY(-52px);
}

Chrome with a spin on hover

  • hard-stop conic-gradient
  • box-shadow ring
  • opt-in hover motion

Hover the logo.

One element, like the single-element Chrome build Speckyboy shows: a conic-gradient with hard stops for the three sectors, and ::after for the blue center with a white box-shadow ring. The hover spin is declared inside prefers-reduced-motion: no-preference, so it only runs for visitors who allow motion.

View code
.lo-chr {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: conic-gradient(from -30deg, #db4437 0 120deg, #f4b400 0 240deg, #0f9d58 0);
}
.lo-chr::after {
  content: "";
  width: 44%;
  height: 44%;
  border-radius: 50%;
  background: #4285f4;
  box-shadow: 0 0 0 7px #fff;
}
@media (prefers-reduced-motion: no-preference) {
  .lo-chr {
    transition: rotate .8s cubic-bezier(.3, 1.3, .5, 1);
  }
  .lo-chr:hover {
    rotate: 360deg;
  }
}

What are CSS logos?

A browser draws these marks from HTML elements and CSS properties, so there is nothing to download.

The markup is usually one empty div or a short stack of them, and styling with CSS does the drawing. Circles and rounded shapes come from border-radius, angled cuts from clip-path. Anything extra goes in ::before and ::after.

Shapes resize with their box, so edges stay sharp on any screen density, and because they sit in the stylesheet there is no separate logo request. Brand colors and sizes can come from custom properties, which means a theme switch recolors the mark.

An SVG logo is the closest alternative and also stays sharp at any size. It stores the mark as path data, though, where a CSS logo stacks boxes and cuts them into shape.

CSS logos versus the logo of CSS

Search the phrase and you also get the logo of the CSS language itself, which is a separate subject.

In 2024 the CSS-Next community group picked a new mark for CSS, designed by Javi Aguilar, on a rebeccapurple (#663399) background. Adam Argyle reported 400 votes for that color in his nerdy.dev post announcing the logo.

Aguilar’s write-up says the mark exists as an SVG and as a CSS-only build, with Argyle helping on the HTML/CSS version.

The CSS-Next repository releases the logo under CC0 and tells sites to embed the official image files, with a minimum height of 40 px for digital use.

Which CSS techniques build logo shapes?

Most logo shapes come out of border-radius, clip-path, gradients, ::before and ::after, and box-shadow. Each one makes a different kind of shape.

TechniqueShapes it producesWatch for
border-radiusCircles, ellipses, rounded squaresEllipses need transform: rotate() (Pepsi build, Skillcrush)
clip-pathTriangles, chevrons, any polygonAvailable in all major browsers since January 2021; Baseline widely available (MDN, as of October 2026)
linear-gradient, conic-gradientStripes, wedges, ring segmentsconic-gradient is available in all major browsers since November 2020, Baseline widely available (MDN); gradients are images, not colors
::before and ::afterExtra shapes with no extra markupTwo per element, each needs content: “”
box-shadowOffset copies of a shape, outlinesHidden outside a clip-path region

Curves take trial and error. A border-radius generator shortens the loop by showing the corner values live.

Polygons get the same treatment from a clip-path generator, which outputs the percentage coordinates polygon() expects. Anything outside the clip is hidden, and any value other than none creates a stacking context (MDN).

Single-element builds versus nested elements

A single-element build is one div plus its two pseudo-elements. FreeFrontend’s gallery has the CodePen cube and the GitHub Octocat built this way, and Speckyboy shows a one-element Chrome logo. Nested builds use a div per shape, and a DEV Community school-logo tutorial nests 11 of them for a single logo.

The single-element route keeps the markup tiny but pushes everything into stacked gradients and offsets, which makes later edits painful. Nested builds read like a layer list, so the shape that needs a change is easy to find.

For a fixed geometric mark I’d go single-element. If the mark will keep changing, nest.

Famous logos rebuilt in CSS and the technique behind each one

  • Pepsi needs border-radius for the elliptical shapes and transform to rotate them (Skillcrush).
  • Adidas leans on border-radius too, plus the old clip property for the straight horizontal lines (Skillcrush).
  • Instagram is a bordered box, with ::before and ::after drawing the circles (Code With Random on Medium).
  • The GeeksforGeeks build uses two bordered circles in a flex wrapper, an ::after triangle and a ::before square (GeeksforGeeks).
  • Binance comes down to a rotated square sized with custom properties and calc(), plus two pseudo-elements (DEV Community, 2022).
  • Chrome, CodePen and the GitHub Octocat are all single-element builds (Speckyboy, FreeFrontend).

Marks made of circles and squares get most of the way on borders and radii alone, with pseudo-elements filling the gaps. The single-element tricks only show up at the hard end.

These are CSS art exercises. Skillcrush frames the Pepsi and Adidas rebuilds as practice and concedes it is not the most efficient way to add graphics to a site.

A rebuild of a trademarked mark is still that trademarked mark, so original marks are the safer subject for production work.

How to build a CSS logo step by step

  1. Split the mark into basic shapes. The Binance logo reads as a black rounded square, a yellow square rotated 45 degrees, and two bordered squares the same size as the yellow one, offset toward opposite corners (DEV Community, 2022).
  2. Define the variables. The same walkthrough sets –scale: min(50vw, 160px) and derives every dimension from it with calc(), so one value resizes the whole mark.
  3. Build the base box. Give the canvas a 1:1 size from –scale and center it with flexbox.
  4. Draw the main shape. border-radius covers curves and clip-path polygon covers angles, while diagonals usually come from transform: rotate().
  5. Add the secondary shapes with pseudo-elements. Set content: “” and position: absolute on ::before and ::after, with position: relative on the parent.
  6. Offset the pieces. Binance’s two pseudo-elements move with translate(-38%, -38%) and translate(20%, 20%), so the offsets stay proportional to the shape.
  7. Test it at 16 px, 64 px and 256 px, which runs from a favicon-sized mark up to a hero.

Each element gets two pseudo-elements and that is the ceiling. GeeksforGeeks spends ::after on a triangle and ::before on a square, so a third shape needs another element or a gradient layer.

Fixed pixel offsets lock a mark to one size. Dan Cole’s early CSS-only logo, written up on CSS-Tricks, positions each bar with absolute pixel values, so it only works at one size. Custom properties with calc() remove that limit.

For triangle corners, a CSS triangle generator outputs the CSS for the shape, which saves the trial and error.

Scaling a CSS logo and switching it for dark mode

No JavaScript is involved in either. Size hangs off a single custom property, and the colors sit in another set that a prefers-color-scheme override swaps.

Sizing units for the mark

Each unit makes the logo follow something different.

  • em follows the parent’s font size
  • rem follows the root font size
  • vw inside clamp() follows the viewport, between two limits
  • container query units follow the nearest size container

A header that bumps its font size on small screens resizes an em-based mark with it, while rem ignores the header entirely. The difference between em and rem units decides which behavior you want.

vw tracks the viewport, not the box the logo sits in, so a logo in a narrow sidebar on a wide screen keeps its viewport-sized width. Size container queries close that gap, and they reached Baseline in 2023 (web.dev).

Fluid ranges need arithmetic, and a clamp calculator turns two breakpoints into a ready clamp() value.

Speckyboy’s roundup shows Hugo Darby-Brown’s Shop Talk logo staying pixel-perfect beside a PNG that cannot keep up.

Color control for light and dark themes

Brand colors can sit in –brand-* values on :root, so a theme class recolors every shape at once. For one-color logos, currentColor is simpler, since the mark just takes the text color of its parent.

Dark mode comes from a prefers-color-scheme media query that redefines the custom property values when the visitor’s system is set to dark. As of October 2026, prefers-color-scheme carries Baseline widely available status (web-platform-dx web-features).

Hard-coded colors inside pseudo-element rules skip the theme, so every fill should read a custom property.

Can screen readers read a CSS logo?

Not by default. A CSS logo is empty elements and pseudo-elements, so a screen reader announces nothing until the container gets role=”img” and an accessible name.

Use aria-label on the container, or aria-labelledby pointing at hidden text, alongside the role. An aria-label on a plain div without a role is ignored (Alvaro Montoro’s CSS art guide), and role=”img” without a name makes screen readers announce nothing (getwcag). A purely decorative mark should skip the role and get aria-hidden=”true” instead.

These attributes come from ARIA, and they are what turns an empty div into something a screen reader can name.

When the logo links to the home page, put the label on the mark inside the link, so the link’s name reads as the company.

WCAG 1.1.1 requires a text alternative for non-text content, and MDN notes that CSS images give no native way to attach one.

The contrast minimum does not apply to text inside a logo (W3C). For logos that work as links or controls, W3C recommends a variant with sufficient color contrast when brand guidelines allow it, and a low-contrast presentation chosen by the author rather than by brand guidelines is not exempt. A dark-mode recolor is where that matters.

CSS logo, SVG or PNG: which one fits?

CSS suits simple geometric marks that get recolored or animated live. Wordmarks and complex curves belong in SVG, and a PNG only makes sense for a mark that never changes size.

FactorCSS logoInline SVGPNG
Weight and requestsRules in the cached stylesheetAdds to HTML size, no separate caching (WBcom)One file per screen density
ScalingSharp at any sizeSharp at any sizeBlurs above its pixel size
ThemingReads page custom propertiesReads page CSS when inlineOne file per theme
Accessibilityrole=”img” plus a labelrole=”img” plus a labelalt attribute

Sources split on file weight. WBcom Designs says a site logo should always be SVG, while The Plus Addons measured its own logo and found the SVG heavier than a small PNG.

Screen density explains the gap. A PNG needs one file per density, and the difference between SVG and PNG shows up fastest on 2x screens.

The numbers that do exist are small. A static SVG icon weighed 446 bytes and the animated SVG version of the same icon 1.29 KB. Animating it with CSS left 176 bytes in the markup, with the 1.29 KB moved into the shared stylesheet (Iconify docs). On the wordmark side, The Plus Addons put a 512 px version at 8,559 bytes as PNG against 5,902 bytes as gzipped SVG.

Iconify’s numbers describe an icon built with SVG plus CSS, not a pure CSS logo. No retrieved source publishes a byte count for a complete CSS logo, so the weight comparison stops at icons and wordmarks.

Inlining SVG (see the guide to SVG in HTML) restores access to page CSS, at the price of a larger HTML response.

Render cost has no recent benchmark. Lea Verou’s test found a CSS radial gradient updating faster than an SVG data URI, but it ran when Opera still lacked radial gradients, and commenters disputed the setup.

I’d pick a CSS logo when the mark is geometric and the page needs it recolored or animated live, and an SVG for wordmarks and complex curves.

For a single-theme header, an SVG file is the lower-effort choice. A PNG is the lighter file only when the logo appears at one small size on standard screens, per The Plus Addons’ tests.

When does a CSS logo not work?

Trouble starts when anything other than a screen browser has to read the logo. That covers printers, email clients, search engines and favicon slots, and marks built from complex curves or lettering struggle even on screen.

Print and email

Print is a problem because the default print-color-adjust value, economy, lets a browser leave out background images and adjust colors for paper. Setting exact asks for the original colors, but the user’s print options take priority and MDN gives no guarantee.

Email is worse. Caniemail puts custom property support at 45.24%, last tested in February 2020. Apple Mail supports them, Yahoo! Mail and most Outlook versions do not, and Gmail reads var() but ignores the declaration.

A logo that sets its colors in custom properties has nothing to read in those clients. Send the logo as an image in email.

Files and metadata that need an image

Google’s Organization markup wants a logo of at least 112×112 px, at a crawlable and indexable URL, in a format Google Images supports (Google Search Central, updated September 2026).

A CSS drawing has no file URL to supply, so the logo property needs a separate exported image. The same goes for the favicon, which browsers fetch as a file.

Google also asks that the image look right on a purely white background, which rules out a mark that only works in dark mode.

Complex curves and lettering

CSS handles geometry. It strains on organic curves.

clip-path: path() takes an SVG path string, and shape() adds line and curve commands in CSS syntax (MDN). In MDN’s demo the path() clip stayed fixed when the element grew, while the shape() version with percentage values scaled with it.

Wordmarks add a second dependency. Live text relies on the font being available, so a failed font load changes the mark. At that point the mark is SVG path data written inside CSS, and an SVG file is the more direct format.

Browser support gaps

Check each property’s Baseline badge on MDN before shipping. Newly available features are unproven for a logo, so keep an image fallback behind @supports.

Baseline splits features into newly available and widely available (web.dev, 2023), and logo work belongs on the widely available side.

A browser that ignores one unsupported declaration drops that shape and leaves a broken mark, which is why cross-browser compatibility testing has to include the logo.

FAQ About CSS Logos

How do you animate a CSS logo on hover?

Put a transition on the property you want to move, such as transform or clip-path, then change it in a :hover rule. Multi-step sequences need @keyframes.

Wrap the motion in a prefers-reduced-motion check so visitors who turn animation off get a static mark.

Can a recreated brand logo be used commercially?

Generally not without permission from the trademark owner.

A CSS rebuild still reproduces the mark, so trademark law and the brand’s usage rules apply, and the artwork itself may also be protected by copyright. Original marks are the safe subject for production work.

Which tools generate CSS shape code?

MDN hosts border-radius, box-shadow and shape generators that output CSS ready to paste into a logo stylesheet.

Use them for the first pass, then adjust the values against the logo’s proportions by hand.

Can a CSS logo be exported as a PNG or SVG?

A PNG is easy. Capture the rendered element with a browser screenshot, such as the node screenshot option in Chrome DevTools.

An SVG needs redrawing in a vector editor, because boxes, gradients and pseudo-elements carry no path data to export.

Who Keeps a CSS Logo in Sync With the Brand?

A CSS logo belongs to the front-end team, because each brand-mark change becomes a stylesheet edit instead of an asset swap. The cost is control. The mark gains live theming and animation, and the design team loses the ability to update it alone.

Export the image files before anything else, since Google’s logo markup, email clients and the favicon cannot read a CSS drawing. Build the CSS version after that and leave animation for last. CSS keyframes are the next step for that stage.

As of October 2026, caniemail’s custom property test dates from February 2020. A fresh test showing Gmail and Outlook support would remove the custom property limit in email.