RESILIENT—UI interview #002 with Hayden Bleasel
www.resilient-ui.com
Australian Design Engineer who loves working on open source software for the web.
www.resilient-ui.com
Australian Design Engineer who loves working on open source software for the web.
motion.dev
www.resilient-ui.com
Staff front-end engineer based in Amsterdam, working on AI assistants at Shopify.
This is one of those that feels like it should be easier than it ends up being, but here is where I landed at to ensure a modal image preserves its 3/2 aspect ratio no mater the viewport width/height.
.modal {
aspect-ratio: 3 / 2;
height: min(calc(100vh - 2rem), calc((100vw - 2rem) * 2 / 3));
margin: auto;
position: relative;
}
See it in action on I Brew My Own Coffe.
It’s always felt weird using opacity for disabled buttons for situations where its not placed on a solid background.
In this alternative approach I am using color-mix to create a similar disabled effect without the opacity.
<button
class="bg-[color-mix(in_srgb,var(--color-blue-500)_50%,var(--color-background))] text-[color-mix(in_srgb,var(--color-white)_50%,var(--color-background))]"
disabled
>
Hello world
</button> dither.floriankiem.com
vercel.com
See also Rauno’s Web Interface Guidelines.
I’ve been fortunate to work with some amazing people over the years and a couple of those folks are open for new opportunities. Scoop them up.
Fixing folks list alignment one PR at a time.
Two fantastic pieces of web inspiration:
ui.alexcarpenter.me
I’ve been slowly working on my own shadcn/ui registry while learning more about the whole component distrubution setup at work. So far I have the following components:
<InfoList /><InlineText /><PricingTable />ethanniser.dev
jakub.kr
Another use case for absolute positioning elements within inline text to support hanging punctuation.
Supports varying sizes of text, without the need for custom negative text indent values.
<p class="relative inline-block">
<span class="absolute right-full">“</span>Lorem ipsum dolor sit amet
consectetur adipisicing elit. Iste officia quasi fugiat, dolores ab nam
repellendus voluptate”
</p> silkhq.com
Native‑like swipeable sheets on the web
github.com
A lightweight React Hook intended mainly for AI chat applications, for smoothly sticking to bottom of messages.
Ensure the trailing icon never orphans itself on to a new line. Paired with the icon alignment technique I shared last week to vertically center it.
<p class="relative inline-block pr-[1.25em]">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quia, ducimus
<span class="absolute ml-[.25em] inline-flex h-[1lh] items-center">
<Icon name="arrow-up-right" class="size-[1em]" />
</span>
</p>
Picked this tip of from John Phamous some time ago.
My current favorite approach to building bullet proof icon alignment within list items. Ensures icons are always vertically aligned to the first line of text, and ensures the icons do not shrink when text wraps to two lines.
<ul>
<li class="flex gap-2">
<span class="flex h-[1lh] items-center">
<Icon class="size-[1em] flex-none" name="badge-check" />
</span>
List item 2 that is longer than the others and wraps to two lines
</li>
</ul>
With this approach, you can apply a font size to the list item, and the icon will scale accordingly.
clerk.com
npx shadcn@latest add https://clerk.com/r/nextjs-quickstart.json
This single command will install:
For when <mark /> elements wrap to multiple lines, use box-decoration-break: clone; to render each fragment with their own specified border, padding, and margin.
mark {
box-decoration-break: clone;
padding-inline: 0.25rem;
}