MDN doc updates for progressive web apps, WebGPU & WebTransport APIs, and CSS selectors and media queries.

MDN doc updates for progressive web apps: The team at MDN has been working diligently to keep our documentation current for all of you in light of the rapid advancements in open web technologies across different browsers, along with our partners at Open Web Docs and our contributors.

We are happy to report that the MDN docs have received a number of noteworthy updates. In this article, we’ll talk about a few of MDN’s most important updates and additions.

Syntax in CSS:

In order to give you more options, a new feature has been added to two CSS pseudo-classes: the new syntax, which can be used with the:nth-child() and:nth-last-child() pseudo-classes.

When using these pseudo-classes up until now, you could choose siblings by specifying their place in the group, such as by specifying even, odd, or the notation An+B. Using the syntax, you can target elements based on their even, odd, or An+B positions to further reduce the number of elements you can choose from. Firefox and Safari currently support this syntax. A preview of how to use this new syntax is provided here:.

In a list of 10 items, use the An+B notation.

“li:nth-child(-n + 3)”.

The first three list items should be styled as follows.

}.

using the 10-item list in An+B notation with of.

Assuming the second and fifth list items have the status of important.

nth-child(-n + 3 of . important), li.

The second and fifth items on the list should use the following styles.

}.

The CSS content property’s value:

There is now more widespread support among browsers for adding an image-set() and to the value that can be specified with the content property.

Check out the updated examples Dave added to demonstrate how to use url(), image-set(), and other functions to replace the content of an element with a different data type.

In the CSS:lang() pseudo-class, string matching.

The:lang() pseudo-class in Firefox can now match language codes using string-matching semantics, including * wildcards, rather than prefix-matching semantics. Also supported for matching multiple languages are lists of languages separated by commas. Isn’t this fantastic:.

CSS.

paste to the clipboard.

matches both nl and de.

:lang(“nl”, “de”).

colour: green.

}.

The:lang() page has been updated by Brian Smith with all the new parameter information and a few intriguing examples.

Media features in CSS:

You can determine if a user has enabled the device setting to reduce the amount of transparent or translucent layer effects by using the experimental new CSS media feature prefers-reduced-transparency. Currently, only Firefox has access to this feature. For adding this new reference page for us, we are grateful to CanadaHonk.

Here is a quick screenshot of this feature:.

CSS.

Copy to the clipboard.

@media (prefers-reduced-transparency).

.s of translucent color.

0 point 8 for opacity.

}.

}.

In order to reflect the fact that Firefox now fully supports scripting media, Dipika Bhattacharya updated the feature. But because it is only supported by one browser, the feature is still essentially in experimental mode. This media query allows you to style your CSS based on whether scripting, such as JavaScript, is present on the current document, only when the page first loads, or not at all.

Similar to how inverted-colors support has been added, it is available only by setting a flag (layout) in Firefox.

inverted colors in CSS.

enabled).

If your operating system or user agent has inverted all colors, you can tell using the inverted-colors media query.

In the CSS:lang() pseudo-class, string matching:

The:lang() pseudo-class in Firefox can now match language codes using string-matching semantics, including * wildcards, rather than prefix-matching semantics. Also supported for matching multiple languages are lists of languages separated by commas. Isn’t this fantastic:.

CSS.

paste to the clipboard.

matches both nl and de.

:lang(“nl”, “de”).

colour: green.

}.

The:lang() page has been updated by Brian Smith with all the new parameter information and a few intriguing examples.

How To Convert PDF Online & Free?

Media features in CSS:

You can determine if a user has enabled the device setting to reduce the amount of transparent or translucent layer effects by using the experimental new CSS media feature prefers-reduced-transparency. Currently, only Firefox has access to this feature. For adding this new reference page for us, we are grateful to CanadaHonk.

Here is a quick screenshot of this feature:.

CSS.

Copy to the clipboard.

@media (prefers-reduced-transparency).

.s of translucent color.

0 point 8 for opacity.

}.

}.

In order to reflect the fact that Firefox now fully supports scripting media, Dipika Bhattacharya updated the feature. But because it is only supported by one browser, the feature is still essentially in experimental mode. This media query allows you to style your CSS based on whether scripting, such as JavaScript, is present on the current document, only when the page first loads, or not at all.

Similar to how inverted-colors support has been added, it is available only by setting a flag (layout) in Firefox.

inverted colors in CSS.

enabled).

If your operating system or user agent has inverted all colors, you can tell using the inverted-colors media query.

Summary:

I hope these updates were helpful and gave you some insight into what the MDN team, our partners, and contributors are up to online. In the upcoming weeks, keep an eye out for more similar updates (psst CSS nesting).

If you have any comments or inquiries regarding this post, please let us know. If you’d like to participate in the conversation, feel free to join the MDN Web Docs Discord server or post a comment on the MDN GitHub discussion.

Top 4 Paraphrasing Tools to Rephrase Sentences

Leave a Comment