Sam Breed

Product Developer, Investor

← wiki

The death of Internet Explorer in 2022 finally opened the doors to a new era of web development. The Year of the Evergreen browser, where we still have a lowest common denominator (hint: it’s Safari) but it’s a lot less-low than it used to be. This is a list where I’ll collect list notes to remember what I’m missing using Tailwind.

Consequently, I’ve been writing more and more custom CSS without Tailwind. I’m still a big fan of Tailwind, but the web platform keeps getting better and better.

Table of Contents

New New

.nesting {
	& > .child {
		/* styles */
	}
}
.post {
	container-type: inline-size;
}

@container (min-width: 640px) {
	header h1 {
		font-size: 1rem;
	}
}
/* Declare layer order first - this controls cascade priority */
@layer reset, base, components, layout, utilities;

@layer reset {
  * { box-sizing: border-box; }
  body { margin: 0; }
}

@layer base {
  body {
    font-family: var(--font-family-body);
    color: var(--text-color);
  }
  h1, h2, h3 { font-weight: 600; }
}

@layer components {
  .search-form { display: flex; gap: 1rem; }
  article > p { margin-block: 1lh; }
}

@layer utilities {
  .text-sm { font-size: 0.875rem; }
  .flex { display: flex; }
  .hidden { display: none; }
}

‡ These have been around for long enough that I no longer consider them new, but still make life much, much better so I’ll include them here anyway.

Old New

Categories