Closed KRXTCH closed 3 years ago
@KRXTCH thanks for contacting us.
That's by design. CSS Isolation applies to HTML elements, not components. Otherwise you would be able to alter the styles of an isolated component from outside of it, which defeats the purpose.
Our recomendation is that you wrap the component in a tag on the consuming side of things and use a parent selector to apply styles to it.
@javiercn thanks for your answer.
I wrapped the EditForm component using div like you mentioned. This case don't seems to be in the documentation, it will be cool to have it 😃.
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.
See our Issue Management Policies for more information.
Hello,
I found a bug on Blazor Css Isolation, the css seems not working on EditForm component.
Describe the bug
When I try to apply css on EditForm using css isolation, the style is not applied and the generated ID is not set to the form element.
As you can see, the first form does not have the ID, but the next form and the div with class "working-cssIsolation" have it.
To Reproduce
Just create a Blazor Server project and try to add css on an EditForm conponent using css isolation.
Index.razor
Index.razor.css
Exceptions (if any)
Expect to css isolation works with EditForm component
Further technical details