Posts in Frontend (20 found)
Unsung 2 days ago

A few more style guides

A while back I shared a bunch of interface guidelines and style guides , and I found a few more since then. I will update the previous link so it can stay a reference, but here they are as well: GEM User Interface Guidelines (1980s?) and GEM/TOS style guidelines (1980s? maybe?) One Laptop Per Child Human Interface Guidelines (2006) Windows Phone 7 UI Design and Interaction Guide – pre-release (early 2010) and version 2.0 (July 2010) Android Design (2012) Samsung One UI Design Guidelines (2018?)

0 views
Unsung 3 days ago

Linear’s login helper

One of the problems I encounter with modern login screens is remembering which sign in method I used for a particular service, and I was delighted to see Linear’s login screen help me out here: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/linears-login-helper/1.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/linears-login-helper/1.1600w.avif" type="image/avif"> I imagine this will only work on a machine I’ve used before – otherwise it’s a chicken-and-egg situation – so it doesn’t quite solve the entirety of the problem, but I still thought it was a nice gesture.

0 views
Evan Hahn 1 weeks ago

Static site generators are weird

I love static sites. Pre-rendered files are usually faster, lower maintenance, easier to secure, and more. Static site generators let you create these sites much more easily, which is fabulous. But I believe most static site generators are weird. SSGs like Jekyll , Gatsby , and Hugo require you to learn their special way of doing things. You have to answer questions like: You have to understand many of these in order to build a production-ready site, and every SSG is a different world. For example, my blog (which you’re reading right now!) has used Jekyll, Gatsby, and Hugo. For each one, I’ve had to learn its templating system, its asset system, its RSS feed system, and much more. Each project is thoughtfully designed, but totally its own thing. That’s not to mention the majority of SSGs, which are custom-made for one website. These projects tend to overflow with personality—rare programming languages, jagged feature sets, and flowery READMEs are on fine display here—and are often prime examples of the atypical. Weirdness at its best. This is not a critique of any particular project or of SSGs in general. I think this a lot of this weirdness is essential complexity , which I think most SSG developers would tell you. But I still think they’re weird! I expect to receive some feedback on this post like, “Static site generator X isn’t weird! Everything it does is normal!” I haven’t had that experience, and I envy you. Static site generators are great. And being weird is good! And I think static site generators are weird. How do you write HTML templates? How do you manage CSS and JavaScript? How do you deal with images and videos? How do you manage routing? How do you generate RSS feeds? How do you do unusual things, like one-off pages or redirects?

0 views
David Bushell 1 weeks ago

Death comes for XSLT

Last halloween, Google decided to kill XSLT . That was not a unilateral decision mind you, Google said “jump” and other browser vendors said “how high?” In response, I published my Intent to Deprecate and Remove Google Chrome . A performative declaration of course, I don’t install spyware. Fearing my parody lacked seriousness, I created XSLT.RIP to ensure the developer world was informed of Google’s death note . This did the trick, although a few commenters believed it was satire. There is subtlety to XSLT.RIP . The website itself is built with XSLT and when Google kills XSLT they’ll kill my website. The web standards process and its stewards ( Big Browser ) used to adhere to a social contract. Backwards compatibility was a major design principle. Under no circumstances do you ever purposefully break the web. Google decided to renege and break the web. XSLT.RIP will be broken soon and I’ll sit back and watch Google break it. 17 November 2026 appears to be the date of execution. Some Chromium-based browsers have been running a man-in-the-middle attack by injecting propaganda into XSLT websites. This site uses XSLT; that functionality is being removed from this browser very soon. When that happens, this page will likely no longer display correctly. You might be able to install a browser extension that allows you to continue viewing it. Otherwise, you should contact the maintainer of the site for further information. Source: This site uses XSLT: what Chrome’s banner means - XSLT Playground This appears to be an custom element that fails to render when it violates content security policy . I’m testing on ungoogled-chromium so who knows how it’s intended to look. The line of death is another “social contract” that Google has forgotten. They’re blaming website owners and acting like questionable purveyors of free public Wi-Fi. This is arrogant and intrusive. “contact the maintainer of the site” — you broke the web Google, own it at least. Thanks for reading! Follow me on Mastodon and Bluesky . Subscribe to my Blog and Notes or Combined feeds. “Don’t break the web” “Don’t break the web” “Don’t break the web”

0 views
Kev Quirk 2 weeks ago

2026-10-29 14:56: Been having some fun with my 404 page. I love discovering little Easter eggs like...

Been having some fun with my 404 page. I love discovering little Easter eggs like this on other people's sites. Just visit a random page, like https://kevquirk.com/mjkk Thanks for reading this post via RSS. RSS is ace, and so are you. ❤️ You can reply to this post by email , or leave a comment .

0 views
Unsung 2 weeks ago

A set of rectangles getting exponentially angrier, too

(It’s Halloween Week on Unsung, where we’re sharing scary, spooky, and creepy stories.) In July, I shared a video showing how strange visuals can get as you moved them further away from [0, 0, 0], and they start to be affected by the inherent limitations of floating point numbers. In response to that post, one of the readers (thank you, Ronan!) shared a similar video from a game Outer Wilds: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/a-set-of-rectangles-getting-exponentially-angrier-too/yt1-play.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/a-set-of-rectangles-getting-exponentially-angrier-too/yt1-play.1600w.avif" type="image/avif"> But I was curious if I could see something like this in a productivity app. I mentioned that Figma didn’t allow to move the viewport past a certain safe margin, but I since found a loophole: If you move an object off the safe area, and then invoke the Zoom To Fit command, Figma will actually allow itself to scroll further and further into the territory where laws of physics start to loosen up. It’s technically a bug, although I don’t believe it’s even worth fixing. However, it allowed me to do something fun. Behold, a timelapse of a set of macOS mock-ups deteriorating as you move them further and further away, to completely disappear when the X value reaches around 2 billion:

0 views
Den Odell 3 weeks ago

Design Systems Should Be Fast by Default

If a design system’s components are slow to interact with, so are any apps built with them. I timed large dropdowns and checkbox lists in some popular design systems, worked out how to make the slow ones faster, and wrote tests that fail when they’re too slow. Web apps are usually architected and built in layers. The browser is the foundation, often with a framework like React or Lit above that, followed by the company’s shared libraries and design system, and finally the product team’s own code is at the very top. The browser has one main thread for running JavaScript, responding to user events and drawing the screen , so the less work the lower layers do, the more of it is left for the app. If a design system’s equivalent of a dropdown takes a second to open and display its options, it’s not going to be any faster in the apps that use it, however well their teams write the rest of their code. If the design system team takes the time to make that faster, it unlocks better performance for all the apps built with the design system at once, and for everyone using them. I know that design system teams already think this way about accessibility. Using a well-built design system’s button component gives you the correct keyboard support and ARIA roles out of the box, and many design system teams rightfully check their components for accessibility thoroughly before each release. For some teams, though, performance doesn’t always get the same attention. Components usually get tested in isolation with just a few items, nothing intense enough for the cracks to show. They start to slow down once a real app gives them much more to do. The team building that app can feel the page is slow, but because that comes from the design system, they can’t easily fix it themselves. I feel that performance belongs on the design system team’s priority list, next to accessibility. That means testing each component with demanding but realistic amounts of data before it’s released, and making sure its performance doesn’t get quietly worse over time. “Performance belongs on the design system team’s priority list, next to accessibility.” I’m eternally curious, so I took it upon myself to conduct a bit of testing. I wanted to see how some of the most popular open-source design systems fared on performance. I deliberately chose ones built on different frameworks, as I was interested in whether certain frameworks would turn out to affect performance more than others. Here are the ten I picked, with the versions I tested in October 2026: I left out some popular design systems that weren’t actively being developed any more, for a fairer comparison. Also, React Spectrum and Spectrum Web Components obviously share the same design language, but they’re separate libraries with their own code so I wanted to see whether they’d perform the same. The first thing I did was to look through each of their codebases to see if they had any automated performance tests. Only Spectrum Web Components seemed to. It runs a benchmark for each of its components every time a pull request is created. Fluent also has a benchmark for each of its components, but I couldn’t see them running automatically anywhere. The others didn’t appear to test for performance on a component level at all. Ant Design, Material UI and Fluent do check their bundle size. That’s usually what design system teams measure when they consider performance, and it’s definitely important as it affects page load time, but it doesn’t relate to how quickly a component actually responds on the page. I then picked two fairly intensive tasks that real web apps do often and I timed each design system on those. The first was opening a country selector with all 249 countries from the ISO list , like the ones you get on checkout and sign-up forms. The second was selecting 100 checkboxes at once, just like clicking a “select all” checkbox above a list of 100 messages in a webmail app. I realize these two tasks aren’t an extensive review of performance across an entire design system, but they’re where components often get slow, so they’re a good place to start. Before we get to the results, I want to make clear that all of the design systems I tested are well built and are widely used, and they’re written by expert engineers who I respect. The point of this research isn’t to rank them or offer criticism, but to use them as examples to encourage us all to prioritize performance in our design systems. And for any problems I uncover, I’ll suggest a fix, the way I would in any manual code review. I ran these tests with production builds of each design system, using Chrome v155 on my M1 Pro MacBook Pro. A script clicked the country selector or checked all the checkboxes, then measured how long the browser’s main thread stayed busy afterwards, including any animation, and that’s the time shown in the tables. The script slowed the CPU down by 4x, the same as the throttling setting in the Performance panel of Chrome’s developer tools, which I always recommend when developing, because it’s closer to how real users’ devices perform. To avoid any spurious results, I ran each test three times and took the median values. I also measured the longest time the UI stopped responding during each task. That happens when the main thread is blocked, because the browser can’t update the screen or respond to user events, so the page appears to have locked up. Chrome only tells you about frames that take longer than 50ms to draw, so I’ve put “Under 50ms” in the tables wherever it didn’t report any. I’ve put the tests into a design-system-performance-tests repo on GitHub, by the way, in case you want to run them yourself. On to the results, and here’s how long each design system took to open the country selector, from fastest to slowest: The country selectors in Fluent and Carbon opened faster than any of the others. Ionic’s was by far the slowest, taking more than five times as long to open as the next slowest, React Spectrum. To see how the time to open changes as the list gets longer, I opened the country selectors in Ionic and Fluent again with just 50 options. Ionic’s took 203ms with 50 options, but over 1.2 seconds with all 249, and for most of that time the UI stopped responding. Fluent’s barely changed, going from 41ms to 61ms. Now, here’s how long each design system took to select all 100 checkboxes: Ant Design took six times as long as Material UI, even though both are built with React. Selecting the checkboxes didn’t stop the UI responding for any noticeable length of time in any of the design systems, which is encouraging. The longest it stopped responding for was 78ms, which is about five frames the browser skipped drawing at 60fps, far shorter than the slowest country selectors. Both sets of results showed that a design system’s performance didn’t depend on its framework by itself. Carbon, Web Awesome and Spectrum Web Components are all built with Lit, but the country selector in Spectrum Web Components took more than twice as long to open as the one in Carbon. And Ionic had the slowest country selector of all those I tested, but its checkboxes were faster than most of the others, so the same design system can be slow at one task and fairly quick at the other. I didn’t want to leave my testing there without trying to find out the reason for the differences between the results, so I did some profiling on the slowest ones. With the CPU still throttled by 4x, I opened the Performance panel, pressed its Record button, opened the country selector or selected all the checkboxes, and then stopped the recording. The Summary tab at the bottom of the panel shows how the main thread’s time gets split between Scripting, which is JavaScript execution, Rendering, which covers calculating styles and layout, and Painting, which is preparing what to draw on the screen. The “Bottom-Up” tab lists the JavaScript functions that ran, sorted by how long they took, and you can click on a function’s file name to open its source code in the Sources panel and see what it was executing. Going back to Ionic’s results from earlier, its country selector took more than six times as long to open with five times as many options. If each option took the same amount of time to add, it would take about five times as long, or a little less in practice, since showing the dropdown itself takes the same amount of time no matter how many options it has. That means each new option must take longer to add than the last one before it. Figure 1: The DevTools Performance panel after recording Ionic’s country selector opening with 249 options, with the Bottom-Up tab open and the slowest functions at the top. In the Bottom-Up tab for Ionic’s country selector, shown in Figure 1, most of the top rows were functions with minified names, all from the same file. That file also had its own version of , a method the browser normally provides, and running that version took up about half of the time the country selector needed to open. Clicking into those functions, I could see the file contained Stencil’s framework runtime. The button at the bottom of the Sources panel formats minified code so it’s easier to read, and when I compared it with Stencil’s source code on GitHub, I could see that these functions were part of Stencil’s handling of slots. A slot is a placeholder inside a web component that marks where the elements you put inside it are shown, such as the options inside a dropdown. Other design systems built with Stencil might have the same problem. In Ionic’s country selector, each option is a radio button, and they’re all inside a radio group, , which makes sure only one of them can be chosen at a time. Slots are normally handled by the browser, through shadow DOM, which is the feature that gives a web component its own private set of elements, separate from the rest of the page. doesn’t use shadow DOM, though, so Stencil handles the slots instead. It replaces the radio group’s and methods with its own versions that work out where each new option should go. To do that, it checks all the options already in the radio group to find the right slot, then checks them again to work out where the new one should go. Once the new option has been added, Stencil goes through all the options a third time to find out whether the slot’s fallback content should be shown. Fallback content is what a slot displays when it’s empty. Adding the 249th option means checking the 248 options before it three times, while adding the 10th only means checking the 9 before it, which is why each new option takes longer to add than the last one. The setting that replaces is called , and Ionic enables it through another setting, , which turns on all of Stencil’s fixes for slots in components that don’t use shadow DOM, including that one. So the delay comes from that setting together with a radio group that doesn’t use shadow DOM, rather than from Stencil being slow in general. Both settings are by default today, but Stencil’s documentation say they’re meant to become by default in the upcoming v5 release. If that ships as it is, any component that uses slots without shadow DOM will slow down the same way Ionic’s dropdown does, because Stencil will check all of its existing children each time a new one is added. Ionic could fix its dropdown by making use shadow DOM, so the browser handles the slots instead of Stencil, and the browser’s normal function would then be used. That fixes Ionic’s dropdown for all the apps that use it, though it would change how apps can style the radio group, so it would probably need to wait for a major release to do so. Or Stencil could fix the problem by only checking the fallback content of the slot that changed, and skipping that check when the slot already had options in it, because its fallback content would already be hidden. To find out how much difference that would make, I removed the third check from a copy of Stencil and added 2,000 elements, one at a time, to a simple test component. Adding them was about seven times faster without the check. Fixing it directly in Stencil would also fix the same problem in any Stencil-based design system that uses slots without shadow DOM. I’ve raised this with both the Ionic team and the Stencil team . I ran in the Console before and after opening Material UI’s country selector, and the count went up by about 250 elements, one for each option, as soon as its dropdown opened. I ran the same check on Ant Design’s country selector, and the count only went up by about 40. Ant Design’s country selector renders just the options that fit in its dropdown, and renders more as you scroll, which is a form of virtualization. That’s why it opened noticeably faster than the one in Material UI. Virtualization works for long menus and tables too, but it needs care with keyboard navigation and screen readers, because only the options or rows that fit on screen are actually in the DOM. Ant Design’s dropdown is a good example to learn from here. As well as the options you can see, it keeps a hidden copy of the highlighted option in the DOM, so screen readers can still announce it. In the Summary tab, I noticed that Rendering made up about half of the time UI5’s country selector took to open, and Scripting made up much less. So the delay was mostly coming from the browser working out styles and layout, not from executing UI5’s JavaScript functions. In the Elements panel, all 249 options are already in the DOM before the dropdown opens, inside a hidden popover. The browser doesn’t work out styles for elements that are hidden, so when the popover opens, the browser has to style all of them at once. That’s about 1,500 elements, because each of the 249 options has its own shadow DOM with more elements inside. Virtualizing the list, the way Ant Design does, would give the browser far fewer elements to style. React Spectrum’s country selector uses virtualization too, but it was still the second slowest to open, after Ionic’s. I opened it with half as many options, and it took about the same amount of time, so the length of the list wasn’t what made it slow. I profiled it, and near the top of the Bottom-Up tab was a browser function, , called from React Aria, the library React Spectrum is built on. In React Aria’s source code , I found that every time the country selector opens, React Aria goes through the visible options one by one. For each one, it checks that the option is visible, clears its height, and then reads its size, and the browser has to work out the layout of the page again for each of those checks. This is known as layout thrashing. All of that happens straight after the user clicks the country selector, and the UI stops responding until it’s finished. React Aria could clear the heights of all the options first, and then check and measure them all, so the browser only has to work out the layout once instead of again for every option. I’ve raised an issue with the React Aria team about this. I profiled Ant Design’s checkboxes as all 100 were selected, and executing JavaScript made up less than a third of the time it took to select them all. The rest was the browser calculating styles and drawing each checkbox’s animation, 100 times over. I turned the checkboxes’ animations off on the test page, with a CSS rule that sets their transitions and animations to , and selecting all the checkboxes then took less than a third as long. Almost all of the style and drawing work went away, and so did some of the JavaScript, which was tied to the animations. The animation helps when someone checks one box, but users don’t need to watch 100 checkboxes animate at the same time. Ant Design could fix this by only animating a checkbox when someone selects it directly, or the code behind a “select all” checkbox could turn the animations off before checking all the other checkboxes. “Users don’t need to watch 100 checkboxes animate at the same time.” None of this means a design system has to give up its animations, because they can be changed to be less demanding for the main thread. The Elements panel shows that Ant Design’s checkbox styles fade the checkbox’s background and border colors, which the browser has to repaint on the main thread for every frame. Fading the opacity of a filled layer gives the same effect, and the browser can run that on the compositor thread instead. That’s a separate thread that puts together the parts of the page the main thread has already drawn, so it can fade them by itself and keep the animation running even while the main thread is busy. I found these problems by profiling, but each one could have made a performance test fail before the component was released. Most component tests render one copy of the component with a few props, which shows it works, but not how fast it is with 249 options in a country selector or 100 checkboxes being checked at once. In a performance test, you set the component up the way a real app would use it, and then time how long the page takes to respond when you interact with it. Listing 1, below, introduces Playwright performance tests for the country selector, using a fake design system I made up called Nettle. The repo runs the same tests on each of the ten design systems I tested, along with a test that checks all 100 checkboxes at once. The test page renders the country selector with the number of countries set in its URL, such as . In each test, Playwright clicks the country selector to open it and measures how long the browser’s main thread stays busy afterwards, along with the longest time the UI stopped responding. Listing 1: Performance tests for Nettle’s country selector. The function in Listing 1 returns Chrome’s metric, which is a running total of how long the main thread has been busy. If you subtract the total before the click from the total after it, you get the time for everything that happened as a result, including JavaScript execution, rendering and painting to the screen. I ran both tests with the CPU slowed down four times, the same as for the tables above. In my testing, Ionic’s country selector was the only one to go over the first test’s 300ms limit with all 249 options. One long pause that locks up the UI feels worse to a user than several short ones, even when they add up to the same total time. The country selectors in Spectrum Web Components and UI5, for example, took almost the same total time to open, but the one in Spectrum Web Components opened in several smaller steps, so the page only locked up briefly each time. UI5’s one had to style all of its options at once, so the page locked up for longer. That’s why the first test also uses the Long Animation Frames (LoAF) API , which reports any frame that takes over 50ms to draw, so the test can fail if one of them takes 100ms or more. With all 249 options, the country selectors in Ionic, Material UI, React Spectrum and UI5 failed that check, and Ionic’s failed it even with just 50 options. Each limit in these tests is a performance budget , which is the most time something is allowed to take before the test fails. I picked 100ms as the budget for how long the UI can stop responding, because that’s roughly where a response stops feeling instantaneous. In the first test, I gave the total time a higher budget of 300ms, because the test waits for the dropdown to finish animating open, so the total also includes drawing each frame of that animation. You can set your own budgets by running the tests on your components now and setting each one a little above the result, so the tests fail if a later change makes a component slower. The second test in Listing 1 opens the country selector with 250 options, rounded up from 249 so it halves evenly, and then with half as many, the same kind of comparison I made with Ionic’s results earlier. The full list should take no more than about twice as long to open as the half list, so the test fails if it takes much longer than that, with a little room to allow for the times varying from run to run. Every country selector except Ionic’s passed easily, taking well under twice as long with the full list, while Ionic’s took nearly three times as long and failed. If I could only choose one test to run, it would be this one, because it fails when each option takes longer to add than the last one, and you don’t need to change its budget for machines with different specs. After I’d written these tests, I found that Spectrum Web Components already has an automated test for a country selector just like mine, with all 249 countries. But that test only times how long the closed dropdown takes to render on the page, while this one times how long it takes to open when someone clicks it. The same ideas work for other components too. You can adapt the country selector tests for anything that shows a long list, like a menu or a table, and the checkbox test for anything that appears many times on a page, like icons or buttons. If you run these tests automatically on every pull request, with something like GitHub Actions, you’ll know straight away when a change affects a component’s performance. To try the tests on your own design system, you can copy one of the folders in the repo and change it to use your components. The README explains how, and the repo also has a GitHub Actions workflow ready to use. Repository: denodell/design-system-performance-tests — The country selector and checkbox tests from this post, with a folder for each of the design systems I tested. Each one times how long the main thread stays busy and how long the UI stops responding, with the CPU slowed down by 4x. Apart from testing, I think the most useful thing you can do is make the fast behavior the default. A dropdown can switch to virtualization once its list gets long enough to go over its performance budget, and a checkbox might only animate when someone selects it directly, as I suggested for Ant Design. App teams then get the fast version without having to know the problem ever existed. “Make the fast behavior the default.” You can also write in your design system’s documentation how many items each component has been tested with, such as “the dropdown is tested with up to 500 options, and above that an autocomplete is a better fit”. To work out how many options to specify there, you can keep running the tests with more options until the dropdown goes over its performance budget. Once that limit is documented, app teams know how far they can push a component before it gets slow, and you know how many items your tests need to cover. Pages in real apps that use lots of your components are the best indicator of what to fix next, because they show how your components are really used. If you ask app teams now and then to record a profile in the DevTools Performance panel while they use those pages, and send it to you, you can see which of your components might be impacting performance. In React’s development builds, those profiles include a Components track , which is a row in the Performance panel’s timeline showing how long each component took to render. Profiling builds only show it for the parts of the app wrapped in React’s component. Web components don’t get a track like that, but I’ll cover a solution to that in a follow-up post. Each time you release a performance fix, your release notes can give the before and after measurements, such as “the dropdown now opens in 150ms with 500 options, down from 300ms”. App teams can then see exactly what got faster and check the difference in their own apps, the same way a line like “screen readers now announce the selected option” tells them what’s improved for accessibility. A design system is a foundation for the apps built with it, just like the browser is. Browser makers measure performance before every release, and it’s worth doing the same with your design system. This is the idea behind Fast by Default : building performance in from the start, instead of fixing it after users complain. My new book, Fast by Default: Practical Performance Engineering , takes this approach further, for backend and mobile code as well as the web, and explains more about how to set performance budgets and check them on every pull request. It’s in early access from Manning now. Mantine 9.7.1, built with React Ant Design 6.6.5, built with React Material UI 9.5.0, built with React React Spectrum 3.47.6, built with React Carbon 2.65.0, web components built with Lit Fluent 3.1.3, web components built with FAST, Microsoft’s web component library Web Awesome 3.14.0, web components built with Lit UI5 2.27.2, web components built with SAP’s own in-house framework Spectrum Web Components 1.12.4, web components built with Lit Ionic 9.0.7, web components built with Stencil

0 views
Unsung 3 weeks ago

Apple’s iPod recreation

Just a week ago , I bemoaned the lack of any good iPod click wheel explainers, and today the news broke about Apple Music hiding a functioning iPod on their 404 page . I am usually not a fan of easter eggs – most of them are poorly made – but this might be the best iPod recreation I’ve seen, and it’s an interesting thing to study: = 3x)" srcset="https://unsung.aresluna.org/_media/apples-ipod-recreation/1-framed.1600w.avif" type="image/avif"> Most importantly, it works well on mobile, too – well, some of the page chrome and ads feel a bit the way, but it’s not a big deal (and you can hide them using the Hide Distracting Items feature in Safari) – so you can pretend you’re holding an iPod in your hand. Worth spending a bit of time with it, especially if you have never used an iPod in your life: Kudos to whomever put this together. This is how you do easter eggs. (I tagged this as emulation , even though this is a grounds-up recreation in HTML, CSS, and JavaScript.) I think it generally covers all the modes etc. (with small exceptions) the typography looks accurate, it has the little “haptic” beeps, it has proper acceleration and the scrollbar, it has a little music library with various playlists, I have only noticed a few small bugs.

0 views
Unsung 3 weeks ago

“No results” doesn’t mean “no results,” pt. 1

This is something I see time and again in Google Maps when plotting directions: = 3x)" srcset="https://unsung.aresluna.org/_media/no-results-doesnt-mean-no-results-pt-1/1-framed.1600w.avif" type="image/avif"> You might be thinking “this feels like a genuine error – not every two places on earth can be connected,” but that’s not it. I am in a good traffic corridor and, ten seconds later, doing the same exact thing again shows proper directions: = 3x)" srcset="https://unsung.aresluna.org/_media/no-results-doesnt-mean-no-results-pt-1/2-framed.1600w.avif" type="image/avif"> The clue as to what’s going on is elsewhere in both screenshots. My cell signal is low, and the Google Maps misrepresents no results arriving because of slow connection, with no results being there at all . Just to get Google Maps off the hook, here’s a similar thing in a Mastodon client Ivory: = 3x)" srcset="https://unsung.aresluna.org/_media/no-results-doesnt-mean-no-results-pt-1/3-framed.1600w.avif" type="image/avif"> There are 123 posts to be seen here, as the page itself conveys elsewhere. But at this moment, the internet is slow, and Ivory jumps to a wrong “no posts found” conclusion, instead of saying “cannot retrieve the posts because of a bad connection.” I believe what’s happening in these moments is that one kind of “no results” (software asked for posts, but the database results came empty) gets bundled with another (software asked for posts, but the database results didn’t come back in time, or transmission was interrupted). This feels important to me, because the wrong kind of an error can really confuse people and make them jump to the wrong conclusions – I guess Mark Simonson isn’t active on social! I guess I can’t drive there! – or even create bad mental models. Also, while this was a temporary situation for me, for a lot of people bad connection is a constant fact of life, so they might encounter this kind of confusion on a daily basis. Software should differentiate between different ways something can be zero , and in this case, communicate that back to the user. What’s really strange is that Google Maps has a separate “no internet connection” state that you can see in other moments – incl. an extra thoughtful and important manual try again button… = 3x)" srcset="https://unsung.aresluna.org/_media/no-results-doesnt-mean-no-results-pt-1/4-framed.1600w.avif" type="image/avif"> …but apparently still fails to use it in all the cases.

0 views
Unsung 1 months ago

The distance between ⌘8 and ⌘9

One thing that might be fun to add to the ⌘1/2/3 tab post is this: while ⌘1–8 select tabs from the left, ⌘9 doesn’t jump to the ninth tab, but to the last tab: I think it’s thoughtful – a recognition that both edges are important. (Previously we’ve seen Bear understanding that , too.) Why not ⌘0, though? Sure, you can say it’s not as elegant (0 is smaller than 9), or that it wouldn’t work in Hungary… = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-distance-between-cmd8-and-cmd9/3.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-distance-between-cmd8-and-cmd9/3.1600w.avif" type="image/avif"> …but I think the Occam’s Razor is simply that ⌘0 has already been taken by a popular “zoom to 100%” command by then, and overlapped too often for comfort.

0 views
Lea Verou 1 months ago

The best way to use icons in Web UIs

I’ve always had a soft spot for icons 1 . Not only do they add polish to a UI, they can also tangibly improve usability. Familiar icons help users find what they need quickly, since we recognize pictures much faster than we read words. And as a web architect at heart, the current dominant ways we have to include icons on the Web make me sad. While there are many, many different ways to include icons in a Web UI, each with different performance characteristics , by far the most common ones involve adding inline SVG to the HTML. For example, a trash icon might be included like this: Some people use a separate SVG file for sanity and include icons via , but the markup is still fairly clunky (not to mention slow, sans bundlers). All this clunkiness forces people to resort to hiding the icon under layers of abstraction, such as dedicated custom elements like or React components like , but the ugliness still ships under all these layers, and the browser still has to deal with it. Icon fonts did put icons in CSS ( is still how Font Awesome’s pseudo-element mode works), and a lot of their appeal was exactly that. But they came with a long list of issues : large downloads (even with subsetting), fallback glyphs when the font fails to load, screen readers announcing private-use codepoints, user font overrides (e.g. for dyslexia) wiping them out, and text hinting that was never designed for pictures. We threw out the baby with the bathwater: the problem was the font, not the CSS. Many of the attempts to move this to CSS still involve markup. The mask trick that most of them rely on is not new either: Chen Hui Jing covered it in 2021, and Iconify generates mask-based CSS for its entire catalog. But in all of these, which icon to use (and whether to use one at all) is still decided in the markup, via one class per icon; CSS only handles color. The closest I’ve seen is David Bushell’s 2024 post on including icons purely via CSS via generated content + masks, where the icon is picked in CSS, but every selector that wants to support icons needs its own chunk of CSS, and there is no way to override the icon on a case by case basis. I still think it’s superior to inline SVG in HTML, and it baffles me why it isn’t more popular. Per the principles outlined in my user effort article , a good icon system should: How does that translate to an icon system? Per consumers > producers , making icon usage ergonomic is more important than making icon definition ergonomic, but ideally adding a new icon to the icon system should not require much more than: And of course, it still needs to be reasonably performant — the existing success criteria don’t disappear! The dominant ways to include icons today fail to meet at least one of these criteria. Can we do better? CSS is the only web platform language that facilitates reactive aggregation : you declare what applies to what conditions (type of element, interaction state, media query, etc.) and the browser automatically applies the right styles when those conditions are met and cleanly removes them when they are no longer met, without affecting any other conditions that simultaneously apply to the element, and without forcing developers to manage any of these side effects manually. I personally think we are underutilizing this wonderful language by artificially restricting it to styling, but that’s a topic for another article. If we can nail icons via CSS, this gives us tremendous expressive power, with practically no loss of flexibility. Imagine being able to tweak icons based on… Additionally, if icons can be injected or tweaked via CSS, this means we can specify them on pseudo-elements, such as , , or , something no markup solution accommodates. Or even, imagine applying entirely different icon sets to the entire page (or a portion) without having to touch any markup! E.g. a section with a hand-drawn aesthetic could get a hand-drawn icon set, without affecting the rest of the UI. The possibilities are endless. Once you allow yourself to consider that this is possible, you will start seeing use cases everywhere. Including icons as direct s (especially with no wrapping abstraction to manage a shared registry) means there is no way to enforce consistency — anything goes. One page might use a Font Awesome trash icon, another might use a Lucide trash icon. I think the icons themselves should be a type of design token, managed by the design system, that UI components simply use, just like colors and gradients. Managing icons via CSS also allows us to define them alongside other design tokens (e.g. as CSS variables on ), rather than in a separate place. Suppose icons were CSS variables, and we could add an icon to an element simply by setting an custom property, e.g. by doing something like This means we could also make simple things easy via: while maintaining the ability to override the icon on a case by case basis by simply overridding the property. We can even adapt to state reactively: or user interaction, e.g. to communicate both where a link goes (GitHub) and what it is (an external link): And for completely ad hoc standalone icons where adding CSS would be more work than doing it inline in HTML, we can have an class: This makes it strictly more powerful than the markup approaches , with the only exception being that completely inline SVG allows potentially changing the SVG itself in arbitrary ways (e.g. morphing it into another icon or changing it dynamically as the result of user input). For those cases, we’d still need inline SVGs. But how many of your icons fall in that category? The core idea can be summarized as: Icons are inserted via pseudo-elements, which use the icon to mask a square with equal to the icon color. The referencing syntax I’ve settled on is: You could be more elaborate and also define properties like , etc, if you deem them useful! The beauty of this approach is its immense flexibility. Available icons are defined on as CSS variables, e.g.: One-off icons can still be used by setting e.g. instead of , but if most UI references registered icons, they will stand out like a sore thumb and will be easy to spot in a review. Then, to display these as icons, the crux is: For simplicity, I will only discuss / in the rest of this section, but everything applies identically to / and any additional ones. You may be wondering why I’m specifying the size twice instead of . Flex items stretch by default, and a stretched size is definite, so is ignored. Since icons so often live in buttons, and buttons are so often , an explicit is far more robust. Grid happens to be fine ( behaves as for items with an aspect ratio), but flex has no such exception. Unfortunately, you need to repeat the pseudo-element contents for every type of pseudo-element you want to be able to support icons on. Mixins will eventually fix that. As described above, this would apply to all elements, which is far from ideal! We can use a style query ( finally Baseline! 🎉 ) to restrict this to only elements with the property set: We would also need to register as non-inheriting via , otherwise any container with an icon would sprout an icon for every single descendant (including inline formatting like , etc!), which we definitely don’t want. And then just explicitly inherit them in the pseudo-element: Style queries are Baseline 2026 , which sounds quite cutting edge. However, if you look at market share, it is supported in ~93% of users’ browsers worldwide per Can I Use data. While this data under-represents old Chrome Android (it lumps all Chrome Android under its latest version), Chrome shipped style queries in 2023 (in version 111) and Chrome Mobile users do seem to upgrade pretty quickly , so the real number won’t be meaningfully lower. How is this possible? If you sort by date, you will see that all major browsers except Firefox had shipped style queries by 2024. Firefox was the last one to ship them, in May 2026. Now, let’s see the Usage relative chart: Firefox as a whole accounts for 2.28% of worldwide market share. Now, I’m not saying ignore Firefox because of its low market share! That would be a d*ck move, comparable to making UIs inaccessible because screen reader users are a minority. Some things matter more than their raw numbers might indicate , and not excluding Firefox is essential for the Web to remain open, interoperable, and not controlled solely by large companies. That said, for features that have shipped in every major browser, I think it’s defensible to take market share into account. Baseline tiers are a great …baseline, but no compact metric could possibly convey this kind of granularity. Especially for something like this, where things generally still work fine without icons, it’s a plausible strategy to treat icons as a progressive enhancement and just accept not having them in the 7% of browsers that don’t support them. For the cases where icons are crucial, (e.g. icon-only controls) we can use a class (e.g. , , , etc), so that older browsers with no style query support still get them. Then, how much you want to lean in to progressive enhancement depends on how widely you rely on the class vs the style query. You could even add other known selectors to it e.g. inline styles or known selectors with icons: Do note that unrestricted attribute selectors like that can be slow, so use them judiciously. One issue with the class approach is that it hardcodes icon presence , even if you can still tweak the icon itself via CSS custom properties. One way to deal with this is to specify a value that becomes IACVT if the custom property has no value, which would make the entire pseudo-element disappear: This will resolve to a transparent image if is defined, and to → if it is not, which will effectively remove the pseudo-element. And yes, is Baseline Widely Available . It doesn’t remove any of the other properties, so it still cannot compose with other styles, so don’t apply it so broadly it can clash with other elements that may have styles. The styles above are a start, but we can do better: Putting it all together so far, we get something like this If you’re viewing the demo in Chrome or Firefox, it should work as expected. If you’re viewing the demo in Safari, you’ll already know that it’s severely broken. My research on this resulted in filing not one, but two Safari bug reports. The good news is that all have workarounds. The bad news is that these workarounds force us into suboptimal code, and unless we’re willing to ship a different version to Safari, everyone suffers. WebKit bug #301609 was the one that really threw a spanner in the works the most for this technique: The tl;dr is if you use what I wrote above, the icons will not show up in Safari until the user interacts with them in some way (e.g. hover, focus, etc.). Thankfully, I found a CSS workaround: However, since this applies an animation to all and pseudo-elements, ideally we’d want to restrict it a bit, and make it easier to override by wrapping it in a layer. Turns out this seems to magically also fix WebKit bug #320220 , which is also relevant here. At this point our demo works almost perfectly! Can you spot the bug that remains? There are two buttons that change their icon on hover: Default icon and Github to link . The former works, the latter doesn’t. WAT?! So, there is a difference between them: sets on hover, whereas Github to link sets directly, via . And is registered as non-inheriting, which is quite relevant here. Turns out that used to not work at all in Safari until 2023 , and there are still some cases where it reproduces today. The investigation resulted in WebKit bug #325900 being filed. There are a few solutions here of which the only workable one seems to be to register the property as inherited after all, and add a style query that resets it on descendants: It’s a bit more fragile and likely slower, so ideally we’d only ship it to Safari. can only detect features, not bugs, so once more we have to resort to sniffing WebKit. Conveniently, is allowed inside conditional rules, and when a property is registered multiple times, the last registration wins: The layer means any unlayered declaration wins over the reset, even zero-specificity ones like . Putting it all together, here is the final demo, with both workarounds applied: When using icons from SVG files it’s important to remember that any relative URL will resolve relative to the CSS file that uses the icon, not the one it’s defined in . In practice, this forces you to use root-relative URLs (e.g. ), otherwise you’ll have random breakage in any nontrivial project structure. An alternative is to register the icon properties as via and specify their values via : This is also better for other reasons: The obvious downside is DX: there is a lot more boilerplate to define an icon this way. The earlier syntax can be managed by hand, even for many icons. This starts requiring a build step after a dozen or so. Additionally, registered properties are currently global and don’t work in shadow roots , so that may not fit every use case. Another option might be to go through all properties in and register them via JS: An even cleaner option, if you know which stylesheet includes the icon tokens (and it’s same-origin) is to use the CSS OM to actually edit it, so that the declarations are removed once you register the properties: Since the icon is a mask, this technique only works for monochrome icons (varied opacity is fine) — but most icons are monochrome these days anyway. If you really need more, Allegro’s engineers stack masks on the element and both its pseudo-elements, which gets you up to three colors from a single element. But what about full color icons, e.g. emojis? Or textual icons, e.g. …emojis? In theory, the technique can work fine with them, these are actually easier! For full color icons you just set them as background images, no masking required. And for textual icons, you can just set them directly on the property. The only challenge here is branching between these three. But this may be the subject of a future post, as this is already getting quite long. Since the entire pseudo-element is masked, you cannot apply a separate background or border to it. For that, you’d need an actual element (e.g. ), and you can apply the borders, backgrounds, etc to that. Completely arbitrary animation would obviously still require inline elements. But what about predefined animations? A checkmark or X being drawn, a hamburger animating to a close button, etc.? I thought I had figured out a way. And I did get so close! Close enough that the whole saga deserves its own post, so stay tuned 😉 The system above gets us pretty good DX (especially without the Safari bugs!), but some things are still not ideal. First, the masking approach does introduce some limitations it would be nice to be able to get rid of. Then, signal-to-noise ratio could be even better: And while consumers > producers, it would be really nice if adding support for new pseudo-element types did not require such a song-and-dance. A number of upcoming CSS features get us closer to this North Star . If you haven’t heard of the new CSS Linked Parameters spec, it’s the best thing that has happened to CSS icons in a long time. It allows us to pass arbitrary data to any resource that supports it (and yes, SVG is one of them), which means we can customize icons in ways that were previously impossible, such as changing the stroke width, color, or even entirely arbitrary customizations, since SVG also supports style queries. And as of a couple weeks ago, it also supports passing and without any double opt-in from the icon, which means we can use any existing icon library without it having to be updated to utilize them! There are some limitations still, but it is being actively designed, Firefox has shipped an earlier version of the spec , and is one of the top Interop 2027 proposals , so I’m quite hopeful it can make it much easier to use icons in CSS. Keep a close eye on that one! Currently, due to a technicality in how the property is handled, we have to rely on background images to include icons, because otherwise and don’t work. Even Link Parameters by itself won’t change that, it will just allow us to get rid of the masking hack. Thankfully, we (CSS WG) recently resolved on a change that will fix this! (pending compat analysis) is the CSS feature you didn’t know you were desperate for, and deserves an article of its own for its myriad of use cases in design systems. Until I write that, Bramus has a great write-up . But more relevant to icons, once is widely supported, we can construct variable names dynamically, meaning we can use plain identifiers instead of CSS variables, which will make the syntax even cleaner, meaning we’d be able to translate into at the cost of a little complexity on the producer side: Yes, it’s ugly, but it’s also an implementation detail that’s not exposed to icon consumers, so I think the tradeoff is worth it. Combined with expanded , which is getting there with only Safari remaining (Safari TP already supports it), this also unlocks ad hoc icons via a plain attribute: We recently resolved to support registering multiple properties with the same descriptors at once via , this won’t help much here, since we need different initial values. You could of course register multiple properties with the syntax and then also set their actual icons on but now you need to add each icon in two places, so I’d consider it worse than the current expanded syntax. However, another direction we are exploring in the CSS WG is a shorthand form of that would allow more compact registration. For the icon above it would look like this: Currently, we have to repeat a lot of styles between the different pseudo-elements. If we want to also have a fallback class that doesn’t depend on style queries, we need to repeat them four times! With we can just do: And then we can use them all over the place: I published a package that puts together everything from this post, polish and warts included. It contains no icons, just the icon system. You’d just include it and then you can use and in your styles. It also includes the , , and classes. It does not wrap its contents in a layer to give you maximum choice, but I’d recommend importing it in a layer anyway. @nudeui/icons There’s a small chance I may have been the first to use a web font for UI icons , in 2010. I even worked as Product Lead at Font Awesome for a bit. ↩︎ I’m using “components” here in the general sense of a reusable UI element, not in the sense of a framework component or a custom element. E.g. a styled or an would qualify. ↩︎ keep syntax close to the minimum necessary to declare intent , and make simple things easy, complex things possible, and the transition from one to the other smooth (no usability cliffs) High signal-to-noise ratio: The intent to add or override an icon is basically “icon” plus the icon name, and possibly its location (start, end, marker, etc). Anything beyond that is boilerplate. Some boilerplate is unavoidable, but most -based solutions involve unacceptable amounts of boilerplate (which is why we end up abstracting that away). Simple things should be easy: We should be able to define default icons for certain cases without having to explicitly include them at every callsite. E.g. a should automatically get a trash icon, without needing to declare it in the markup in any way, shape, or form, unless we want to override it. The default icon color should follow the local text color (or designated icon color, if different) without any additional song and dance. Complex things should be possible: We should be able to easily override the default icon for a component, either permanently or as a result of various conditions (state changes, user interaction, etc.). Styling the icon should be as easy as applying a CSS property. The minimum is color, but the more extensive styling is possible, the better. No usability cliffs: Overridding an icon, temporarily or permanently, should still not require much more than the bits of information necessary to declare intent. declaring the name of the icon, and providing the SVG path data or a URL to an SVG file Any selector, including interaction pseudo-classes ( , , etc.), e.g. to communicate additional information about the action or adapt to a different background color Media queries ( , dark mode, high contrast, etc), e.g. use different icons in dark mode, add or remove them in print, etc. Container queries Writing mode, e.g. to use a different icon for RTL text Icons are first-class design tokens stored in properties that hold values (embedded or remote) Icons are inserted via pseudo-elements. The icon is applied as a mask to a square with equal to the icon color. The system uses general CSS custom properties like , , and for flexibility and reusability. Style queries + for conditional icon insertion based on these custom properties. Low-level properties: to prepend an icon to element contents (via ) to append an icon to element contents (via ) Optionally, additional properties can redirect to other pseudo-elements, e.g. for higher level abstraction that just means “add an icon to this component”: components 2 can redirect it to any of the lower-level properties on the element itself or a descendant depending on what makes sense for that component. E.g. may set on a but on An empty pseudo-element e.g. or is used to display the icon The pseudo-element is painted as a square with A CSS masks the square in the shape of the icon ( But, but, but …browser support?!? Fear not! Masks are actually Baseline Widely Available nowadays) A CSS property ( or ) is used to specify the icon to display, instead of an ad hoc one like . This means we can set any element’s icon from any place that accepts declaration, including via inline styles Customizable color and size : Rather than hardcoding and , read them from custom properties with those as fallbacks: and (same for ). Since they inherit, you can style every icon in a subtree by setting them on an ancestor, without ever touching the pseudo-element. The prefix keeps them from colliding with the icons themselves, which are also . Preserve in forced colors mode : to keep the mask fill in forced-colors mode. will still follow the forced text color. Don’t get in the way of pointer interactions : so that it doesn’t trap clicks it shouldn’t. Don’t shrink in flex containers : . An empty pseudo-element has a zero minimum size, so in a flex button it is the first thing to shrink when the label is long, and it can shrink all the way to zero. An icon’s size is a design decision, not something layout pressure should negotiate. Vertical centering : I add to center the icons and nudge them a tiny bit upwards (our eyes weigh the space above the icon more than the space below it, so if something is perfectly centered mathematically, it will look a bit low). With a customizable size, that becomes , so that the icon’s center stays put as it grows. Spacing from text : to add a bit of space between the icon and the content ( for ). Make sure to remove it for standalone icons. Accessibility : The pseudo-element has no text, so assistive technology ignores it entirely, which is exactly what we want for an icon next to a label. Icon-only controls still need a name, and we can let the icon provide one via alternative text for generated content : , so that is announced as “Delete”. on the control itself still works, of course. There won’t be hundreds of variables in dev tools for You can even override it temporarily with another icon for a specific context, and reset it wherever via What if could work, instead of ? What if could work, instead of ? (ignoring HTML restrictions around attribute names for a bit) There’s a small chance I may have been the first to use a web font for UI icons , in 2010. I even worked as Product Lead at Font Awesome for a bit. ↩︎ I’m using “components” here in the general sense of a reusable UI element, not in the sense of a framework component or a custom element. E.g. a styled or an would qualify. ↩︎

0 views
Unsung 1 months ago

“They take one look at the UI and abandon it.”

Hiding inside this page on “user-driven UI” by Brad Woods are two useful things. The first is the concept of “zone of proximal development.” The idea, as I understand it, is that possible tasks you face span a few categories: The space between these things is a zone. A good book or a teacher would help you navigate the zone, by giving you tasks hard enough that they will expand the zone, or even teach you how to expand it on your own – but not too hard so that you give up in failure and frustration. Woods argues that this doesn’t just apply to traditional classroom teaching, but also software, where the role of the teacher is taken by things like: The second thing was this quote by Anthony Hobday, who made a few appearances on this blog : I think this is brilliant and spot on. I always knew the creators of an app would have a problem of not seeing complexity creep in, but this made me consider that the app’s early users might also be biased the same way, and not exert much pressure. If you are familiar with an app, armed with your desire paths and motor memory, you have a lot of capacity to just ignore new menu items, new panels, and new complexity – provided it doesn’t get in your way. New AI option? Turn it off. New tab? Never click on it. New alternate way of doing things? Just continue with the old way. But as a new user, you don’t have that history, or that experience-backed confidence that a bunch of stuff can simply be ignored as it’s not crucial to everyday operation. Add to this the industry’s perverse incentives that often present new additions as the most important ones , and it’s much harder to make a sense of it all as a newcomer. And all the while, the creators and existing users might not see the problems you do. stuff you already know how to do, stuff you can learn to do on your own, stuff you can learn to do with assistance (e.g. from a teacher), stuff you simply cannot do or imagine doing. onboarding walkthroughs, progressive disclosure, help menus. Simple product is released Lots of people use it every day More features are added It’s now complicated But most people learned the basics when it was simple, so they don’t notice that it got complicated.

0 views
Chris Coyier 1 months ago

Justice for CSS

Fun seeing CSS be a topic in WIRED . Pete Millspaugh shouting out some greats: One programmer recently re-created Doom in CSS . Others have used it to build holographic Pokémon cards and 3D-rendering engines . Cassidy Williams, who competed in this year’s inaugural March MadCSS tournament , built an experimental database-query engine entirely in CSS. I mean, hell yeah. Allow me to just… And I think Adam did it first!

0 views
Ahmad Alfy 1 months ago

Iframes that finally fit their content

Chrome 154 lets an iframe grow to the height of its content with one line of CSS without having to measure, without messages, and without resize scripts. But the page inside the iframe has to agree to it. That catch is the most interesting part of this feature, so this article spends some time on it. I have built many checkout pages that use a payment provider’s iframe. The goal was always to have the card form feel like part of the page. The user should not notice that it comes from another website. The iframe never helped with that. It has a fixed height. Make it too tall and you get an empty gap under the form. Make it too short and you get a scrollbar inside the page’s scrollbar. On mobile, that second scrollbar is the worst thing you can show someone who is about to pay. So I kept increasing the height, testing on different phones, and increasing it again. This is a small problem. It should have a small solution. For years it did not. The parent page cannot look inside a cross-origin iframe. It does not know how tall the content is. So the only way was to make both pages talk to each other with JavaScript. Inside the iframe, you measure the content and send the height to the parent: In the parent page, you listen, check who sent the message, and set the height: This looks short, but it hides a lot of problems: That last point did not go away with the new feature. It just moved into the browser. In the parent page, you add one CSS property to the iframe: Inside the iframe, the page opts in with a meta tag in its . It also says which websites are allowed to size it: That is all you need for content that does not change after it loads. The browser measures the content and sizes the iframe. No messages, no listeners, no origin checks in your code. The meta tag must be in the HTML from the start. Adding it later with JavaScript does not work. If the content changes later (an error message appears, a section expands, more comments load), the page inside the iframe asks the browser to measure again: So JavaScript does not disappear completely. The embedded page still calls one function when its content changes. But the hard parts are gone. The browser does all of that now. also accepts , and . For most pages, is the one you want. You can still combine it with limits like . This is the use case I care about most, and it is also the one that depends most on someone else. A payment form changes height all the time. An error appears under the card number. The user switches from card to wallet. A saved card list shows up. With , all of this could look smooth inside your checkout. But you cannot turn it on from your side alone. You control the CSS on your checkout page. The payment provider controls the page inside the iframe. Only they can add the meta tag, list the merchant sites that are allowed, and call when their form changes. So for payments, the real question is not “does Chrome support this?” It is “does my payment provider support this?” Today, most providers either ship their own postMessage script or do nothing. If you work with one, ask them. If you build one, this is a cheap win for every merchant using you. Comment sections, contact forms, newsletter sign-ups and booking widgets all have the same problem. Their height depends on the content: the number of comments, the number of fields, the validation errors. These services already control their embedded page, so adding the meta tag is easy for them. The list fits well here, because they already know which customer sites embed them. I have this exact problem on this website. My contact form is a Wufoo form inside an iframe, and I set its height by hand until it looked right. Each step of a form has a different height. Step one has two fields. Step three has ten. Today, you either reserve space for the tallest step or let the iframe scroll. With this feature, the form calls after each step and the iframe follows. This one does not need any third party. Many apps show HTML email previews, rich text previews, or code demos inside a sandboxed iframe using . Here you write the embedded HTML yourself, so you can add the meta tag directly. This is probably the easiest place to start using the feature today. Browser support. This is Chromium-only for now. Firefox and Safari do not support it yet. Keep a fixed height as the default and switch to content sizing only where it works: Inside the iframe, check before calling the new function. Your old postMessage code can stay as a fallback until support grows: Layout shift. The iframe loads after your page, then grows. Anything below it moves down. If the iframe is in the first screen, this can hurt your Core Web Vitals. A sensible reduces the jump. Do not use without a reason. Letting any site read your page’s height can leak information. For example, a page that is taller when the user is logged in tells the parent something about that user. List only the sites that need it. This works together with the CSP rule, which controls who can embed you at all. For years, a simple layout need, “make this box as tall as its content”, required two scripts on two websites that had to agree on a message format. Now it is one CSS property, one meta tag, and one function call when things change. The browser side is ready in Chrome. The rest depends on the people who build the pages we embed. If you run a payment gateway, a comments service, or any widget that lives inside an iframe, add the meta tag. Your users’ checkouts and pages will feel like they were built as one piece. I will come back to payment providers in our region specifically in a follow-up post. Width changes height. On a small screen, text wraps more and the content gets taller. Every resize or phone rotation needs a new measurement. Content arrives late. Fonts, images and error messages load after the first measurement. The height is wrong until someone measures again. Dynamic content. If the page inside the iframe shows or hides elements after the initial load, the height changes and needs to be measured again. More than one iframe. If the page has several, you need IDs in every message to know which one to resize. Both sides must cooperate. If the third party does not send its height, there is nothing you can do. You go back to guessing a fixed height. Responsive iframes in Chrome 154 , Chrome for Developers New in Chrome 154 , Chrome for Developers

0 views
Unsung 1 months ago

Deeper dive: Keyboard differences between Windows and Macs

Over the years, I learned about many gotchas and strange differences between keyboard handling on Mac and Windows – pertinent especially to web apps, which use the same codebase to cater to both. I thought it might be helpful to someone if I compile them all in one place. This post is meant to be a reference, and there aren’t any cute or riveting stories hiding inside – if this seems boring to you, feel free to skip to the next one! What Windows calls Backspace, Mac calls Delete. What Windows calls Delete, Macs call Forward Delete. (This means saying “Delete” without specifying the platform might actually be confusing.) What Windows calls ⏎ Enter, Mac calls ⏎ Return. However, Macs also have an ⌤ Enter, although only on a numeric keypad (previously, it was even there on laptops !). On keyboards without the physical Enter key, you can simulate it via Fn+Return. In most Mac software, Enter and Return do the same thing. There are a few exceptions – for example, Photoshop enters a new line on Return but commits on Enter, and some classic pro apps like Cubase or Pro Tools do different things, too – but it seems to be a dying tradition. (If you are curious about the history of Return and Enter, I wrote about it once .) Windows customarily calls the secondary key Numpad Enter. I don’t believe Fn+Enter works to simulate it. Generally, third-party keyboards use Windows verbiage – so, Backspace and Enter. If a keyboard offers Mac conventions at all, they usually only extend to modifier keys. ⌃ Control on Windows is the equivalent to ⌘ Command on a Mac. (Paste, for example, is ⌃V on Windows and ⌘V on a Mac.) But, confusingly, Apple devices still have a Control key, too. This was originally meant for terminal applications, but these days many GUI apps use it as an extra modifier key. This means that for apps, Windows devices offer Ctrl, Alt, and Shift – and Macs offer ⌘ Command, ⌥ Option, ⌃ Control, and ⇧ Shift. That’s one more modifier key, and thus more space to breathe. (We’re not counting the Windows key or the 🌐 Globe/Fn key since those are technically reserved by the operating system.) Some keyboards offer extra key caps you can swap to match the platform, for example: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/1.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/1.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/2.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/2.1600w.avif" type="image/avif"> Others cover all the bases on fixed key caps, in an awkward way: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/3.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/3.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/4.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/4.1600w.avif" type="image/avif"> Many stick with Windows-only legends. Apple devices rely more on symbols on their keys and in their menus, although they don’t do so consistently. Here are all of them: Actually, I lied about the last four. On modern Apple keyboards, they are: Reusing the regular arrows for Page Up and Down is one of a few perplexing decisions from Apple’s keyboard designers. The arrow key symbols look like this – ◀▶▲▼ – but only on Apple keyboards. Here is an older and a newer Apple keyboard showing what happened: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/5.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/5.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/6.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/6.1600w.avif" type="image/avif"> (Luckily, the confusing dual arrow key situation only happens on less popular, full-size keyboards.) Historically, Apple keyboards used symbols more on non-US keyboards, but starting with the 2026 models, they unified when they show symbols and when they show symbols and legends, across all keyboards. (The only key with just a text legend is Esc, making the appearance of ⎋ in menus extra puzzling.) Windows keyboards typically use words – this is why in tight quarters you sometimes see shortenings like Ctrl, Bkspc, PrtSc, Del, PgUp, Win, and so on. (I don’t think Apple ever abbreviates their legends with the exception of Esc for Escape.) In some countries, the legends are translated – as an example, in Germany, Ctrl sometimes appears as Strg. The symbols that crossed over to Windows side are: I have not seen any other popular symbols on the Windows side of the aisle, and I am not even sure if the above would be widely understood. But here’s an example: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/7.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/7.1600w.avif" type="image/avif"> ( I wrote a bit more about Mac symbols before , and also about the rare Canadian symbols .) In menus and other places, Windows joins the key combinations/​shortcuts with a plus, but Apple just glues them together: Here is the same Chrome menu on Windows and on macOS: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/8.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/8.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/9.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/9.1600w.avif" type="image/avif"> (In other words, you’d never say “⌃V is Paste on Windows” like I did above.) Both Windows and Macs have function keys. On Windows, traditionally those were claimed by the operating system or the apps as shortcuts. Here are some examples of well-known function key assignments: On Macs, traditionally the apps didn’t reach for function keys, as those were reserved solely for the users to do stuff with. (However, some combination of ⌃ and function keys are used by the operating system for accessibility options, and I occasionally see apps use function keys these days.) Windows keyboards top off at F12, but some Mac keyboards reuse the three special PC keys, and even take over the unnecessary Num Lock/​Caps Lock/​Scroll Lock island, and end up going up to F19: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/10.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/10.1600w.avif" type="image/avif"> Access to extra characters In text fields, Apple has a system where pressing ⌥ with printing keys outputs more characters, for example ⌥Q outputs œ, and ⌥7 outputs a ¶ pilcrow. Additionally, ⇧ works in this context, so for example ⌥⇧Q outputs Œ, and ⌥⇧7 outputs a ‡ double dagger. = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/11.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/11.1600w.avif" type="image/avif"> Note that not only letters, but basically all printing keys have secret ⌥ and ⌥⇧ assignments. Also, ⌥ assignments vary per location! The above was U.S. English, here’s Polish with a lot of differences: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/12.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/12.1600w.avif" type="image/avif"> This means it’s best to avoid ⌥-based shortcuts in text fields, since they might conflict with some important character. By the way, while the above two are just mock-ups, on some physical keyboards (here: British English), some of the important ⌥ invocations are actually printed on keys: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/13.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/13.1600w.avif" type="image/avif"> Windows doesn’t have the above feature. However, Windows has an alternative feature where typing Alt+numpad keys allows to enter any character by its code. (For example, Alt+0128 outputs €. Num Lock has to be enabled. I don’t think it’s possible to do it without a numeric keypad present.) Mac has a version of this feature, but it requires adding Unicode Hex Input keyboard and switching to it beforehand. Then, pressing ⌥20AC outputs €. While Mac modifier keys are completely symmetrical, Windows makes an exception for Alt. On many non-US keyboards, right Alt is also known as AltGr , and does something similar to ⌥ on a Mac: it outputs letters when pressed in combination with printing keys. For example, on Polish keyboards AltGr+A = ą, AltGr+C = ć, AltGr+Shift+A = Ą, and so on with 15 more combinations. Many other keyboards do similar things. The way it differs from ⌥ on a Mac is that these are usually reserved for core letters and punctuation necessary for each language, rather than the typographical smorgasbord that Apple provides. For legacy reasons, and also for keyboards that do not have a physical AltGr key, you can also invoke all these using Ctrl+Alt combinations instead (so, Ctrl+Alt+A = ą). This means that just as you have to be careful about ⌥-based shortcuts in text fields on a Mac, so you should be of Ctrl+Alt-based shortcuts on Windows . Just like on Macs, on some keyboards, selected AltGr options will be printed in the corners or fronts of keys: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/14.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/14.1600w.avif" type="image/avif"> Text fields Text fields in Mac OS apps and web browsers/​websites use some of the standard Unix/​Linux shortcuts based on the ⌃ Control key: You can combine many of the above with holding ⇧ to extend the selection. A small group of vocal users love these. Windows still supports Ctrl+Insert for copy and Shift+Insert for paste. I am not sure if those are being used. On a Mac, in simple input fields, ↑ and ↓ jumps to the beginning and end (same as ⌘←→). This often conflicts with command line history, autocomplete pop-ups, and so on. Windows doesn’t have this convention, and Home and End serve this purpose instead. Macs support the iPhone-inspired convention of holding a key to show related accented characters, instead of triggering auto-repeat. Windows doesn’t have this feature. = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/15.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/15.1600w.avif" type="image/avif"> Differing shortcut conventions worth knowing about On a Mac, redo is typically ⌘⇧Z. On Windows, it’s typically Ctrl+Y. On a Mac, refresh (in browsers, etc.) is typically ⌘R. On Windows, it’s typically F5, although some browsers now support Ctrl+R, too, presumably since function keys are harder to access than they used to be. Windows’s eponymous ⊞ Windows key is reserved solely for the use of the operating system, and so is Mac’s 🌐 Fn/​Globe key. (Although I am not 100% sure of that as I found one place you can create 🌐 shortcuts as a user – I’m just not certain if it’s intentional.) However, each platform also has a lot of shortcut combinations that are effectively unavailable, for example ⌘⇥ and ⌘M on a Mac, or Alt+Tab and Ctrl+Shift+Escape on Windows. These official lists can help: If you’re a web app, you will compete for shortcuts with the operating system (like any app would), but also with the browser itself. You can typically take over shortcuts like ⌘S or ⌘P, but depending on the browser or the platform, some might be sacred and unavailable. No Mac browser will allow a website to claim ⌘Q, ⌘W, or ⌘T. Safari won’t allow a web app to override ⌘R. Arc browser won’t allow to override ⌘⇧C. (This is not a complete list.) Tabbing and Shift tabbing is customarily used to jump between UI elements, but it behaves slightly differently in native apps. On Windows, tabbing jumps through all elements: On Mac, Tab jumps only to elements that require keyboard to operate (such as input fields). You can toggle a System Settings preference and ask macOS to mimic Windows behaviour – see the last toggle below – but it’s not supported well everywhere. = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/18.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/18.1600w.avif" type="image/avif"> PgUp and PgDn work differently: Similarly, Home and End work differently: On both platforms, Fn+↑↓ does PgUp/​PgDn, and Fn+←→ does Home/End. (Do you see how confusing it is to say that given that ↑↓ already mean PgUp/Dn on a Mac?) Windows has a tradition of enabling access to menus and visible controls by pressing Alt and letter keys. This has evolved over time and is not as consistent as it used to be, but it might be worth knowing about. On a 100-plus-key keyboard, Windows might have: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/19.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/19.1600w.avif" type="image/avif"> Macs have: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/20.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/20.1600w.avif" type="image/avif"> Macs never had arrow keys on a numeric keypad nor a Num Lock key to enable it. (I’m breaking my promise! Here’s a fun bug story about Num Lock .) In a strange twist of fate, it’s not only third-party keyboards that favor Windows legends. Some of Apple’s keyboards in between 1980s and 2000s showed PC legends, too! (This was to court PC compatibility of then-beleaguered Macs.) Here’s the classic Apple Extended Keyboard, showing legends for Insert, Delete (naming it Del to avoid confusion with its own), Print Screen, Scroll Lock, Pause, Num Lock, and Alt: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/21.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/deeper-dive-keyboard-differences-between-windows-and-macs/21.1600w.avif" type="image/avif"> (Did I miss anything or make a mistake? Let me know !) ⎋ Esc (not printed on keyboards, for some reason) ⌦ Forward Delete ≣ Contextual Menu (only on full-size keyboards) ⇞ Page Up (only on full-size keyboards) ⇟ Page Down (only on full-size keyboards) ↖ Home (only on full-size keyboards) ↘ End (only on full-size keyboards) ↓ Page Down ⇧ for Shift ⇪ or 🔒 or a similar symbol for Caps Lock (on non-US keyboards) ⏎ for Enter – note the same arrow as Mac’s ⏎ Return ← for Backspace – note a different arrow than Mac’s ⌫ Delete ⇥ for Tab (you can also sometimes see ⭾, which is a symbol representing Tab and Reverse Tab together; Reverse Tab used to be a separate key on some 1970s terminals) ⊞ for Windows key – the style of the logo will be different depending on the age of the keyboard, roughly matching the Windows logo at the time; some keyboards also use a more abstract shape, or call the key Start or System instead of Windows ≣ for contextual menu key (a.k.a. Application Key) – just as Apple added that key on its large keyboards, Microsoft started removing it in favor of emoji key , Office key , and then Copilot key ⌃ for Control (especially in nerdy contexts) Windows: Shift+A, Ctrl+Shift+G, Ctrl+F11, Alt+Enter Mac: ⇧A, ⌃⇧G, ⌘F11, ⌥⏎ Alt+F4 – close the app F11 – maximize window F12 – dev tools in browsers ⌃A – move to the beginning of the line ⌃E – move to the end of the line ⌃F – move to the right, or forwards (hold ⌥ to jump through words) ⌃B – move to the left, or backwards (hold ⌥ to jump through words) ⌃N – move down or to the next command ⌃P – move up or to the previous command ⌃L – scroll the window so that the text cursor is in the vertical middle ⌃H – delete (backspace) ⌃D – forward delete ⌃K – delete (kill) to the end of the line ⌃T – swap (transpose) the adjacent characters ⌃O – insert new line, but (contrary to Return) do not move the cursor there Mac keyboard shortcuts Keyboard shortcuts in Windows On Windows, they move the text cursor a screen up or down. On a Mac, they scroll the view up and down, but they do not move the text cursor if it’s present (so, they are more an equivalent of clicking on the scrollbar chute). On Windows, they scroll the contents (and move the cursor if present) to the top or the bottom of a view, or move the cursor to the beginning or the end of an input field. On a Mac, in views they scroll to the beginning or end without moving the cursor. In input fields, Home/End do nothing, but you can use ⌘←→ to accomplish the same. Insert – still used in some contexts for overtyping Print Screen – today taken over by screenshotting Num Lock and Scroll Lock Pause/​Break Help – rarely used, and now abandoned in favor of… ≣ Contextual Menu – shows the same menu as right click would ⌧ Clear – a deterministic backspace , these days seldomly different than the actual Delete key

0 views
Andre Garzia 1 months ago

BlogCat got a new Youtube subscriptions page

Made a really nice feature today after a friend requested it, added a new page to BlogCat that will list all the Youtube Channels you subscribed as a thumbnail grid, much like a non-algorithmic version of their home page. That means that you can use BlogCat to subscribe to channels, use the new page to view latest videos from the channels you subscribed, and use an alternative front-end to view the said videos such as invidious or nadeko. By combining these features, one doesn’t even need to have a Youtube account. It is quite neat and it skips algorithms and so on.

0 views
David Bushell 1 months ago

A sustainable web career, for when all this blows over

For better or worse the web industry is going through a bit of a phase. The reasons are largely irrational. People still need the web, nothing has changed there. Regardless, the financials of this business are a struggle. Longterm career prospects are looking dicey. Because I openly reject the driving force intent on destroying my profession, and ruffle a few feathers doing so, I often get asked privately for advice from like-minded peers. I can only offer an uninspired but sensible reply: don’t quit a paying job without a fallback. Go to the Winchester, have a nice cold pint, and wait for all of this to blow over. I’m confident the situation will improve. Before it does, what can we focus on to accelerate past the intellectual slump, and better position ourselves once things calm down? For a sustainable web career, where better to look than critical skills in desperately short supply? My focus is on front-end development, but these areas of knowledge are relevant to anyone in the business of making websites. Accessibility has always been a foundation of web development but it’s never been more critical for everyone to champion it. Understand why accessibility is for everyone. Learn how to talk about accessibility in respect to real needs and practical implementation. Accessibility has unfortunately become a virtue signal for certain tech groups. (I’m told LinkedIn is rife with misinformation.) Accessibility is not a feature that can be tacked on to a website like garnish. Accessibility issues can’t be fixed with an automated process at the end. Web professionals must be able to counter this mindset by respecting accessibility in all decisions from day one. Learn and adopt the guidelines as your baseline. Speak to and test with real people. Defer to specialists who are eager for you to understand the realities. CSS is the most vibrant and evolving of the front-end standards. To architecture a good stylesheet takes deep understanding of the language features. Newer features like cascade layers and selectors that reduce specificity make this much easier. CSS has always been equipped to handle well organised styles, but developers who refuse to learn and respect the language have sought to push complexity elsewhere, using simplified abstractions or “CSS-in-JS” solutions. These are inherently limiting, lead to poor performance, and don’t actually solve the problems they claim. CSS should be hard and learning it will give you the ability to express creativity beyond cookie cutter web design. CSS skills will be highly desirable as more websites wish to stand out against the convergence of a generated aesthetic. Communication is a “soft skill” in short supply (for obvious reasons). It’s a great skill if you wish to stand out as an expert, or simply be heard amongst the noise. Learn brevity and focus on important points. Don’t be afraid to ask questions. Address concerns tactfully and early before they escalate. Don’t point fingers, but “cover your ass” — everyone on a project should be working towards the same goal, but some may be misguided in their approach. Remain positive and don’t meet negativity head-on. If you can communicate well you’ll be highly respected in your role. You probably weren’t expecting this one, but here we are. The luxury of not “getting political” has abated. Far-right political ideology is on the rise and dormant hatred is waking up in tech. The epicentre of fash-tech is Musk’s “X” with people like David Heinemeier Hansson spewing racism and abusing authority in communities to push an agenda, and Guillermo Rauch taking a selfie with a war criminal . Large tech giants like Digital Ocean are funding this power grab . Be wary of those denying this threat. If you want to avoid being pushed away from this industry, recognise and reject fascism before it comes for you. Don’t stay silent. I’ve covered topics that’ll see us well for the future, but what should we forget? Facebook’s experiment turned cargo cult is a legacy framework that still lingers, but there’s no reason to learn it today. React has entrenched itself as a lingua franca of code extruders. React code is generated faster than any human can possibly read it. Suffice it to say that despite stale job vacancies still demanding experience, React is not worth investing time. The days of high-paying React development are numbered. GitHub is now a liability. For private repositories use self-hosted git forges. I’d recommend Forgejo . One of the many Tailscale-like services is an easy way to gate remote access. Don’t make stuff public for the dead internet to attack! For CI/CD go local too, or use independent services not tied to tech giants. Take the time to learn basic commands. A little technical and infrastructure knowledge goes a long way. These people are handsome, charismatic, highly personable. I’m talking about: developer relations, youtubers, start-up founders, etc. When the tech industry met us halfway, influencers were entertaining and a good chinwag at after parties. Now the game has changed and we should not allow false narratives to dominate and dictate a closed-web future. Normal people still use the web. Incredibly few can afford to pay for the novelties that influencers peddle. Their attention economy is no longer our concern. So that’s my focus for a sustainable web career, when all this blows over. Remember that above all else: the web is a human creation for human needs. Those needs are not going anywhere. Drop the dead weight accumulated in times of prosperity. Go back to basics and position yourself well for when professional demand returns. Thanks for reading! Follow me on Mastodon and Bluesky . Subscribe to my Blog and Notes or Combined feeds.

0 views
Unsung 1 months ago

The left hand should know what the right hand is doing

One day, as I was reading an essay on Medium, I saw an automatically inserted subscribe block: = 3x)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/1-framed.1600w.avif" type="image/avif"> But as I was exactly on top of it, a new thing popped in my view, an interruption on top of interruption, both saying the exact same thing: = 3x)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/2-framed.1600w.avif" type="image/avif"> 2. For a while now, whenever I try to follow a link to a site that no longer exists, Chrome shows a strange “This site doesn’t support a secure connection” flyout, just before hiding it itself, and then following it by a generic error page: This feels truly eerie: either a bug where the flyout gets triggered too soon without having all the information, or the flyout is trying to warn you about Chrome’s very own internal page. Just this week, after already having been in Taiwan for five days, and after having used Apple Pay to pay for public many times on each of these days, Apple Maps helpfully told me that I can… use Apple Pay to pay for public transit: = 3x)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/5-framed.1600w.avif" type="image/avif"> 4. Some months ago, after finalizing my car reservation and moving my attention elsewhere, an automatic “keep the session warm or lose it” window appeared, suggesting my reservation might actually “expire”: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/6.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/6.1600w.avif" type="image/avif"> 5. Downloading is possible on YouTube Premium and actually helpful, allowing you to load up some videos ahead of a long flight. There even exists a section where it suggests some things to download. However, download suggestions include member-only videos, and whenever you try to grab one of those, you get this result – a pretty poor “Video wasn’t downloaded” message: When I recently opened a dispute on PayPal for a keyboard I never received, at the end of the process, I saw these three screens in succession: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/8.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/8.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/9.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/9.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/10.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/the-left-hand-should-know-what-the-right-hand-is-doing/10.1600w.avif" type="image/avif"> In effect the screens said, in order: we closed the case and decided in your favour, you haven’t finished filing the case, the case is open and we’ll update you. I feel uneasy bundling all these “the left hand doesn’t know what the right hand is doing” examples, because they’re not all the same. Examples #1–3 from Medium, Chrome, and Apple Maps are frustrating and somewhat embarrassing, outbursts from badly-behaving software that doesn’t know that it’s not okay to throw pop-ups at the screen whenever you feel like it. I particularly dislike announcements of features that the user has already been using since they feel condescending to me, but I don’t want to assume it’ll be the same for everyone else. Examples #4–6, however, are more insidious. Whether they happen because of plain old carelessness, or lack of imagination, or Conway’s Law – different teams not talking to each other – they can lead to people jumping to wrong conclusions or building entirely wrong mental models. Is my reservation truly done, or have I not actually finalized it? Is it possible to download member-only content, except I need to do something special to set it up? What is the status of my PayPal dispute? The answers in this case: yes + no + the first screen was the one telling the truth. But each answer required extra effort for me to figure out, and that effort would be avoided if only someone tested the flows better.

0 views
Unsung 1 months ago

“I didn’t know about this shortcut until recently.”

On his fascinating and long-running Windows dev blog The Old New Thing, Raymond Chen writes about the story of scrollbar right-click menus : Windows 2000 added a right-click menu to the scroll bar. This menu gave you four options that matched existing mouse operations, two operations that matched existing keyboard operations, and a new operation. The interesting new one is “Scroll Here”: You can right-click directly on the spot you want to scroll to, and then pick “Scroll Here”. This is much more convenient if you want to scroll a long distance, since you don’t have to grab the scroll bar thumb and then drag it all the way to where you want to go. You can just focus on where you want to go and not where you are coming from. I used this context menu a lot when I needed to jump long distances. […] An even-more-hidden shortcut was added at the same time: Holding Shift while clicking on the scroll bar jumps the thumb directly to the spot where you clicked. ¶ I didn’t know about this shortcut until recently. The menu looked like this, for what it’s worth: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/1.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/1.1600w.avif" type="image/avif"> (The equivalent function also exists on a Mac, except there it’s hiding under ⌥, and not ⇧.) Chen covers a few interesting things in his post, including the challenge of new frameworks losing hard-won UI affordances of their predecessors. But what caught my attention was something else I’ve thought about occasionally: why are menus so averse to mousing shortcuts? For example, you can imagine a browser link menu showing a few simple click gestures: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/2.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/2.1600w.avif" type="image/avif"> Or, this tapback details shortcut in the right click menu in Messages: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/3.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/3.1600w.avif" type="image/avif"> Or this for masking in Keynote when you right click an object: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/4.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/4.1600w.avif" type="image/avif"> You could even imagine announcing simple gestures, like ⌥+dragging to duplicate, or ⌘+dragging for a quick modeless move: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/5.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/5.1600w.avif" type="image/avif"> = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/6.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/6.1600w.avif" type="image/avif"> Item menus would also work, not just right click menus: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/7.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/7.1600w.avif" type="image/avif"> And you could even imagine integration with the hold-a-modifier-key interaction : I am curious why we’ve never gone in that. I haven’t seen anything like this, and I can imagine some counterarguments: This last one I feel passionate about, and this is where we can go back to where we started. If Chen, having written about Windows in detail for decades, didn’t know about this keyboard shortcut, what chance do we have? I believe onboarding should be universal and ongoing. There is always a new thing to learn somewhere regardless of one’s proficiency; you don’t ascend some sort of a Mountain Of Poweruserness, get a certificate, and proclaim your learning complete. Plus, proficiency is usually localized: no one is fully an expert in every aspect of even one app, let alone all of them. If Chen were to see something like this back in the day, it could have helped him – and I imagine others, too: = 2x) and (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/9.2096w.avif" type="image/avif"> = 3x) or (width >= 700px)" srcset="https://unsung.aresluna.org/_media/i-didnt-know-about-this-shortcut-until-recently/9.1600w.avif" type="image/avif"> I’m curious if you have seen any app attempting anything like it. If you did, please reach out. “The symbols might be confusing.” I am not sure. Here, I used a few temporary SF Symbols that have some challenges (the double click in particular feels clunky), but I could imagine a talented icon designer taking it all for a spin, and arriving at a clean and elegant visual vocabulary. “It’s too specific. It will only work for right click/​context menus.” Yeah, I see this challenge. The mouse gestures and shortcuts require the mouse cursor to be at a specific position – the noun to the menu item’s verb – which only context menus provide. When you look at one of the menu commands I invented – Move Icon – there is a lingering question: what would that command do if I selected it? But on the other hand, I also see this visual gestural vocabulary growing to be useful in other places: hint text, tooltips, documentation. “Power users don’t need onboarding.”

0 views