Description
Motivation:
CSS for a popular CDN package Bootstrap Icons consists entirely of pseudo-element definitions, such as below:
.bi::before {
display: inline-block;
font-family: bootstrap-icons !important;
...
}
The current implementation of the ASP.NET fallback tester offers no support for pseudo-elements, because the JavaScript for the tester calls a single-parameter overload of getComputedStyle
. To test pseudo-elements, we need to pass the name of the the pseudo-element to be tested as a second parameter of getComputedStyle
.
Solution:
We add support for testing pseudo-elements by setting an asp-fallback-test-pseudo-element
attribute:
...
asp-fallback-test-class="bi"
asp-fallback-test-pseudo-element="before"
...
We then pass the value of the asp-fallback-test-pseudo-element
as the second parameter to the fallback tester function, which then forwards it to getComputedStyle
; if no value is specified, we pass null
.