Preview versions of Safari (Technology Preview 106) and Firefox (version 78) now support the new CSS Use :is() to reduce duplication You can use the /* before */ .embed .save-button:hover, .attachment .save-button:hover { opacity: 1; } /* after */ :is(.embed, .attachment) .save-button:hover { opacity: 1; } This feature is mainly useful in unprocessed standard CSS code. If you use Sass or a similar CSS preprocessor, you may prefer nesting. Note: Browsers also support the non-standard Use :where() to keep specificity low Neither This feature is useful for styles that should be easily overridden. For example, the base stylesheet sanitize.css contains the following style rule, which sets the default fill color if the svg:not([fill]) { fill: currentColor; } Due to its higher specificity (B=1, C=1), websites cannot override this declaration with a single class selector (B=1) and are forced to either add .share-icon { fill: blue; /* Not applicable due to low specificity*/ } CSS libraries and base stylesheets can avoid this problem by wrapping their attribute selectors with /* sanitize.css */ svg:where(:not([fill])) { fill: currentColor; } /* author stylesheet */ .share-icon { fill: blue; /* Due to high specificity, applicable*/ } Summarize This is the end of this article about CSS :is() and :where() coming to browsers. For more CSS :is() and :where() browser content, please search 123WORDPRESS.COM’s previous articles or continue browsing the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! |
>>: Use pure CSS to disable the a tag in HTML without JavaScript
There are two common ways to make div background ...
This article example shares the specific code of ...
I have also been researching MySQL performance op...
Table of contents 1. Lvs Introduction 2. Lvs load...
Table of contents Preface 1. Understanding with e...
1. Introduction A few days ago, I encountered a p...
Cross-domain solutions jsonp (simulate get) CORS ...
Table of contents Preface Implementation ideas Im...
I have always used Loadrunner to do performance t...
General CSS code will only cause minor issues wit...
This article uses examples to describe the common...
one. Overview of IE8 Compatibility View <br /&...
This article shares the installation and configur...
Most of this article refers to other tutorials on...
Table of contents 1. Introduction to Portainer 2....