Gnu extension
A Firefox extension that keeps Terry Pratchett alive through a website-to-website digital "clacks" analogue that is just beautiful in its concept 😢
theAdhocracy
A Firefox extension that keeps Terry Pratchett alive through a website-to-website digital "clacks" analogue that is just beautiful in its concept 😢
A fascinating Twitter thread detailing the 2020 US elections in the style that Western journalists report on African political stories. Really interesting to see how much the language used changes the picture that the text conveys, even with the occasional humorous bit thrown in; also slightly terrifying to see just how screwed up the US is when viewed through this lens. Far too long to save the entire thing here, but I wanted to grab a few (dozen) of the better tweets. ThreadReader link for posterity as well.
Polls are set to open in 48 hours across the US as the authoritarian regime of Donald Trump attempts to consolidate its hold over the troubled, oil-rich, nuclear-armed, north American nation. Analysts are sceptical the election will end months of political violence.
Viral video of barricades being erected around the presidential palace -known locally as the White House- in the US capital, Washington DC, has raised tensions as rumors spread that incumbent despot, Donald Trump, will not give up power if he loses tomorrow's election.
Report by African experts on US politics calls judicial independence the "weak link" in the covid-blighted nation's democracy, warning of the potential for violence if judges hand-picked by the aging autocrat, Donald Trump, determine the winner of tomorrow's election.
Aid agencies launch "Adopt-An-American" campaign which lets people virtually adopt American kids for a small donation. A website will allow donors to track children's progress, visit with US families and, as a bonus, tour US homes for an authentic American experience.
👆 This has always felt like an immensly dehumanising approach but it's still super weird to see it in this context.
Analysts warn that the fear and desperation created by the deepening US humanitarian crisis, coupled with one of the most tribalized election campaigns in its history, may lift the lid off dangerous ancient ethnic hatreds and grievances that have festered for centuries.
Tribal violence rears its ugly head in strife-torn US as clashes break out between supporters of populist dictator Donald Trump and those of opposition leader, Joe Biden, waving Black Lives Matter flags outside the fortified Green Zone in the capital, Washington DC.
Analysts warn that armed rightwing paramilitary groups, which largely support the autocrat, Donald Trump, may take advantage of his declaration of victory and allegations of vote rigging to expand their activities in the US, one of the world's top 10 banana exporters.
I get the joke here about banana republics, but also the off-hand "factoid about the country we all care about for a week or so" is so on point it's brilliant 😂
Despised by many, the Trumps have monopolized government appointments, corruptly using them to build a global business empire and enrich their friends and associates, many of whom are known criminals, while ignoring the deaths of hundreds of thousands of Americans.
In chilling scenes reminiscent of the infamous 2011 "rivers of blood" speech by Saif al-Islam Gaddafi, son of then embattled Libyan dictator, Muammar Gaddafi, Donald Trump Jr, son of embattled US dictator, Donald Trump, has vowed "total war" to keep his father in power.
Having systematically demolished public confidence in the independence and integrity of all other arms of government, US dictator Donald Trump now sets his sights on the country's courts where he will challenge his electoral loss before his hand-picked judges.
The former UK colony, with breathtaking natural beauty and richly endowed with natural resources and friendly people, but also riven by deep ethnic divisions, has suffered a series of political, humanitarian and economic crises which have killed nearly 250,000 people.
While many African observers are aghast at the conduct of the US presidential election, others note that by American standards, it was a relatively good election, in a country where gerrymandering and voter suppression are not considered reasons to invalidate elections.
👏👏👏
I "missed" the meetup (it was 2am local time 😂) but glad to catch up, a really nice introduction to 11ty/Eleventy as a build tool. The more I hear about the flexibility that 11ty gives you in terms of templating and extensibility (and the more I get fed up with JS package size coming out of some of my current solutions) the more I want to dive in.
A very clever (and well explained) method for helping users complete forms. Particularly with modern pop-up forms, I'd say at least once a month I'm part way through typing something and accidentally shift my mouse somewhere that causes the form to close, losing everything I had written 😡 Jeremy's trick of storing the current form (well, textarea
, but it should be easy to expand) content in localStorage
is a great enhancement that would solve those frustrations. Here's the gist (see what I need 😄):
eventListener
to track when a user starts typing into a form/textarea;eventListener
to track the browser's unload event using beforeUnload
(Jeremy explains why that method well);localStorage
against a key
for the page URL/slug (you can use JSON to store multiple values in one key/value pair);eventListener
, clear the localStorage
key;localStorage
on page load for a key that matches the current URL and, if found, parse the JSON and populate the form.Et voila! Neat 👍
We like what we choose. Not the other way around. [...] If you had grown up somewhere else or some time else, there’s little doubt that you’d prefer something else. The things we think we need are simply the things we’re used to.
Man, what a fascinating thread on the bizarre reasons that browsers will parse words into colours. To sum it up:
color: red
to work with backwards compatibility in CSS;A humorous but useful tool that strips out all the mess that things like Styled Components and React make out of HTML and lets you properly view the source of a page. (and yeah, I use those same tools and processes, and yeah it still irks me that I'm part of the problem😁)
💩 ➡ 🥇
Whilst accessibility means you largely want to steer clear of autofocus on web forms, sometimes it can be beneficial. In HTML, we can now reach for the handy autofocus
attribute, but as I recently learnt that doesn't always do what you expect when dealing with a shadow DOM (in this case, React's equivalent). Daniel's article was by far the best at both describing the issue and offering some solutions, though even here it only works most of the time (Firefox does something which I feel is logical but unfortunately not consistent with either the W3C spec or what most people would want to happen).
So here are the (confusingly more than three) techniques:
autofocus
attribute (😉) for input
elements that are always present (elements loaded later have some weird cross-browser differences);focus()
DOM API that allows you to select an element using JavaScript and force focus on it i.e. element.focus()
, which works almost always but can be tricky to target correctly (and reliant on client-side JavaScript);focus()
is blur()
, and both can be handily combo'd with select()
for some even better UX!autoFocus
prop, which effectively mimics the HTML autofocus
attribute but only triggers it when a component mounts, helping with the cross-browser issues but meaning that if you mount before visually showing an element it can steal focus incorrectly;useRef
hook, which is effectively just using the focus()
API within React's own life cycle;useCallback
hook, which does the same thing as useRef
only with more control. This appears to be the most universal option in React right now.I ran into a bug recently where some SVGs on a website were seemingly ignoring a fill
request. A quick check in dev tools showed that the CSS was being applied so... what gives? Turns out Firefox has implemented an overly literal interpretation of part of the (I believe) SVG spec, causing it to add additional child <svg> elements in certain circumstances (which are hidden from dev tools by virtue of reasons). Matt does a better job of explaining the why, but the fix is to do something like this:
.class-name, .class-name use > svg { fill: #FFFFFF; }
Or, based on our existing patches when I looked that already including overrides for g > svg
and some other variations, perhaps simply:
.class-name, svg.class-name * { fill: #FFFFFF; }
A super useful recap of the main ways that CSS calculates percentage for element layout, each with a brilliant slider-based demo. The tl;dr:
width
and height
elements are based on the parent's dimensions;top
and right
;margin
and padding
attributes inherit from the parent, but only use the width value (even for things like margin-top
);transform
property uses the element's dimensions.Darrell is one of those authors who really considers the world-building side of their work, so I've long found their blog fascinating. Recently, they've released a series of posts on the background of individual "kindreds" from their world of Saynim (kindred here replacing the problematic use of "race" across a lot of fantasy works), each of which is worth reading, but combined form a series of ideas, mythological tidbits, and even anthropological theories that I wanted to capture. I'll create a list of relevant links at the end. I've skipped taking notes on humans, though I do really like Darrell's take on them as a minority underclass renowned for "outside the box" thinking.
It feels good to me, having two sets of rows where the individual rows accordion open to accept content when needed, and collapse to zero height when not, with a “blank” row in between the sets that pushes them apart.
When Eric first tweeted about the new design on his site, I thought something a bit unusual was going on with the CSS layout. I actually dove straight into the source that day and learnt a little about using negative row/column indices that I'd not really considered before. Still, I missed this clever trick he's using. By having a set of rows at the top and bottom of the page that may or may not contain content, he creates an "accordion" like layout. If content exists, the row expands to give it space; if it doesn't, the row collapses to nothing. The trick is having one row in-between those groups with a height of 1fr
, thereby expanding to fill/fit all the necessary content.
Eric does point out that, in theory, it seems like leaving out that flexible middle row should still work, but he has a niggling suspicion it'll cause issues. Which is funny, because I have the same (unfounded) suspicion 😁 As I was reading down the article, my reaction was initially "you can't do that with rows" and then "aha, that flexi-height row will make it work". I'm just not sure why...