Skip to main content

Journal

CSS Grid: strategy and first steps

Over the course of 2018 I’ve been trying to get the hang of CSS Grid.

I’d already become fairly adept at using Flexbox – a game-changing responsive layout technology which I love – but the prevailing wisdom suggested that I get with the program and learn this new system, too. At first I wondered whether I should even be using Flexbox at all any more; whether it was already old hat. After all, whereas Flexbox was essentially for laying out items in a single dimension, CSS Grid felt more important, being the web’s first ever purpose-built system for two-dimensional layout.

I have to admit that learning Grid did not come easy at first. Wrapped up in this new system is a whole load of new terminology, new units of measurement and new ways of thinking. Rachel Andrew’s book The New CSS Layout had been helpful but by autumn the concepts still weren’t fully clicking with me. Nor was I totally clear on the appropriate situations to use Grid. So I limited my first production forays to small components where I felt there was less risk of things going badly wrong.

A turning point came while attending Rachel Andrew’s talk Graduating to Grid in which she advised that when things start to feel complicated, remember that:

“It’s all just a grid of lines.”

For me, concentrating primarily on the grid-lines and not the stuff within and without helped simplify the overall concept and make all the supporting features click into place.

At the same conference, Eric Meyer acknowledged that a given layout challenge might be accomplished using either Flexbox or Grid, so in order to standardise your team’s approach it can be useful to set a rule such as:

“Grid for general layout; Flexbox for components.”

Jen Simmons also gave a presentation that included several code examples which used Grid at the layout level and Flexbox at the component level.

Now, I know that neither speaker was saying that it has to be split that way, however I personally liked the idea of applying this rule as a means of avoiding choice paralysis.

I was reminded that Flexbox makes developing responsive components such as navigation menus, fixed-height cards, lists of social icons etc much easier than they previously were with floats and absolute positioning. And for most of these components, because they are one-dimensional, CSS Grid would be overkill. So I realised: if it ain’t broke, don’t fix it. Don’t stop using Flexbox for things that it excels at.

I resolved to create a CSS Grid page layout on Fuzzy Logic, sticking to Flexbox for the components.

My basic idea was to start with a single-column layout for mobile phones then for wider screens break into a two-column layout… but with the logo sitting off “in space” to the left. Pretty simple, but complex enough to get me into:

  • using the fr unit for columns of whitespace;
  • using grid-template-areas to specify named grid areas for positioning my content, sidebar and footer sections; and
  • realising how useful subgrid will be.

I started by knocking together a rough prototype, before fleshing things out and applying the layout to the main site. Depending on when you read this, you’ll see that layout in place now. If you want to check out the grid lines and areas I recommend using the Firefox (or Firefox Nightly) Grid Inspector.

Overall, it feels good to have taken the plunge into using CSS Grid for page layout, and it has given me confidence to explore further and try more interesting layouts. More to follow, I hope.

Push without notifications

Jeremy Keith suggests that it might be better if our websites ask people to grant permission for new content (e.g. blog posts or podcasts) to be silently cached, rather than asking permission to send intrusive notifications.

I’ve just implemented web push notifications on the Greenhill Journal so this is definitely food for thought.

Objekt DJing at Sub Club 16/11/18

Really looking forward to checking Objekt at the Sub Club on Friday night. I’ve enjoyed his productions since the first and although I don’t like everything, when he’s good he’s really good. This one from 4 years ago on a split 12″ with Dopplereffekt blew my tiny mind when it came out and remains one of my favourite techno records this decade. DJing-wise he seems to be pretty unpredictable, which is fine by me!

Play Video: Objekt DJing at Sub Club 16/11/18

Squoosh

An image optimisation and resizing tool with lots of different compression and format options.

Surface Noise


B-side artwork of TNF003: The Nuclear Family vs Other Lands – “Surface Noise”
TNF003: Side B artwork

It’s taken a few years, but me and Tom are excited to be releasing a new record on our label, The Nuclear Family.

Check out the audio previews.

Titled Surface Noise, our third release will be available on both 12″ vinyl and digital, hitting all good record stores in early November ‘18.

You can pre-order it now from our Bandcamp page.

Here's what our press release says:

Artist: The Nuclear Family vs Other Lands Title: Surface Noise Label: The Nuclear Family A: The Nuclear Family - Surface Noise B: Other Lands - See Thru Time

Did you miss us? The Nuclear Family - Tom Churchill and Laurence Hughes - are back after a three-year hiatus, and this time we’ve roped in one of our good buddies, Other Lands, to help us deliver a double-header of deep delights for discerning DJs and dancers, cut nice and loud over a full side each.

Surface Noise, on side A, is the first of the Family’s recent studio jams to see the light of day, with its classic 808 drums and analogue bass underpinning warm pads, twinkling melodies and some subtle vocoder flourishes.

On the flipside, we’re honoured to present a killer track from Other Lands - aka Edinburgh’s veteran DJ/producer Gavin Sutherland, fresh from the success of his recent Pattern Transform 12” for Firecracker and all manner of other exciting studio and live projects. See Thru Time is a masterclass for the heads, with mellifluous chord progressions and a timeless groove.

TNF 003 will be available on vinyl via Rubadub in November, along with a digital version via Bandcamp.

Rise by Gina Miller

I’ve just read Rise by Gina Miller.

A photo of the book Rise, by Gina Miller
Rise by Gina Miller

In 2016 Miller took the UK government to court for attempting to force through Article 50—the mechanism for starting Brexit—which would have lead to the nation leaving the EU without parliamentary consent.

Its title a reference to the Maya Angelou poem Still I Rise, the book is partly the author’s story of how she has been shaped by the successes and failures in her life, and partly a personal manifesto stating that every person can stand up and make a positive difference, even in the face of adversity.

Miller begins with her fight, in the aftermath of the Brexit vote and the “festering wounds” it exposed, to ensure that the UK’s democratic process and constitution be upheld. She traces her background as a child born in Guayana, a British colony at the time. As the daughter of a self-made man who became the country’s attorney general, she and her family saw Great Britain as the promised land, “a culture where the rule of law was observed and decency was embedded in the national fabric.” Since moving to the UK, forging a successful career and speaking up for her beliefs, that notion of justice and decency has come under scrutiny as she has been met with racist and sexual prejudice and abuse from all walks of society.

The author goes on to describe some of the specific challenges she has faced in her life including vicious hate mail, attacks by the press, being in an abusive marriage, and raising a daughter with special needs. In the end however, as a successful businesswoman with a happy family, hers is a story of strength and survival and a message of hope.

As a man, at times I felt that the book—which often returned to themes of female empowerment—perhaps wasn’t intended for me. Then on other occasions I felt that it was as important (if not more important) for me and other men as for anyone else to absorb these stories of sexist bullying, discrimination and abuse told from the female perspective.

Other core messages of the book were universal: finding your voice, speaking up when it is important to do so, overcoming adversity, and demonstrating tolerance in a divided society.

This was a book I picked up on a whim as a departure from my usual reading subjects, and I’m glad I did.

Cloudinary

Cloudinary is a very handy tool for image and video upload, storage, optimisation and CDN.

Store, transform, optimize, and deliver all your media assets with easy-to-use APIs, widgets, or user interface.

This was brought to my attention by Jason Grigsby at An Event Apart. We were discussing his article series on Responsive Images and I asked if he could recommend a tool which auto-generated all of the images you needed for your responsive image code, if you provide a single source image.

I’ve been trying Cloudinary out and so far, so good.

(via @grigs)

Testing webmention endpoint discovery implementation (part two)

Screenshot of successful webmentions on webmention.rocks
Proof that it worked

Linking to a variety of test posts on webmention.rocks to see if my comment shows up on each of them.

The software/library I’m using is Perch.

Update: it worked! See the screenshot above for proof.

Atomic Design by Brad Frost

The original call-to-arms and manual for Design Systems.

Brad Frost explains why Design Systems are necessary, provides a methodology for Pattern Library creation, discusses Design System benefits and offers strategies for maintenance.

Testing out webmentions

Note: I wrote this article back in 2018 when I had a PHP-based site and used Perch as my CMS. I haven’t implemented webmentions on my current, 11ty-based site (end of note).

I’ve recently added webmention capability in my CMS. Webmention is one of the building blocks of the Indieweb movement. The idea is that if my article links to another person’s article then my website will notify theirs and if their site also supports webmention then they can show beside their article that I’ve linked to it.

Likewise, other sites can notify mine if they’ve linked to mine. In this way, I eventually hope to have likes, comments etc from sites such as Facebook and Twitter fed back to here so that I can display them beside the source article.

I’m now going to test webmentions by linking to this article on the topic by Aaron Parecki. Let’s see if something shows up on his site.