subscript, superscript and line-heights

Posted Over 1 year ago by Bruno Sedler.

By default subscript ( ) and superscript ( ) tags are styled with vertical-align: sub, respectively vertical-align: super by most browsers.

A modern approach to SVG icons

Posted Over 1 year ago by Tobias Kraze.

You have some SVG files you want to use as icons on your website. How would you embed them?

Using path aliases in esbuild

Posted Over 1 year ago by Tobias Kraze.

In esbuild, you usually import other files using relative paths: import './some-related-module' import `../../utils/some-utility-module` import `../../../css/some-css.sass` This is totally fine...

Jasmine: Creating DOM elements efficiently

Posted Over 1 year ago by Henning Koch.

Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...

Inspect and Debug CSS Flexbox and Grid Layouts by using the Layouts Tab in Dev Tools

Posted Over 1 year ago by Felix Eschey.

tl;dr In Chrome DevTools in the Layouts tab you have handy options to debug CSS Flexbox and Grid. Including...

Do not use unitless zeros in CSS calc functions

Posted Over 1 year ago by Arne Hartherz.
drafts.csswg.org

While in CSS zero is usually referenced without specifying a unit (e.g. padding: 0), you must not use a unitless...

Chrome DevTools: Treasure (Overview)

Posted Over 1 year ago by Julian.

tl;dr The Chrome DevTools are a neat collection of tools for the daily work as a web developer. If...

Sass: get rid of deprecation warnings in dependencies

Posted Over 1 year ago by Daniel Straßner.

TLDR: sass >= 1.35.0 has the option quietDeps to silence deprecation warnings from dependencies. quietDeps: If true, the compiler must not...

What Sass means by "@function rules may not contain style rules."

Posted Over 1 year ago by Arne Hartherz.

When writing a Sass function, you may run into an error message that may be confusing: @function rules may not...

JSON APIs: Default design for common features

Posted Over 1 year ago by Niklas Hä..

When you build a JSON API you need to come up with a style to represent attributes, pagination, errors or...

CSS: :is() pseudo selector

Posted Over 1 year ago by Julian.

tl;dr The :is() pseudo selector - specificity of its most specific argument - matches against a comma-separated list of selectors...

CSS: :where() pseudo selector

Posted Over 1 year ago by Julian.

tl;dr The :where() pseudo selector - zero specificity - matches against a comma-separated list of selectors. Example Compound selectors like...

CSS: The inset CSS shorthand

Posted Almost 2 years ago by Emanuel.
developer.mozilla.org

The inset CSS property is a shorthand that corresponds to the top, right, bottom, and/or left properties. It has the...

Flexbox: How to prevent <pre> elements from overflowing

Posted About 2 years ago by Florian Leinsinger.

I recently had the problem that embedded code boxes crashed my layout. It turned out that pres break out of...

Integrating ESLint

Posted About 2 years ago.

To ensure a consistent code style for JavaScript code, we use ESLint. The workflow is similar to integrating rubocop...

How to add esbuild to the rails asset pipeline

Posted About 2 years ago.

This are the steps I needed to do to add esbuild to an application that used the vanilla rails asset...

Capybara: Finding invisible elements and how to test that an element is not visible

Posted Over 2 years ago by Arne Hartherz.
github.com

When Capybara locates elements in the DOM, by default it allows only accessing visible elements -- when you are using a...

CSS Grid Display allows defining number of grid columns based on child width

Posted Over 2 years ago by Arne Hartherz.
css-tricks.com

An element with display: grid can define its grid-template-columns based on (preferred) child width using the repeat function...

Defensive CSS

Posted Over 2 years ago by Emanuel.
ishadeed.com

Table Of Contents Flexbox wrapping Spacing Long content Prevent an image from being stretched or compressed Lock scroll chaining

Finding ancestors with Capybara

Posted Over 2 years ago by Michael Leimstädtner.
stackoverflow.com

Modern versions of Capybara include a finder method #ancestor which allows you to find a parental element using CSS or...

Better numeric inputs in desktop browsers

Posted Over 2 years ago by Arne Hartherz.

You want to use fields in your applications. However, your desktop users may encounter some weird quirks: Aside from allowing...

A Guide To CSS Debugging

Posted Over 2 years ago by Henning Koch.
smashingmagazine.com

Debugging in CSS means figuring out what might be the problem when you have unexpected layout results. We’ll look...

Event delegation (without jQuery)

Posted Over 2 years ago by Henning Koch.

Event delegation is a pattern where a container element has a single event listener that handles events for all descendants...

Semantic HTML

Posted Over 2 years ago by Dominik Schöler.

Besides their default styling properties, HTML elements have a semantic meaning. For example, an h1 tag is usually styled with...