Articles by

Geoff Graham

Read, write, coffee, web, repeat.

Direct link to the article justify-self


The justify-self property in CSS sets the justification of an element within its containing block. Its behavior depends on the display of the containing block. For example, if the containing block is a grid container (i.e. display: grid), we …

(Updated on )

Form Validation Styling on Input Focus

/* Only show invalid ring while not focused */
input:not(:focus):not(:placeholder-shown):invalid {
  border-color: var(--color-invalid);
input:not(:focus):not(:placeholder-shown):invalid ~ .error-message {
  display: block;	

/* Only show valid ring while not focused and if a value is entered */
/* :empty won't work 


:future is a CSS pseudo-selector we can use to style upcoming elements during media playback. Think subtitles in videos. We can use this to style subtitles that are coming up next to separate them visually from the currently displayed subtitle


:past is a CSS pseudo-selector that matches elements that have passed along a timeline. Where you’ll see this come into play is largely with video subtitles created with WebVTT. When a subtitle is no longer the currently displayed text, it …


:current is a CSS pseudo-selector that matches an element or an ancestor of an element that’s currently in display. So, we can match items that have rendered on the screen like this:

:current(p, ul);

…and that will select all currently …

(Updated on )