Last week I saw Una Kravets give a very inspiring talk at Generate Conf about using CSS Filters and Mix Blend Modes. One demo in particular got my attention because Una showed us how we could overlay two layouts on top of each other and use blend modes to spot all the differences between them.

I was pretty excited about this idea and got to thinking: could we create visual regression testing with just one line of CSS? Turns out we can.

See the Pen Visual Regression Testing with CSS Mix-Blend-Modes by Sarah Drasner (@sdras) on CodePen.

The above pen shows that the text block of our layout only changed slightly but the button has been modified more dramatically, and the illustration had small triangles that were altered.

When I tweeted about this idea, Bennett Feely, author of such impressive tools as Clippy (for CSS clip-path generation) and CSS Gradients With Background Blend-Mode, had already created something similar, but it used background-blend-mode: difference; instead.

You can hover over it to see the two images separated:

See the Pen Image diffing by Bennett Feely (@bennettfeely) on CodePen.

To make things even more interesting, I was pointed to this post by Franklin Ta which might be patient zero to this whole idea and it beautifully explains the concept behind creating visual diffs with CSS. This post came out two full years ago and is worth reading.

Una then took all of this one step further and created a tool that we can use in the browser to readily create visual regression diffs without a lot of scripting, called Diffy. Pretty neat.

All with one line of CSS!


Visual Regression Testing with CSS Blend Modes is a post from CSS-Tricks

No Comments
Comments to: Visual Regression Testing with CSS Blend Modes

Recent Articles

Good Reads

China Nuclear Power Engineering Corporation , a half of CGN, is managing the project. Shanghai Electric received a $260 million contract for tools and Alstom offering the four low-speed Arabelle turbine-generator units for $184 millio CGN might be liable for the project building and the operation of the primary five years after commercial operation, with […]
Дизайн человека канал 9 52. – «Дизайн человека канал 9 52.» Дизайн человека онлайн. Травма 6 дизайн человека. 27 50 канал дизайн человека. Дизайн человека энергетические центры. Дизайн человека отшельник 6 2 проектор. 3 ворота дизайн человека описание. 23 43 канал дизайн человека. Крест заразительности дизайн человека. Дизайн человека определить свой. Дизайн человека правое и […]

Worlwide

Overview VipsPM – Project Management Suite is a Powerful web-based Application. VipsPM is a perfect tool to fulfill all your project management needs like managing Projects, Tasks, Defects, Incidents, Timesheets, Meetings, Appointments, Files, Documents, Users, Clients, Departments, ToDos, Project Planning, Holidays and Reports. It has simple yet efficient layout will make managing projects easier than […]
China Nuclear Power Engineering Corporation , a half of CGN, is managing the project. Shanghai Electric received a $260 million contract for tools and Alstom offering the four low-speed Arabelle turbine-generator units for $184 millio CGN might be liable for the project building and the operation of the primary five years after commercial operation, with […]
Дизайн человека канал 9 52. – «Дизайн человека канал 9 52.» Дизайн человека онлайн. Травма 6 дизайн человека. 27 50 канал дизайн человека. Дизайн человека энергетические центры. Дизайн человека отшельник 6 2 проектор. 3 ворота дизайн человека описание. 23 43 канал дизайн человека. Крест заразительности дизайн человека. Дизайн человека определить свой. Дизайн человека правое и […]
Рассчитать дизайн человека бесплатно с расшифровкой на русском. – «Рассчитать дизайн человека бесплатно с расшифровкой на русском.» Дизайн человека рассчитать онлайн. Дизайн человека бодиграф рассчитать онлайн бесплатно. Дизайн человека генетические травмы. Канал 29 46 в дизайне человека. Дизайн человека кто придумал и на чем основан. Дизайн человека 3 5 мученик еретик описание. Ребенок рейв по […]

Trending

Turquoise Jewelry is one of the ancient healing stones used for personal adornment and astrological benefits. The rare greenish blue-colored pectolite is celebrated for its enchanting powers among many crystal lovers. It is a hydrated phosphate of copper and aluminum that ranks 5 to 6 on the Mohs hardness scale. It is deemed a protective […]
Singapore is recognised globally as a prime destination for foreign investors. Its business structure is well-developed, and its tax system is favourable to business owners. The government has a strong support system for entrepreneurs and provides legal protection for intellectual property rights. All of these conditions create an environment that is ideal for Singapore company […]
2020 has been a year that represents aggressive and sustained volatility with a confluence of unexpected situations, including economic shifts and market disturbance confluence. The COVID-19 pandemic forces businesses to adjust their methods of operations to ensure survival. These adjustments become the trajectory and guidance of what 2021 should look like and what companies should […]
COVID-19 pandemic has affected Thailand’s economy and labor market. World Bank’s Thailand Economic Monitor predicted that it would take Thailand over two years to return to its pre-COVID-19 growth and domestic product output levels. Although the country has successfully curbed the pandemic tide over the last few months, the economy remains severely hit. Nevertheless, heavily […]