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
If your web application runs on only one machine,...
Primitive values -> primitive types Number S...
Note: You cannot use scoped animations! ! ! ! via...
Table of contents From father to son: 1. In the s...
First look at the effect diagram: The complete co...
When using TensorFlow for deep learning, insuffic...
1. Vector Map Vector graphics use straight lines ...
Table of contents Technology Stack Effect analyze...
Call How to call Amap API? The official open docu...
version: centos==7.2 jdk==1.8 confluence==6.15.4 ...
How to center your HTML button itself? This is ea...
Websites without https support will gradually be ...
1. Basic Concepts 1. Sitemesh is a page decoratio...
1. Get is used to obtain data from the server, wh...
Preface Any application that can be written in Ja...