Transparent is a CSS color and used in the theme-color meta tag most browsers do what you’d expect. Actually, they are supported in most browsers, but the results aren’t very consistent and sometimes unexpected. HEX codes, rbg(), hsl() and keywords are well and consistently supported, but colors that include transparency: not so much. We’ll talk about that later, but first let’s look at some limitations. ![]() ![]() This is awesome because it allows us to do some pretty cool stuff with JavaScript. Looking at Chrome 90 on an Android Galaxy S20Īll supported browsers also support hsl() and rgb(). The theme-color meta tags supports CSS colors in any form: keywords, rgb(), hsl() or hex code. I’ve created this theme-color testing CodePen to verify that. One of the first questions that came to my mind was “Can we use color keywords, hsl(), rgb(), too?” According to the HTML spec, the value of the attribute can be any CSS color. Hex color support is great in all supported browsers. Īccording to tests I made earlier this year, this works in Chrome, Brave and Samsung Internet on Android, installed PWAs in Chrome and now also in Safari Technology Preview. Here’s how I’ve been using the theme-color meta tag for the past few years: just a good ‘ol hex code for the content attribute. That was only temporary, starting with release 128 it supports it again. Heads up! Safari removed support for the theme-color meta tag in Safari Technology Preview (127). I never really took much note of the theme-color meta tag, but now is a good time to learn about its features and limitations and try to discover some interesting use cases. That’s exciting news because now the first desktop browser supports this tag and it also supports the media attribute and the prefers-color-scheme media feature. ![]() Starting with Version 15, Safari supports the theme-color tag both on macOS and iOS.
0 Comments
Leave a Reply. |