Skip to content

Commit

Permalink
CSS specificity is supported in .NET 9 SR4.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbritch committed Feb 18, 2025
1 parent 0018246 commit 92cdea7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/user-interface/styles/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,19 @@ The following selectors are unsupported:
- `@media` and `@supports`
- `:` and `::`

::: moniker range="=net-maui-8.0"

> [!NOTE]
> Specificity, and specificity overrides are unsupported.
::: moniker-end

::: moniker range=">=net-maui-9.0"

If two or more CSS rules point to the same element, the selector with the highest specificity will take precedence and its style declaration will be applied to the element. The [specificity algorithm](https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/StyleSheets/Selector.cs#L319) calculates the weight of a CSS selector to determine which rule from competing CSS declarations gets applied to the element.

::: moniker-end

## Property reference

The following CSS properties are supported by .NET MAUI (in the **Values** column, types are *italic*, while string literals are `gray`):
Expand Down

0 comments on commit 92cdea7

Please sign in to comment.