Daniel Schwarz's Avatar

Daniel Schwarz

@dxnny.fun

Designer / dev / editor / writer, currently @css-tricks.com and @logrocket.bsky.social

153
Followers
96
Following
327
Posts
31.07.2023
Joined
Posts Following

Latest posts by Daniel Schwarz @dxnny.fun

Diagram illustrating the CSS clamp function with examples of minimum, preferred, and maximum sizes across different screen widths.

Diagram illustrating the CSS clamp function with examples of minimum, preferred, and maximum sizes across different screen widths.

Do you need 5 media queries to make your font look good depending on screen width?

One line of CSS is all you need:

font-size: clamp(1rem, 2vw + 0.5rem, 2rem);

07.03.2026 11:12 ๐Ÿ‘ 22 ๐Ÿ” 3 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 1
Preview
Why CSS Feels Harder Than It Should (And What You're Actually Fighting CSS looks simple until you hit specificity conflicts, margin collapse, and box model quirks. Here's why it feels harder than it shouldโ€”and what you're actually fighting.

CSS is declarative. You describe intent. The browser negotiates the result.
That's why centering a div can feel unreliable โ€” you're not giving instructions, you're making a suggestion.

#css #webdev #frontend

04.03.2026 21:54 ๐Ÿ‘ 4 ๐Ÿ” 2 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
We've been separating concerns wrong (and CSS is fixing it)
We've been separating concerns wrong (and CSS is fixing it) YouTube video by General Musings with Kevin Powell

We relied on JavaScript for styling, layout, and state management because CSS couldnโ€™t keep up. But CSS has evolved (fast). Itโ€™s finally time to drop the hacks and let CSS do the job it was meant to do.

youtu.be/GTCJ082hj-w

05.03.2026 11:56 ๐Ÿ‘ 4 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Two website designs show a fixed header. One lacks scroll-margin-top, causing overlap; the other adjusts spacing with it, preventing overlap.

Two website designs show a fixed header. One lacks scroll-margin-top, causing overlap; the other adjusts spacing with it, preventing overlap.

Ever had such an issue when your sticky header covers anchor headings?

An easy fix is: scroll-margin-top

06.03.2026 09:28 ๐Ÿ‘ 22 ๐Ÿ” 3 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

The early days of the world wide web were wild times, filled with gaudy colors and blink and marquee tags. Everything was positioned using creative employments of table tags. CSS and Javascript were just fantastical dreams. And ads... The complete and utter lack of ads.... It was glorious.

06.03.2026 13:11 ๐Ÿ‘ 8 ๐Ÿ” 4 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
The Different Ways to Select <html> in CSS | CSS-Tricks Sure, we can select the <html> element in CSS with, you know, a simple element selector, html. But what other (trivial and perhaps useless) ways can we do it?

The Different Ways to Select โ€œ<html>โ€ in CSS, by @dxnny.fun (@csstricks@mastodon.social):

https://css-tricks.com/the-different-ways-to-select-html-in-css/

#html #css #selectors

05.03.2026 21:30 ๐Ÿ‘ 1 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
The Different Ways to Select <html> in CSS | CSS-Tricks Sure, we can select the <html> element in CSS with, you know, a simple element selector, html. But what other (trivial and perhaps useless) ways can we do it?

How many ways can you select <html> in CSS? @dxnny.fun says โ€œchallenge acceptedโ€ building off an exercise @css-only.dev did a little while back.

css-tricks.com/the-differen...

css-tip.com/root-selecto...

05.03.2026 14:05 ๐Ÿ‘ 10 ๐Ÿ” 2 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
A bright red-orange background. Falling from the sky like a safe tossed off a skyscraper is a large, brass-colored cube that looks like it is made of metal or stone. Embossed on the slightly cracked front is a chunky question mark with four bolts around it, like the question boxes in the Mario universe. It is, judging from the size of the person running away from its anticipated point of impact, the size of a small house. The painting is signed "Chris Silverman".

A bright red-orange background. Falling from the sky like a safe tossed off a skyscraper is a large, brass-colored cube that looks like it is made of metal or stone. Embossed on the slightly cracked front is a chunky question mark with four bolts around it, like the question boxes in the Mario universe. It is, judging from the size of the person running away from its anticipated point of impact, the size of a small house. The painting is signed "Chris Silverman".

#notesArt

04.03.2026 01:41 ๐Ÿ‘ 26 ๐Ÿ” 5 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
skew() - CSS | MDN The skew() CSS function defines a transformation that skews an element on the 2D plane. Its result is a data type.

๐Ÿฆ– skew()
โœ… Widely available (from Jul 2015)

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/transform-function/skew

The skew() CSS function defines a transformation that skews an element on the 2D plane. Its result is a <transform-function> data type.

#webdev #CSS

03.03.2026 19:14 ๐Ÿ‘ 1 ๐Ÿ” 2 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

CSS3 is when I stopped paying attention to CSS, and now I find out CSS5 supports insane things like if statements, variables, and calc()?!??

Bro why does my stylesheet parser have to be TURING-FUCKING-COMPLETE???

03.03.2026 22:16 ๐Ÿ‘ 5 ๐Ÿ” 1 ๐Ÿ’ฌ 4 ๐Ÿ“Œ 0

I feel like such a genius every time I pull off a neat hack with :has(). Especially if it targets an element in the DOM hierarchy that would have been previously inaccessible with CSS alone.

I love CSS.

04.03.2026 19:25 ๐Ÿ‘ 11 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Video thumbnail

team i'm FIRED UP about these gnarly gotchas with Anchor Positioning in CSS.

02.03.2026 22:28 ๐Ÿ‘ 65 ๐Ÿ” 9 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 3

If Christopher Nolan was a developer

03.03.2026 18:40 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Post image

๐ŸŽฎ Game developers, we heard your feedback and weโ€™ve added a complete game input icon set from @kenney.nl including the brand-new Switch 2 console icons. Find them all in the app!

15.10.2025 13:43 ๐Ÿ‘ 3 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Screenshot of two cards. The first one has some wavy lines.

Screenshot of two cards. The first one has some wavy lines.

A little something I coded a while back on @codepen.io.

The wavy lines are #CSS gradient lines, distorted with an #SVG #filter.

codepen.io/thebabydino/...

Chrome only. You can find the Firefox & Safari bugs in description.

25.02.2026 19:12 ๐Ÿ‘ 7 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Release Notes for Safari Technology Preview 238 Safari Technology Preview Release 238 is now available for download for macOS Tahoe and macOS Sequoia.

Safari Technology Preview 238
- #css :open pseudo-class
- #html customizable <select> element ๐ŸŽ‰
And more

26.02.2026 23:04 ๐Ÿ‘ 2 ๐Ÿ” 1 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
::part() - CSS | MDN The ::part CSS pseudo-element represents any element within a shadow tree that has a matching part attribute.

Today, I learned about the `::part()` pseudo-element! I'm surprised to see it's baseline widely available, because I've poked around web components before, and I don't remember seeing this.

developer.mozilla.org/en-US/docs/W...

27.02.2026 02:02 ๐Ÿ‘ 0 ๐Ÿ” 1 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0
Bramus standing in front of a slide from his talk that says โ€œBut what about the little triangle?โ€

Bramus standing in front of a slide from his talk that says โ€œBut what about the little triangle?โ€

Bramus kicked us off with a dive into CSS anchor positioning. Any time I drop into this spec I learn something new about it. I had no idea you could animate them! #SotB26

28.02.2026 11:28 ๐Ÿ‘ 1 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

Modern CSS is just lovely. Theme switcher with a single <html> data attribute to ideate on variations during prototyping, nice color spaces and maths, layouts and smooth animation and even transitions. Love it.

28.02.2026 11:24 ๐Ÿ‘ 0 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Native Random Values in CSS The CSS Working Group has published the Values and Units Module Level 5, which introduces native mechanisms for generating random content using only CSS. This is the tl;dr of a longer article explorin...

CSS is getting native randomness ๐ŸŽฒ

random() and random-item() are coming with:

- per-element randomness
- step-based ranges
- shared value options
- zero JS required

I wrote an overview of the feature, how it works, and what browsers support it.

alvaromontoro.com/blog/68092/n...

#css #webdev

27.02.2026 16:02 ๐Ÿ‘ 46 ๐Ÿ” 11 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 1

One thing I didn't mention in my talk is border-shape, which will be the solution for this in the future.

It's still early stage, though. Also needs anchored queries.

bsky.app/profile/una....

28.02.2026 23:26 ๐Ÿ‘ 9 ๐Ÿ” 1 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0
Preview
Anchored container queries demo ...

No help because of browser support, like you said, but here's my take on it codepen.io/mrdanielschw...

03.03.2026 10:10 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Video thumbnail

CSS shape() landed in Firefox 148. It's similar to path(), but allows the full expressiveness of CSSโ€ฆ

02.03.2026 15:07 ๐Ÿ‘ 150 ๐Ÿ” 24 ๐Ÿ’ฌ 8 ๐Ÿ“Œ 3
Preview
Potentially Coming to a Browserย :near()ย You | CSS-Tricks Danny has several ideas for how we could use :near(), a proposed pseudo-class that detects when the pointer is near an element.

Potentially Coming to a Browser โ€œ:near()โ€ You, by @dxnny.fun (@csstricks@mastodon.social):

https://css-tricks.com/potentially-coming-to-a-browser-near-you/

#css #functions

01.03.2026 18:30 ๐Ÿ‘ 0 ๐Ÿ” 1 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Shades of Halftone - The Blog of Maxime Heckel An interactive deep dive into building halftone shaders in GLSL, covering everything from classic dot patterns and CMYK color separation to Moirรฉ interference, gooey effects, and animated displacement...

blog.maximeheckel.com/posts/shades...

28.02.2026 12:51 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

You've got 99 problems but not getting the latest CSS news ain't one

27.02.2026 17:22 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Whatโ€™s !important #6: :heading, border-shape, Truncating Text From the Middle, and More | CSS-Tricks Despite whatโ€™s been a sleepy couple of weeks for new Web Platform Features, we have an issue of Whatโ€™s !important thatโ€™s prrrretty jam-packed. The web community had a lot to say, it seems, so fasten y...

css-tricks.com/whats-import...

27.02.2026 17:21 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 1
Preview
Typescale with pow() ...

Thank you both for mentioning all of this!

Ultimately, I think this is the best approach codepen.io/mrdanielschw...

27.02.2026 07:05 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
A scale.xs number design token in Penpot, with the value of round({base} * pow({multiplier}, -1)).

A scale.xs number design token in Penpot, with the value of round({base} * pow({multiplier}, -1)).

Incredible. This is such serendipitous timing too. Look what I discovered works in @penpot.app last weekโ€ฆ

17.02.2026 11:20 ๐Ÿ‘ 5 ๐Ÿ” 2 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
Typographic Scales in CSS with :heading(), sibling-index(), and pow() Learn how to build flexible, mathematical typographic scales using :heading(), sibling-index(), and pow() for cleaner CSS design systems.

๐ŸŽ‰ New Blogpost ๐ŸŽ‰

Building Typographic Scales in CSS with :heading(), sibling-index(), and pow()

www.alwaystwisted.com/articles/bui...

What if we could create a typographic scale for headings with one line of CSS?

One rule to scale them all.

#CSS #FrontEnd #WebDev

17.02.2026 10:13 ๐Ÿ‘ 49 ๐Ÿ” 15 ๐Ÿ’ฌ 3 ๐Ÿ“Œ 0