Tag Archives: css
CSS: Float an Element to the Bottom Corner
Temani Afif shares this clever trick to float an element to the bottom corner of a container. The solution is threefold: Float a full-height wrapper (which contains the image) to the right Use flexbox to place the image at the bottom inside that wrapper Use shape-outside to clip the wrapper Clever! Float an Element to …
Continue reading “CSS: Float an Element to the Bottom Corner”
Identify and Extract Pseudo-Element Selectors from built-in HTML Elements using DevTools
Animating Text Underlines
Instead of resorting to faux underlines using injected content, Michelle Barker shares that we nowadays can animate the text-decoration-* properties to achieve similar (and better) results. This approach however won’t work in Chromium, as only Firefox/Safari support animating text-underline-offset at the moment … but thankfully a tiny amount of CSS Houdini Magic can be sprinkled …
Container Queries are Actually Coming / Say Hello To CSS Container Queries
Continue reading “Container Queries are Actually Coming / Say Hello To CSS Container Queries”
Dark mode in 5 minutes, with inverted lightness variables
Lea Verou shows a method to implement dark mode, not by swapping entire colors, but by simply changing their lightness The basic idea is to use custom properties for the lightness of colors instead of the entire color. Then, in dark mode, you override these variables with 100% – lightness. This generally produces light colors …
Continue reading “Dark mode in 5 minutes, with inverted lightness variables”
Style Pseudo-elements with Javascript Using Custom Properties
Over at CSS { In Real Life }, author Michelle Barker has detailed a clever way to style pseudo-elements (such as ::before and ::after) through JavaScript. In Javascript we have a few ways of selecting elements, but we can’t directly target pseudo-elements. […] Luckily, CSS custom properties can help. 👉 If you set a custom …
Continue reading “Style Pseudo-elements with Javascript Using Custom Properties”
Debug/Inspect z-index stacking with the “CSS Stacking Context Inspector” DevTools extension
The Stacking Contexts Inspector is a DevTools extension for Google Chrome that allows you to analyse the stacking contexts available on a webpage. This extension will add a new panel to the DevTools and a new sidebar on the elements panel. Handy for when you’re having stacking issues. CSS Stacking Context Inspector →Stacking Contexts Inspector …
CSS Container Queries: A First Look + Demo
CSS Logical Properties Are the Future of the Web & i18n
Linked below is yet another article urging one to use CSS Logical Properties. What caught my eye in this one is the fact that author Daniel Yuschick reworked his personal website to use them, as shown in this video below. Impressive! CSS Logical Properties Are the Future of the Web & I18N → In case …
Continue reading “CSS Logical Properties Are the Future of the Web & i18n”