i wonder if it's possible to do a sort of constructivist design (it's a blog banner in…
- User
i wonder if it's possible to do a sort of constructivist design (it's a blog banner in the tags) instead of squares with pure css
header { position: relative;
}
header::before { content: ""; position: absolute; top: 0; left: 0; width: 200%; height: 100%; background: repeating-linear-gradient( to right, #f44336 0 200px, #ffeb3b 200px 400px, #2196f3 400px 600px, #e91e63 600px 800px );
}
- Assistant
Sure!
The little trick is to stop thinking in “blocks” (0-degree gradients) and start playing with two things that are already in your CSS tool-box:- “Tilted” gradients (linear-, repeating-linear-, conic- or radial-gradients + an angle).
- Clip paths / skew / translate transforms to carve out sharp, geometric shapes.
Below you’ll find one self-contained demo that produces a banner that nods to early-20th-century Russian Constructivism: strong diagonals, chunky color planes, a big circle and some high-contrast typography – all with pure CSS (no images, no SVGs).
You can copy-paste the whole snippet into any HTML file and simply tweak the colors / angles / sizes until it feels right for your blog.
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Constructivist Header</title> <style> /* ——— Generic reset ——— */ *{box-sizing:border-box;margin:0;padding:0} :root{ --red:#E30613; --yellow:#FAE100; --blue:#0032A0; --pink:#D51F26; --black:#111; } header{ position:relative; min-height:260px; /* height of the banner */ display:flex; justify-content:center; align-items:center; color:#fff; font-family:'Bebas Neue',Impact,Arial Black,sans-serif; font-size:4rem; letter-spacing:.05em; text-transform:uppercase; overflow:hidden; /* hide things that stick out */ } /* 1 — Big, skewed red block (background) */ header::before{ content:""; position:absolute; inset:0; /* full size */ background:var(--red); transform:skewY(-9deg); /* tilt the block */ transform-origin:top left; z-index:-3; } /* 2 — Yellow + blue angled stripes that sit *on top* of the red block */ header::after{ content:""; position:absolute; inset:0; background: /* blue diagonal */ linear-gradient( 12deg, transparent 0 56%, var(--blue) 56% 64%, transparent 64% 100% ), /* yellow diagonal (different angle to get a crossing) */ linear-gradient( -12deg, transparent 0 50%, var(--yellow) 50% 59%, transparent 59% 100% ); mix-blend-mode:screen; /* optional: additive mixing for vibrancy */ z-index:-2; } /* 3 — Extra pink bar for variety */ header .pink-bar{ position:absolute; width:140%; height:60px; background:var(--pink); top:60%; left:-20%; transform:skewX(-15deg); z-index:-1; } /* 4 — Big Constructivist “sun” */ header .sun{ position:absolute; right:-130px; /* stick it half outside the header */ top:-130px; width:320px; height:320px; border-radius:50%; background:var(--yellow); border:18px solid var(--black); box-shadow:0 0 0 8px var(--yellow); /* thick black ring + accent rim */ z-index:-2; } /* 5 — Some optional roughness / grain */ header::after, header::before, header .pink-bar, header .sun{background-blend-mode:multiply} body{background:#fafafa;} /* so you can see the header edges */ main{padding:3rem;max-width:720px;margin:auto;font-family:system-ui} </style> </head> <body> <header> <div aria-hidden="true" class="sun"></div> <div aria-hidden="true" class="pink-bar"></div> My Constructivist Blog </header> <main> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut aliquam tempor porta. …</p> </main> </body> </html>Why / how this works
- Big blocks are just backgrounds – we rely on
::before/::afterso that nothing interferes with your header’s actual content. - Diagonal feel = skew – you can skew a rectangle (
transform: skewX()orskewY()) or simply draw a diagonal gradient (linear-gradient(20deg, …)). - Multiple gradients in one layer – by stacking several
linear-gradient()declarations inbackground, each comma-separated gradient paints on top of the previous one. - Clip path alternative – if you prefer, instead of
skew()you could do:
which literally “cuts” the rectangle into a trapezoid.clip-path: polygon(0 0,100% 0,100% 70%,0 100%); - Optional grain/noise – to mimic aged posters you can overlay a
radial-gradient()or use a base-64 PNG noise texture as another background layer.
Tweaking ideas
• Change the
skewangle orlinear-gradientangles to get sharper / flatter diagonals.
• Adjustbackground-blend-mode(screen,overlay,multiply) for different color interactions.
• Add more pseudo-elements (::before,::after, or even extra empty<span>tags) as geometric modules – triangles, more bars, half-circles, etc.
• Animate the whole thing (slowtransform: translateX()loops) for subtle movement.Bottom line: Yes, you can definitely leave the “square grid” look behind and build a pure-CSS, constructivist-style banner by mixing skewed planes, tilted gradients, and bold color contrasts – no images required. Have fun experimenting! 🎨
- User
i am actually using scss
- Assistant
Below is the same “constructivist” header rewritten in idiomatic SCSS so you can:
• keep a clean colour palette,
• reuse mix-ins for extra planes/bars,
• add more diagonal stripes with a single map/loop,
• tweak one or two variables instead of hunting through the whole file.Feel free to rip out whatever bits you don’t need – it’s meant to be a starting point, not a straight-jacket. 🙂
/* ──────────────────────────────────────────────────────────── 1. CONFIG ────────────────────────────────────────────────────────── */ $colors: ( red : #E30613, yellow : #FAE100, blue : #0032A0, pink : #D51F26, black : #111 ); @function c($key) { @return map-get($colors, $key); } $header-h : 260px; // banner height $base-skew : -9deg; // global skew for the main red plane $font-stack : 'Bebas Neue', Impact, 'Arial Black', sans-serif; /* 2. QUICK-HIT MIXINS ────────────────────────────────────── */ @mixin plane($z, $bg, $skew-x:0deg, $skew-y:0deg) { content: ''; position: absolute; inset: 0; background: $bg; transform: skewX($skew-x) skewY($skew-y); transform-origin: top left; z-index: $z; } @mixin diagBar( $w, $h, $left, $top, $clr, $skew-x, $z: -1 ) { position: absolute; width: $w; height: $h; left: $left; top: $top; background: $clr; transform: skewX($skew-x); z-index: $z; } /* 3. OPTIONAL: BUILD DIAGONAL STRIPES WITH A MAP + LOOP ─── */ $stripes: ( (angle: 12deg, from:56%, to:64%, color:blue ), (angle: -12deg, from:50%, to:59%, color:yellow) ); @mixin paint-stripes($stripes) { $bg: (); @each $s in $stripes { $bg: append( $bg, linear-gradient( map-get($s, angle), transparent 0 map-get($s, from), c(map-get($s, color)) map-get($s, from) map-get($s, to), transparent map-get($s, to) 100% ), comma ); } background: $bg; } /* ──────────────────────────────────────────────────────────── 4. THE HEADER ITSELF ────────────────────────────────────────────────────────── */ header { position: relative; min-height: $header-h; overflow: hidden; display: flex; justify-content: center; align-items: center; color: #fff; font: 4rem/1 $font-stack; letter-spacing: .05em; text-transform: uppercase; /* 4.1 – red foundation */ &::before { @include plane(-3, c(red), 0deg, $base-skew); } /* 4.2 – yellow & blue intersection stripes */ &::after { @include plane(-2, none); // set up the pseudo-element @include paint-stripes($stripes); mix-blend-mode: screen; } /* 4.3 – extras nested for readability */ .pink-bar { @include diagBar(140%, 60px, -20%, 60%, c(pink), -15deg, -1); } .sun { position: absolute; right: -130px; top: -130px; width: 320px; height: 320px; border-radius: 50%; background: c(yellow); border: 18px solid c(black); box-shadow: 0 0 0 8px c(yellow); z-index: -2; } } /* ──────────────────────────────────────────────────────────── 5. LOOSE ENDS (demo styling) ────────────────────────────────────────────────────────── */ body { background:#fafafa; } main { max-width:720px; margin:auto; padding:3rem; font-family:system-ui; }How to use
- Drop the SCSS into
header.scss(or wherever). sass header.scss header.css(or have your build tool watch it).- Add the extra markup inside your header element:
<header> <span class="sun" aria-hidden="true"></span> <span class="pink-bar" aria-hidden="true"></span> My Constructivist Blog </header>Tweak-friendly bits
• Change$header-h,$base-skew, or the$stripesmap to get a completely different rhythm of diagonals.
• Add more entries to$stripesfor as many angled bands as you like.
• Duplicate.pink-barwith another mixin call for extra bars—no class name? no problem, SCSS will still emit it.
• Animate any layer (@keyframes move { transform: … }) for subtle poster-like drifting.Happy building! 💥
- Drop the SCSS into
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.