#104011
ivanpeevski
Participant

Hi Patrick,

The Blazor CSS Isolation works by attaching a random attribute to the HTML element that works as a selector. However, our controls are generated dynamically and then selector key is lost. The trick is to wrap the blazor controls in a normal HTML element such as div, span or p. In this way, the selector key will be attached to the wrapper HTML and the inner controls will remain selectable. For example:

 

parent.razor:

<Child/>

 

child.razor:

<div><Button>Test</Button></div>

 

child.razor.css:

::deep smart-button {
  background: red;
}

OR(if you wish to be more specific):

div ::deep smart-button {
  background: red;
}

 

This creates a red button. I hope this was of help!

Please feel free to contact us again, if you need further support

Best Regards,
Ivan Peevski

Smart UI Team
https://www.htmlelements.com/