Advertisement · 728 × 90

Posts by Daniel Schwarz

Preview
Name-Only Containers: The Scoping We Needed If we give a `container-name` to the root of all our unique components, we can scope styles to them with a simple @container query.

ok hear me out.

If we put a unique `container-name` on the root of all of our components... that's... perfect scoping, via:

@container unique-name {
button {}
.whatever {}
}

That's platform-level CSS modules. That's the scoping we need! frontendmasters.com/blog/name-on...

3 days ago 108 13 9 4

After shape() and border-shape, another great feature in the CSS Shape world is on the way.

I will be missing all the hacky-gradients-math-stuff I was doing 😅

1 day ago 19 3 1 0

#css capable of more and more every year. things that were real headaches keep entering the "worth doing and won't cost your sanity" zone of ui ux

19 hours ago 3 1 0 0

Just had an enlightenment about CSS View transitions. They are much more powerful than I thought AND much easier to use!

You really only have to give your element a unique view-transition-name. This has to be consistent across all pages the element appears on. That’s it!

18 hours ago 5 1 1 0
Preview
Frontend News #22: x86 CPU in CSS, pointer-box-offset Property, Detecting at-rule Support Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.

Frontend News #22
❤️ Detect at-rule support in CSS
👉 pointer-box-offset property
🦄 Creative ways are to select the HTML element
😍 x86 CPU architecture in CSS

Featuring @bram.us, @robinrendle.bsky.social, @tylersticka.com, @dxnny.fun, @rebane2001.bsky.social. 🙏

cssw.io/frontend-new...

7 hours ago 1 2 1 0
Patrick - Using CSS animations as state machines to remember focus and hover states with CSS only I discovered this CSS-only trick to store the past <code>:focus</code> or <code>:hover</code> state of any element. Without JavaScript, you can style elements depending on whether they were ever focused or hovered. Here's how it works.

patrickbrosset.com/articles/202...

12 hours ago 1 0 0 0

YES. The more CSS and design people I add to the feed, the better it gets. The vibes are immaculate.

1 week ago 12 1 0 0

bless the CSS people. my tech news feed is all AI but the CSS people are still styling and just doing their thing because its fun and they love it and they make neat things. my heroes.

1 week ago 177 14 3 0
Preview
There’s no need to include ‘navigation’ in your navigation labels Marking up navigation is pretty straightforward, but here’s a nice reminder on how the aria-label should be written.

www.tempertemper.net/blog/theres-...

1 week ago 0 0 0 0
Advertisement
Preview
Sniffing Out the CSS Olfactive API | CSS-Tricks A deep sniff of the new CSS Olfactive API, a set of proposed features for immersive user experiences using smell.

css-tricks.com/css-olfactiv...

1 week ago 0 0 0 0
Illustrates CSS specificity issues without `@layer` versus controlled order with `@layer`, highlighting component hierarchy and conflicts.

Illustrates CSS specificity issues without `@layer` versus controlled order with `@layer`, highlighting component hierarchy and conflicts.

Your CSS specificity wars are over.

@ layer lets you control the cascade without !important hacks.

The problem with CSS: Specificity decides what wins.

1 week ago 10 2 1 0
Preview
an owl is standing in front of a wall with a picture of a rabbit on it and the words " you called " below it ALT: an owl is standing in front of a wall with a picture of a rabbit on it and the words " you called " below it
1 week ago 2 0 0 0
Preview
What’s !important #8: Light/Dark Favicons, @mixin, object-view-box, and More | CSS-Tricks Short n’ sweet but ever so neat, this issue covers light/dark favicons, @mixin, anchor-interpolated morphing, object-view-box, new web features, and more.

What’s !important: Light/Dark Favicons, “@ mixin”, Object-View-Box, and More, by @dxnny.fun (@csstricks@mastodon.social):

https://css-tricks.com/whats-important-8/

#css #retrospectives

1 week ago 0 1 0 0

Fun, a CSS competitor! Push those boundaries!

1 week ago 48 3 6 0
Video

I really didn't like Bsae UI's drawer implementation so I thought I'd try recreating the CSS scroll snap drawer I had a while back

2 weeks ago 30 2 4 0
Code snippet demonstrates CSS `@starting-style` for transitioning background color from transparent to green over 1.5 seconds.

Code snippet demonstrates CSS `@starting-style` for transitioning background color from transparent to green over 1.5 seconds.

🆕 Animate elements from display: none

CSS `@starting-style` lets you define the initial style for elements entering the page, enabling enter animations without JavaScript.

⋅ Combine with transition
⋅ Works with popover and dialog

Learn more 👇
developer.mozilla.org/en-US/docs/...

2 weeks ago 74 10 0 1
Advertisement

Everyone’s flexing frameworks while I’m out here vibing like it’s 2003.

Plain PHP and raw CSS, with a splash of Alpine.js for the modern bits. No build steps. No faff. Just pure productivity. 🤷‍♂️

2 weeks ago 3 1 0 0

I think CSS carousels would replicate the behavior better, but they only work in Chrome and they're quite buggy.

2 weeks ago 0 0 0 0
Una on stage, slide reads:
Key UX principles
1. reduce noise
2. Guide users
3. Personalize

Una on stage, slide reads: Key UX principles 1. reduce noise 2. Guide users 3. Personalize

Una on stage showing how interestfor can make hover cards show a user profile when hovering/focusing traditional <a> links

Una on stage showing how interestfor can make hover cards show a user profile when hovering/focusing traditional <a> links

Una on stage showing the styleable parts of <select>

Una on stage showing the styleable parts of <select>

@una.im starts with showing how amazing modern CSS is.

interestfor is super interesting to add hover cards on links, without any JS.

2 weeks ago 4 1 1 0
Video

Skeuomorphic Egg Toggle Switch [HTML + CSS + JS]

Organic mechanics. Complex box-shadow layering and border-radius manipulation. Tactile feedback through depth. Source code: freefrontend.com/code/skeuomo...

2 weeks ago 26 5 0 0
Preview
Generative UI Notes | CSS-Tricks Looking at research and experiments that are designed to automatically generate user interfaces based on user preferences.

No spicy takes here, just genuine interest and notes on whatever the heck "Generative UI" is supposed to be.

css-tricks.com/generative-u...

2 weeks ago 3 2 0 0

Could a lot of people have voted that as a joke, not realizing that it was a serious poll?

2 weeks ago 0 0 1 0
Three overlapping circles represent color mixtures in the OKLab color space: blue, pink, and green with various combinations labeled.

Three overlapping circles represent color mixtures in the OKLab color space: blue, pink, and green with various combinations labeled.

Your design system has 47 color tokens.

But most of them are just... variations of 3 base colors.

color-mix() in CSS generates all those shades from one source.

2 weeks ago 7 2 2 1
@mixin --foo(--arg <length>) {
  @result {
    &, & > h2, & + p {
      width: var(--arg);
    }
  }
}

div {
  @apply --foo(10em);
  font-size: 10px;
}
div > h2 {
  font-size: 20px;
}
div + p {
  font-size: 30px;
}

@mixin --foo(--arg <length>) { @result { &, & > h2, & + p { width: var(--arg); } } } div { @apply --foo(10em); font-size: 10px; } div > h2 { font-size: 20px; } div + p { font-size: 30px; }

🚨 Want mixins in CSS?
Help the CSS WG by telling us what feels natural to you!

Look at the code in the screenshot. What resulting widths would *you* find least surprising for each of div, div > h2, div + p?

Polls:
┣ Github: github.com/LeaVerou/blo...
┗ Mastodon: front-end.social/@leaverou/11...

2 weeks ago 51 24 9 2
Video

Now that my favorite feature is well supported, let's create a new set of CSS loaders 🤩

The Squishy Collection: css-loaders.com/squishy/

Single-element implementation powered by shape() (and linear() for the bouncy ones!)

Pick your favorite one 👇

2 weeks ago 26 3 0 2
Two framed illustrations show an image without and with an 'object-view-box' CSS property applied, highlighting the cropping effect.

Two framed illustrations show an image without and with an 'object-view-box' CSS property applied, highlighting the cropping effect.

Wouldn't it be great to have native image cropping in CSS?

It actually exists: object-view-box.

2 weeks ago 15 3 2 0
Advertisement
Preview
Building dynamic toggletips using anchored container queries Anchored container queries are only available in Chrome 143 upwards right now, but here’s Daniel Schwarz to show you how to use progressive enhancement to build up to using that new capability in the…

Building dynamic toggletips using anchored container queries: "With anchored container queries and other modern #CSS features like attr(), corner-shape, and interest invokers, we can use progressive enhancements to create some really awesome toggletips." piccalil.li/blog/buildin...

2 weeks ago 3 3 0 0
Video

So, corner-shape can be animated. Notice the added sprinkle of color-contrast().

css-tricks.com/experimentin...

2 weeks ago 46 5 0 0
Preview
JavaScript for Everyone: Destructuring | CSS-Tricks Mat Marquis and Andy Bell have released JavaScript for Everyone, an online course offered exclusively at Piccalilli. This post is an excerpt from the course taken specifically from a chapter all about...

If you've been on the fence about @piccalil.li's JavaScript for Everyone course, first off: be like Nike and just do it.

We've published an excerpt from it about destructuring by none other than @wil.to to give you just a taste.

css-tricks.com/javascript-f...

3 weeks ago 14 4 0 0