Reputation: 101
In a Blazor component library, we can style a component in isolation using:
ComponentName.razor.css
This isolation of style is great, however, I want that to be the fallback style while allowing a user of the component library to point to a different stylesheet to use when they are using the component in their app.
How can we have both the default css isolation for a component AND optionally allow a user of the component library to override that by specifying their own external css file?
Upvotes: 0
Views: 631
Reputation:
It's not a full solution but maybe it can point You into the right direction. You can use "style" attribute, it will override default CSS:
<button style="@newCss">some button</button>
<input @bind="newCss"/>
@code
{
string newCss = string.Empty;
}
Upvotes: 1