Dominik Bláha (@DNepovim) header
Dominik Bláha (@DNepovim) profile picture

Software Engineer at Avast

Prague, Czech Republic
Joined May 2014
Photo by Dominik Bláha (@DNepovim)Photo by Dominik Bláha (@DNepovim)Photo by Dominik Bláha (@DNepovim)Photo by Dominik Bláha (@DNepovim)Photo by Dominik Bláha (@DNepovim)Photo by Dominik Bláha (@DNepovim)Photo by Dominik Bláha (@DNepovim)Photo by Dominik Bláha (@DNepovim)Photo by Dominik Bláha (@DNepovim)
Dominik Bláha retweeted
you can stack elements with css grid/subgrid by giving them the same grid position 🧑‍🍳 this scroll track window is a great use case for css grid + position: sticky catch the 3D breakdown 👇
really like this scrolltrack effect on the new @elevenlabs music site
31
93
6
1,749
129,224
Dominik Bláha retweeted
in the audience, scratchin an itch: responsive #CSS scroll animation try it! cdpn.io/pen/debug/wBMvNaN
16
60
4
965
39,526
Dominik Bláha retweeted
few ways to do the CSS for this 🤙 depends how you structure things – 3D stack on the parent – rotate on X/Y to get isometric vibe .layer:hover { transform: translate3d(0, 0, 10px); } .layer:hover .sibling-shadow {/* translate + opacity */ }
19
87
8
1,767
311,196
Dominik Bláha retweeted
<table> highlighting with CSS :has() 💡 td:has(~ td:hover), /* previous sibling cells */ table:has(td:nth-of-type(3):hover) /* column cells */ tr:not(:first-of-type):has(~ tr:hover) td:nth-of-type(3) { background: var(--highlighted); }
83
431
23
5,563
503,053
This week, @g_perales and I worked together on a tool for Tailwind CSS users. The tool lets you easily create grids for your Tailwind CSS projects, perfect for generating bento-style grids! It supports Tailwind CSS v3/v4 — oxbowui.com/free-tools/tailw…
17
137
6
1,064
69,412
Dominik Bláha retweeted
CSS-only magnetic link effect 🤯 li:has(a:is(:hover, :focus-visible)) {anchor-name: --a; } ul::before { left: anchor(--a left); width: anchor-size(--a width); } using CSS anchor positioning, declare an anchor on hover for the indicator 🚀
49
325
16
4,245
234,790
Dominik Bláha retweeted
"can I use it for images?" – Yep! ✅ Could even combine it with CSS scroll-driven animation CSS, am I right? 🔥
CSS Tip 📖 Use CSS shape-outside to wrap text around shapes .column--left .shape { float: right; shape-outside: circle(100px at 100% 50%)); }
37
241
19
2,747
259,174
Dominik Bláha retweeted
I have a feeling we're going to start seeing a lot more sites that look like this 👀
93
87
33
1,519
267,913
Dominik Bláha retweeted
DALLE made me this cool website design What’s the best way to get the assets for this so I can make it reality? Mainly the background image/svg for the hero
113
90
12
1,783
531,276
Dominik Bláha retweeted
CSS Trick! 🫶 You can make use of calc and custom properties to create that dynamic colored glowy spotlight effect 🎨 [data-glow] { --hue: calc(var(--base) + (var(--xp) * var(--spread))); } Let me show you how! 👇 Few tricks and tips in this video/demo. In addition to using mask-composite and background-attachment: fixed, passing both the pointer position and its position along an axis allows you to make the spotlight color dynamic 🔥 Setting --x and --xp inside a single JavaScript pointermove event listener allows you to play with pointer position in your CSS ✨ --xp = 0-1 along the x-axis (x / window.innerWidth) --x = pointerX --base = starting hue 0-359 --spread = variation in hue that's calculated with --xp Hopefully, this video breaks things down a little for you and clears things up 🤞 If not, leave me some questions 💙 Created a reduced demo that doesn't have all the configuration stuff. Find the @CodePen link for that below! 👇
UI && CSS Tip! 🔥 You can create these dynamic glowing card effects with a single JavaScript event listener, some CSS tricks, and an HTML attribute 🤙 <article data-glow /> Here's how! 👇 You can use a combination of tricks from previous posts. Let's start with the JavaScript 📜 Use a function like this to send the pointer position via custom properties to the glows ✨ Attach this to the pointermove event 👆 const onPointermove = ({ x, y }) => { document​.documentElemen​t​.style.setProperty('--x', x) document.documentElement​.style.setProperty('--xp', x / innerWidth) document.documentElement​.style.setProperty('--y', y) document.documentElement​.style.setProperty('--yp', y / innerHeight) } Now for the styles 🎨 These custom properties define the border and spotlight size. The first trick is how you can change the color(--hue) based on the pointer position with calc 😎 [data-glow] { --border-size: 2px; --spotlight-size: 150px; --hue: calc(var(--base) + (var(--xp) * var(--spread))); } The magic is using the pointer position in a radial-gradient combined with background-attachment: fixed ✨ (Check the video for an exploding view 🎞️) [data-glow] { background-image: radial-gradient( var(--spotlight-size) var(--spotlight-size) at calc(var(--x, 0) * 1px) calc(var(--y, 0) * 1px), hsl(var(--hue) 100% 70% / 0.25), transparent ); background-attachment: fixed; } The last major piece is using mask-composite on the pseudoelements of the [data-glow] element and the same background-attachment: fixed trick 🫶 [data-glow]::before, [data-glow]::after { pointer-events: none; content: ""; position: absolute; inset: calc(var(--border-size) * -1); border: var(--border-size) solid transparent; background-attachment: fixed; background-size: calc(100% + (2 * var(--border-size))); background-position: 50% 50%; mask: linear-gradient(transparent, transparent), linear-gradient(white, white); mask-clip: padding-box, border-box; mask-composite: intersect; } This masks the elements so only a fake border is shown. That border is actually the spotlight background that moves around 👀 But now it's clipped to the border width 😎 Then it's a case of switching out the background-image for each pseudoelement based on purpose 🧐 For example, to get the white light, use your custom properties, make the light a little smaller and the color bright! [data-glow]::after { background-image: radial-gradient( calc(var(--spotlight-size) * 0.5) calc(var(--spotlight-size) * 0.5) at calc(var(--x, 0) * 1px) calc(var(--y, 0) * 1px), hsl(0 100% 100% / 1), transparent ); } These are the major pieces you need to get it done. Extras? Want the outer glow? Nest a glow! <article data-glow> <span data-glow /> </article> Give the inner glow a blur to create the outer glow 😅 [data-glow] > [data-glow] { filter: blur(10px); } It's worth digging in with this one. Have a play around with the demo and the custom properties. The code isn't perfect after introducing all the configuration pieces 😅 Will put together a reduced example for you! 🙏 Any questions, let me know! 💙 @CodePen link below! 👇
14
158
6
1,233
158,191
You might be using `fetch` wrong...
91
758
50
5,329
411,332
Dominik Bláha retweeted
CSS Tip! 🚀 You can select the previous siblings of an element with :has() to create cool hover effects like this OS dock🔥 No JS 😎 :root{--lerp-1:0.525;} a:has(+a:hover){ --lerp:var(--lerp-1); translate: 0 calc(var(--lerp) * -75%); } Demo link and explanation below! 👇
46
479
33
3,462
Dominik Bláha retweeted
In JS, when i is a string, i++ is not the same as i = i + 1 var i = "10"; i++; i; // 11 var j = "10"; j = j + 1; j; // "101"
3
2
12
Dominik Bláha retweeted
Not sure if I explained the difference between Server Side Rendering (SSR) and React Server Components well, so let me try again:
12
162
21
1,040
Dominik Bláha retweeted
Mystery Solved!
198
10,017
641
36,059
Dominik Bláha retweeted
Typografický tahák nejen pro grafiky. Tohle se bude občas myslím hodit úplně všem. peckadesign.cz/blog/typograf…
2
8
16
Dominik Bláha retweeted
"node".split("").sort().join("")
82
1,298
155
7,745
Dominik Bláha retweeted
Tip: themer.dev lets you generate matching themes for your code editor, terminal, Slack, and desktop wallpaper.
32
714
41
2,583