Items in category css

Automated CSS Regression Testing in Action: A Developer’s Guide

CSS
Automated CSS Regression Testing in Action: A Developer’s Guide
Image generated by ChatGPT (DALL·E)

We write unit-tests tests for server-side source code and for JavaScript. Even when putting aside benefits of TDD approach it gives us a priceless thing – early problem reporting during refactoring. So you make change, you run tests and you will know at once if anything broke. What about CSS? You encapsulate a declaration set into a separate rule, look through the site pages where dependent classes used and satisfied proceed with refactoring. After finishing your work you test the site thoroughly, opening every page, every modal, drop-down and expandable. Now you find out that on the very first change you broke the styles of a component that shows only by user action so missed it back then. It turns out that refactoring decision wasnt quite good. But its late to change.

If only we could go with automated testing... In fact we can.

Pure CSS Magic: Creating Stylish Modal Windows Without JavaScript

CSS
Pure CSS Magic: Creating Stylish Modal Windows Without JavaScript

This article provides a walkthrough on how to create a modal window that opens in the center of the screen by pressing a link while everything that underlies the window becomes blurred without any JavaScript. It also has a fallback code for the browsers not supporting :target pseudo-selector.