Exploring New Pseudo Classes

Posted on 20 Sep 2022

CSS Demo

CSS/CSS3

Here are some demos I've put together using the :has() pseudo class.

Project Screenshot

Click on image to enlarge

Tech Stack

Frontend

HTML, CSS, JavaScript, Dialog Element

Deployment

GitHub Pages

Highlights

Dialog Element

About

Here are some examples I’ve put together to showcase the usage of the has() pseudo class. You can view the code in the repo.

One is form states, the second is grids with an odd number of columns, and the third is carousels where the scrollbar shows when there are more than a certain number of images—in this case 5.

This project was inspired by Kevin Powell’s video Count children with CSS only using :has()! plus other awesome stuff once again.