CSS Print Styles for PDFs and PrintingPermalink

Diana MacDonald 1:

You can use CSS print media styles to present your site’s content for print media, such as actual pages printing or for saving a page as PDF. This can let you write content once for the web and then format it differently for print. For an idea of what you could do with this power, you could:

  • Let readers print your blog posts, recipes, or tutorials on paper.
  • Add the ability to export reports in a SaaS product to PDF.
  • Help customers print invoices, tickets, contracts, or other documents from your website.
  • Convert web pages into a book.

Most resources I’ve found about print styles were written about a decade ago. In this post, I’ll share what I learned and what’s still relevant today.

Print CSS is the lesser known corner of the CSS specification, not often encountered by most web developers. A lot of it was specified in the early days of CSS and has remained stable since. While actual printing is one use case, the more common use these days is probably the generation of PDFs, something that I’ve had a lot of exposure to because I work at YesLogic on the Prince HTML to PDF tool.

Di’s post covers everything you need to know to get started using and developing print CSS in 2024.

  1. Full disclosure I’m married to Diana.

LLMs vs. Search Engines With Little or No ResultsPermalink

Jim Nielsen:

With a search engine, fewer quality results means something. But an LLM is going to spit back a response regardless of the quality of training data. When the data is thin, a search engine will give you nothing. An LLM will give you an inaccurate something.

Rather than saying “I don’t know, there’s not enough on this subject to formulate a working answer” — which is what you could infer from an empty search results page — an LLM will give you something that looks right. Then you have to go shoot yourself in the foot to learn it’s not right, because you didn’t know enough to know it was wrong.

LLMs just making stuff up is one of their main issues. I have to imagine there is a lot of work going into improving this situation, the end result of which is surely use-cases where the response is simply “I don’t know”. Until then you have to take every answer-style response with a healthy amount of scepticism.

Answering the Question If Not React, Then What?Permalink

Alex Russell with a detailed and relatively pragmatic post on building websites in 2024. The tone is a bit ranty but there’s a lot of sensible advice underneath it for those willing to listen. It tackles some common counter-arguments as well. This one is a particular peeve of mine:

“But… we need to move fast”

This chestnut should always be answered with a question: “for how long?”

This is because the dominant outcome of fling-stuff-together-with-NPM, feels-fine-on-my-$3K-laptop development is to cause teams to get stuck in the mud much sooner than anyone expects. From major accessibility defects to brand-risk levels of lousy performance, the consequence of this sort of thinking has been crossing my desk every week for a decade now.

This shortsighted view pops up in all sorts of places, and I wish that there was less focus on development velocity and more on how usable, reliable, well-designed, and efficient software was.

Interview With Evan Czaplicki, Creator of Elm Permalink

Kris Jenkins interviews the creator of the Elm programming language, Evan Czaplicki. Evan has been quite elusive in public since 2019 when Elm was put into stasis with the 0.19.1 release. So it’s interesting to hear a little more about what he’s been working on and some of the deep thinking he’s done around the sustainability of open-source and programming languages.

I am clearly biased but one bit that missed the mark for me was when Kris asked the following:

Okay, so I want to come at that from another angle as well because there is definitely a sense that more immediately accessible languages get success in disseminating ideas. But I also, it makes me think of another language which doesn’t have immediately accessible ideas and yet is being very successful and it’s Rust. Hmm. Right? What’s your, not what’s your take on Rust, what’s your take on why Rust is succeeding in mindshare?

Evan’s answer seemed to boil down to: Rust is succeeding because it had funding from Mozilla and that Mozilla was a trusted entity. Perhaps that helped get it off the ground, but the project has been independent of Mozilla since the 1.0 release in 2015 and since then has seen adoption from large organisations like AWS, Google, and Microsoft—clearly they see value in it outside its association with Mozilla. Mozilla’s contributions also dramatically decreased in 2020 when Mozilla laid off many of the folks that it was paying to contribute to Rust.

Aside from that, the interview is interesting and insightful. I fear that Elm may have lost the bulk of the momentum it had in the 5 years since the last release, so I’m not sure how Evan’s server-side solution will fare if/when it is released. However, I am hoping it achieves enough success to be sustainable for him.

Self Hosting Your Fediverse Presence With GotoSocialPermalink

Phil Hagelberg (aka Technomancy):

I’ve been on Mastodon since early 2017 and have really enjoyed it. It’s been great to see the Fediverse grow as a user-owned network that can function without a corporate overlord calling the shots, exploiting the user base, and ultimately squeezing it to death for monetization. There are plenty of problems that remain, but one of the biggest ones is that new users have to find an instance to sign up on, and this can be tricky. Installing and administering a Mastodon instance is a lot of work. The liberatory function of the network is only as good as peoples’ ability to make use of it, which requires running servers. If running a server is hard, fewer people are going to do it, and the power is going to be concentrated in the hands of a technical elite. A healthy network must make it easy to avoid this kind of centralization; to do that we have to look beyond Mastodon.

In 2019 I ran my own fediverse server out of my home on Pleroma for about a year; eventually shutting it down for a few different reasons. Then I started hearing more and more about this new GotoSocial server whose goal was to make it easy to run your own instance, and, well, I liked what I saw!

I followed a similar path to Technomancy with my Fediverse presence. I started off on mastodon.social in 2017, then migrated to a self-hosted Pleroma instance for a three-and-half of years. At the start of 2023 I was tired of incompatibilities between Pleroma and Mastodon clients (not really Pleroma’s fault) and looked into alternatives.

GotoSocial showed a huge amount of promise but it was nowhere near ready at the time, so I went with a personal Mastodon instance hosted by masto.host, which has worked out well. I’ve kept an eye on GotoSocial though, and they continue to make steady progress toward a complete ActivityPub server.