aspnetcore: CSS link helper tag with fallback class not working with subclasses
The bootstrap-dialog.css stylesheet does not have any classes that are single non subclasses. The below taghelper is not working.
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.35.4/css/bootstrap-dialog.min.css"
asp-fallback-href="~/lib/bootstrap3-dialog/dist/css/bootstrap-dialog.min.css"
asp-fallback-test-class="bootstrap-dialog modal-header"
asp-fallback-test-property="border-top-left-radius"
asp-fallback-test-value="4px" />
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (12 by maintainers)
Yes, I agree that inspecting
document.styleSheets
is most likely the most direct solution here.If we really wanted to keep the existing “feature detection”-style approach, we could change the API to let developers provide the ID of an element that matches one of the selectors used in the stylesheet, then we check whether the expected style property has been applied to it. But checking
document.styleSheets
would be simpler.