The fantastic thing about analysis is discovering your self on a totally unrelated subject mere minutes from opening your browser. It occurred to me whereas writing an Almanac entry on @namespace
, an at-rule that we most likely gained’t ever use and is commonly thought to be a legacy piece of CSS. Perhaps that’s why there wasn’t numerous data about it till I discovered a 2010s submit on @namespace
by Divya Manian. The submit was extremely enlightening, however that’s irrelevant; what’s necessary is that in Divya’s weblog, there have been arrows on the edges to learn the earlier and subsequent posts:

Don’t ask me why, however with out noticing, I in some way clicked the left arrow twice, which led me to a submit on “Notes from HTML5 Readiness Hacking.”

What’s HTML 5 Readiness?!
HTML 5 Readiness was a website created by Paul Irish and Divya Manian that confirmed the browser assist for a number of internet options by the lens of a rainbow of colours. The options had been thought of (on the time) state-of-the-art or bleeding-edge stuff, equivalent to media queries, transitions, video and audio tags, and so forth. As every browser supported a characteristic, a bit of the rainbow could be added.

I believe it labored from 2010 to 2013, though it confirmed browser assist information from 2008. I can’t describe how nostalgic it made me really feel; it jogged my memory of less complicated instances when even SVGs weren’t totally supported. What nearly made me shed a tear was pondering that, if this device was up to date right now, all the options could be coloured in a full rainbow.
A brand new internet readiness
It acquired me pondering: there are such a lot of new options coming to CSS (many who haven’t shipped to any browser) that there could possibly be a brand new HTML5 Readiness with all of them. That’s why I set myself to do precisely that final weekend, a Net Readiness 2025 that holds every of the options coming to HTML and CSS I’m most enthusiastic about.
You possibly can go to it at webreadiness.com!
Proper now, it seems to be kinda empty, however as time goes we’ll hopefully see how the rainbow grows:

Regardless that it was a weekend venture, I took the chance to dip my toes into a few issues I wished to be taught. Under are additionally some snippets I believe are price sharing.
The information is sourced from Baseline
My first thought was to mod the <baseline-status>
internet element made by the Chrome crew as a result of I’ve been wanting to make use of it because it got here out. Briefly, it allows you to embed the assist information for an internet characteristic immediately into your weblog. Not way back, in reality, Geoff added it as a WordPress block in CSS-Tips, which has been tremendous helpful whereas writing the Almanac:
Nevertheless, I instantly realized that utilizing the <baseline-status>
could be needlessly laborious, so I as a substitute pulled the information from the Net Options API — https://api.webstatus.dev/v1/options/
— and displayed it myself. Yow will discover all of the obtainable options within the GitHub repo.
Every ray is an internet element
One other characteristic I’ve been desirous to be taught extra about was Net Parts, and since Geoff just lately revealed his notes on Scott Jehl’s course Net Parts Demystified, I assumed it was the proper likelihood. On this case, every ray could be an internet element with a easy stay cycle:
- Get instantiated.
- Learn the characteristic ID from a
data-feature
attribute. - Fetch its information from the Net Options API.
- Show its assist as an inventory.
Stated and finished! The simplified model of that code seems to be one thing like the next:
class BaselineRay extends HTMLElement {
constructor() {
tremendous();
}
static get observedAttributes() {
return ["data-feature"];
}
attributeChangedCallback(property, oldValue, newValue) {
if (oldValue !== newValue) {
this[property] = newValue;
}
}
async #fetchFeature(endpoint, featureID) {
// Fetch Function Perform
}
async connectedCallback() {
// Name fetchFeature and Output Listing
}
}
customElements.outline("baseline-ray", BaselineRay);
Animations with the Net Animation API
I have to admit, I’m not too design-savvy (I hope it isn’t that apparent), so what I lacked in design, I made up with some animations. When the web page initially hundreds, a welcome animation is well achieved with a few timed keyframes. Nevertheless, the animation between the rainbow and listing layouts is a bit more concerned because it is determined by the person’s enter, so we now have to set off them with JavaScript.
At first, I assumed it will be simpler to do them with Identical-Doc View Transitions, however I discovered myself battling with the browser’s default transitions and the dearth of excellent documentation past Chrome’s posts. That’s why I made a decision on the Net Animation API, which helps you to set off transitions in a declarative method.
sibling-index()
and sibling-count()
Some time in the past, I wrote in regards to the sibling-index()
and sibling-count()
features. As their names indicate, they return the present index of a component amongst its sibling, and the full quantity of siblings, respectively. Whereas Chrome introduced its intent to ship each features, I do know it will likely be some time till they attain baseline assist, however I nonetheless wanted them to rotate and transfer every ray.
In that very same submit, I talked about three choices to polyfill every operate. The primary two had been CSS-only, however this time I took the only JavaScript manner which observes the variety of rays and provides customized properties with its index and complete depend. Positive, it’s a bit overkill because the quantity of rays doesn’t change, however fairly straightforward to implement:
const components = doc.querySelector(".rays");
const updateCustomProperties = () => {
let index = 0;
for (let component of components.youngsters) {
component.fashion.setProperty("--sibling-index", index);
index++;
}
components.fashion.setProperty("--sibling-count", components.youngsters.size - 1);
};
updateCustomProperties();
const observer = new MutationObserver(updateCustomProperties);
const config = {attributes: false, childList: true, subtree: false};
observer.observe(components, config);
With this, I might place every ray in a 180-degree vary:
baseline-ray ul{
--position: calc(180 / var(--sibling-count) * var(--sibling-index) - 90);
--rotation: calc(var(--position) * 1deg);
rework: translateX(-50%) rotate(var(--rotation)) translateY(var(--ray-separation));
transform-origin: backside heart;
}
The choice is JavaScript-less
Within the browser captions, if you happen to hover over a selected browser, that browser’s shade will come out extra within the rainbow whereas the remaining turns into a bit clear. Since in my HTML, the caption component isn’t anyway close to the rainbow (as a guardian or a sibling), I assumed I would wish JavaScript for the duty, however then I remembered I might merely use the :has()
selector.
It really works by detecting each time the closest guardian of each components (it could possibly be <part>
, <important>
, or the entire <physique>
) has a .caption
merchandise with a :hover
pseudo-class. As soon as detected, we enhance the dimensions of every ray part of the identical browser, whereas lowering the opacity of the remainder of the ray sections.
What’s subsequent?!
What’s left now could be to attend! I hope folks can go to the web page infrequently and see how the rainbow grows. Like the unique HTML 5 Readiness web page, I additionally need to take a snapshot on the finish of the yr to see the way it seems to be till every characteristic is totally supported. Hopefully, it gained’t take lengthy, particularly seeing the browser’s effort to ship issues quicker and enhance interoperability.
Additionally, let me know if you happen to assume a characteristic is lacking! I attempted my greatest to select thrilling options with out baseline assist.