Articles by

Geoff Graham

Read, write, coffee, web, repeat.

Direct link to the article justify-self

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

: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

: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

: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 )

border-boundary

The border-boundary property in CSS set constraints to the bounds of an element that affects how the element’s borders behave. It’s defined in the CSS Round Display Level 1 specification, which is currently in Working Draft status. That means things …

(Updated on )