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
In the table header, you can define the light bor...
All tags must be lowercase In XHTML, all tags must...
First, before posting! Thanks again to I Want to S...
In the horizontal direction, you can set the cell...
In this article, I will explain in detail how to ...
The <tfoot> tag is used to define the style...
Introduction: Lambda Probe (formerly known as Tom...
Preface Under the influence of some CSS interacti...
1 Start the Docker service First you need to know...
1. Compile proto Create a new proto folder under ...
Table of contents Tomcat Download Tutorial Tomcat...
Preface: When passing data between parent and chi...
Nowadays, mobile devices are becoming more and mo...
The solution to forgetting the initial password o...
Table of contents 1. Understand the basics 2. Con...