Links
How to Create a Website and a PDF from the Same Codebase
In a nutshell, we’re generating a website from a CMS using Eleventy and generating a PDF version of the website using DocRaptor.
Some Use Cases for `revert-layer`
If you’ve ever tried using
all: revert
, then you’re probably aware of what a disappointment it is. On paper it gives you a clean slate, but in practice it does too much. It gets rid of (desirable!) styles that come withdraggable
,contenteditable
, svg attributes, imagewidth
/height
attributes, etc. Anyway,all: revert-layer
is likeall: revert
but actually useful. It can be used as a drop-in replacement forall: revert
, even if you are not making use of cascade layers anywhere else.
How to Kill the Cascade
With
@scope
you can isolate styles in a single component without them bleeding out into the rest of the page. This little bit of CSS prevents us from having to write a bunch of hacky styles or adding a new class name to this bad boy or doing some Shadow DOM style encapsulation stuff.
The Ultimate Ideal Bestest Base Font Size That Everyone Is Keeping a Secret, Especially Chet
It’s none. Let me clarify: don’t set a base font size. That’s it. That’s the secret. Don’t set a base font size.
Alt Text for CSS Generated Content
There’s an interesting feature in Safari 17.4 that allows content added with CSS to have ‘alt’ text. I’m not sure how I feel about this.
Videos
These CSS best practices might be holding you back - YouTube
We’re told about a lot of CSS best practices early on, and while some of them can be very useful, I feel like many of them are more like training wheels that are there so we can focus on other stuff, and eventually it’s a good idea to take them off!
Sponsor
Sponsored by Cloud Four
Thanks to Cloud Four for sponsoring this week’s newsletter! They solve complex responsive web design and development challenges for ecommerce, healthcare, fashion, B2B, SaaS, and nonprofit organizations.
If you’d like to help with the costs of running Friday Front-End, you can back our Patreon for as little as a dollar a month.