The Publishing Project

Feature detection and vendor prefixes in CSS

CSS has had to deal with vendor prefixes from very early on and some of those prefixes are still in use today. This post will look at how to use prefixes and how to automate the process, and how to use @supports to test if a feature is supported. Adding CSS prefixes That we’re still dealing with vendor prefixes shows how long some of them have lasted and provides an object lesson on how to handle features in development Developers didn’t think of vendor prefixes as a way to preview features, they shipped them in production, something the CSS Working

Feature detection in Javascript

One thing that makes the web difficult to work with is that a given feature may or may not be available in all your target browsers either because of the version of EcmaScript (the Javascript standard) it was introduced in or because browsers haven’t gotten around to implement them and may not do so at all or worse, they may have poor implementations of a given API (the initial implementation of Indexed DB in Safari comes to mind). In the old days, we would do browser detection and assume that if the browser was Netscape they would support a given

Uninstalling Go on Mac

Homebrew is good but it introduces some complexity to your development, particularly if you’ve installed tools manually before they were available via Homebrew. One of the really problematic tools to move to Homebrew was Go. Because it is installed as a package, removing it is not trivial and may require a lot of manual work after the removal is complete. Run the following command in a terminal to see if Go was installed using the macOS package pkgutil –pkgs Go macOS package is presented as com.googlecode.go in the result list. macOS package stores files in the predefined location. For Go

New CSS selectors: :is and :where

A pair of new pseudo-class selectors have made it easier to write CSS in a way that is easier to read and to reason through. :is and :where allow you to combine selectors that have the same styles. For example, to identify the headers inside an article you’d normally do this: article, h1, article, h2, article, h3, article, h4, article, h5, article, h6 { background: black; color: white; } Instead, you could use :is and improve legibility while avoiding a long selector and potential typos associated with it: article :is(h1, h2, h3, h4, h5, h6) { background: black; color: white;

CSS Containment and container queries

It looks like CSS containment will finally bring container queries into browsers without the need for a polyfill. This post will discuss the current implementation in Chromium browsers. Note: The specification for container queries hasn’t been finalized. It is possible but unlikely that the specification and the corresponding CSS will change. Don’t use @container in production until the feature is finalized. What problem do container queries solve? Container queries give developers finer control over the layout of components. Rather than using media queries that provide responsiveness based on the viewport state, they give responsiveness based on the parent container or