Journal
In the same vein as Jeremy Keith’s recent blog post, Hydration, which calls out some of the performance and user experience problems associated with current Server Side Rendering approaches, I think Jake Archibald is absolutely bang on the money here.
The server and client render should not be 1:1.
— Jake Archibald (@jaffathecake) February 20, 2020
Don't render buttons on the server that require JS to work.
Don't ship code to the client that simply repeats what the server has already done.
Every time I watch nostalgic TV documentaries about Scottish films I see Just a Boys’ Game and Just Another Saturday – both written by Peter McDougall – come up. I just watched Just a Boys’ Game (available on Google Play) and loved it. Set in 1979 Glasgow, this is a gritty story with refreshingly good acting that really captures the finer points of the social and economic mood of the time.
Why the GOV.UK Design System team changed the input type for numbers (Technology in Government)
Using
<input type="text" inputmode="numeric" pattern="[0-9]*">(instead of<input type="number") allows for a degree of separation between how the user enters data (“input mode”), what the browser expects the user input to contain (type equals number), and potentially how it tries to validate it.
An interesting post from the UK Government listing a host of usability and accessibility problems arising from using <input type="number">.
Now that browser support for the inputmode attribute is sufficient, they have moved to <input type="text" inputmode="numeric">.
I trust GOV.UK’s opinion and think I’ll follow suit.
Are My Colours Accessible?
Colour contrast and the use of colour is extremely important for certain groups of people with varying levels of visional impairment. Building upon the excellent Colorable, I wanted more context around the result. When you share the outcome with your colleagues, all the results, rules and what you’re aiming for, is easily understandable for when you have those awkward conversations with designers and marketers. Accessibility doesn’t have to be ugly.
An excellent, easy to use tool for checking text-against-background contrast for accessibility and sharing your results with others.
(via @paddyduke)
The Contrast Triangle
Removing underlines from links in HTML text presents an accessibility challenge. In order for a design to be considered accessible, there is now a three-sided design contraint - or what I call "The Contrast Triangle". Your text, links and background colors must now all have sufficient contrast from each other. Links must have a contrast ratio of 3:1 from their surrounding text. By not using underlines, a design has to rely on contrast alone to achieve this.
It’s interesting that Chip says that this level of contrast is needed “when we don’t use underlines on links”.
By not using underlines, a design has to rely on contrast alone to achieve this.
So this seems to be yet another good reason to include underlines in links, i.e. if you underline your links then you don’t need to worry quite as much about a third level of contrast.
Indeed, when you toggle on the “Show underlines” option on this tool, it then removes the requirement to ensure additional contrast between hyperlinks and standard body text.
However, even if your links in flowing prose are underlined, there’s always likely to be places (Navigation, Footer, CTAs etc) where you’ve probably disabled underlines on links for design effect, so I reckon this is useful for most websites.
(via https://twitter.com/jamesmockett)
BBC GEL Inclusive Components Technical Guide
The BBC Global Experience Language (GEL) Technical Guides are a series of framework-agnostic, code-centric recommendations and examples for building GEL design patterns in websites. They illustrate how to create websites that comply with all BBC guidelines and industry best practice, giving special emphasis to accessibility.
Heydon Pickering (author of Inclusive Components and co-creator of Every Layout) has implemented and documented over 25 of the BBC's design patterns. These are sure to be loaded with best practices and clever tricks for making resilient, accessible modern UI components. (via @heydonworks)
My Codepen Cheatsheet
I’m finding Codepen to be more and more valuable not only for testing out new code and ideas, but also – when working on large applications – as a time-saving rapid prototyping environment which sidesteps the overhead of back-end set-up. Here are some tips which I’ve found useful, for future reference.
Control the Editor View layout
Append /left/, /right/, or /top/ to the URL to set the editor layout.
Append ?editors=1111 (change numbers as appropriate) to the URL to set which panels are maximised (in order of HTML, CSS, JavaScript, and console).
For example:
https://codepen.io/fuzzylogicx/pen/BEEYQL/left/?editors=1100
References
- https://blog.codepen.io/documentation/url-extensions/
- Adding external resources to a pen
- ES Modules on codepen
- https://www.hongkiat.com/blog/codepen-tips-beginners/
My VS Code Cheatsheet
Here’s a list of useful (Mac-based) VS Code tips for my reference and yours.
Use the Command Palette
Command-Shift-P
Then type your search term, for example “settings”.
Settings
My preferences (in settings.json or via Preferences→Settings):
{
"workbench.editor.showTabs": true,
"editor.formatOnSave": true,
"explorer.confirmDragAndDrop": false,
"editor.minimap.enabled": false,
"extensions.ignoreRecommendations": false,
"explorer.compactFolders": false,
"explorer.autoReveal": false,
"editor.accessibilitySupport": "off",
"ruby.codeCompletion": "rcodetools",
"emmet.includeLanguages": {
"nunjucks": "html",
"erb": "html"
},
"emmet.triggerExpansionOnTab": true
}
Note: the Emmet ones are really useful for code autocompletion.
Additional Emmet Settings
To add a keyboard shortcut for adding an arbitrary wrapper element (say, div.wrap) around some selected code:
Open the Command Palette then search “emmet wrap”. When you see the option “Emmet: wrap with abbreviation”, click the settings icon beside it. Enter your preferred keyboard shortcut. I currently use:
Command-Shift-A
Open current terminal directory in VS Code
code .
Toggle Terminal
Ctrl-`
Toggle sidebar visibility
Command-B
Edit multiple rows simultaneously
Select one instance of the text that appears in multiple locations. Use Command-D to select all, then edit.
Open file to side (for side-by-side editing)
Option–click on a file in the Explorer.
Bobby Gillespie remembers Andrew Weatherall (The Guardian)
I think of him as a true bohemian; he made etchings, he wrote, he read a lot. Andrew always had a book on the go, maybe two. I remember he gave me his copy of Hunger by Knut Hamsun when I told him I hadn’t read it. There was this other side to him that was deep, curious, well-read. I guess he was a classic autodidact, hungry for knowledge.
Over the last week, the UK music scene has been remembering Andrew Weatherall who sadly died aged only 56.
Bobby Gillespie’s tribute recalls how Weatherall was a fan of some of Primal Scream’s unfashionable songs before he transformed their fortunes with his production on Loaded and Screamadelica, and provides an insight into an outsider with a big heart. (via @SoundClashVic)
You Don't Need
A nice list of tips and tools on how to use simpler browser standards and APIs to avoid the added weight of unnecessary JavaScript and libraries.
Lodash, Moment and other similar libraries are expensive and we don’t always need them. This Github repo contains a host of nice tips, snippets and code–analysing tools.
One cautionary note regarding the idea of replacing JS with CSS: although the idea of using CSS rather than JavaScript for components like tabs and modals seems nice at first, it doesn’t properly consider that we often need JS for reasons of accessibility, in order to apply the correct aria attributes when the state of a UI component is modified.
Via Will Matthewson at work (FreeAgent) during our group conversation on JavaScript strategy.