How to use Blazor data binding or Blazor variable in an isolation css file?

子冬 林 1 Reputation point
2022-11-17T06:26:09.483+00:00

I can use @ to directly set value with a blazor variable on css style in a razor component.
Like:
261198-image.png

But how can I achieve the same thing in a isolation razor component css?
261090-image.png

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,396 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,766 Reputation points
    2022-11-17T16:32:22.347+00:00

    As the css is a static file you can not. Also the CSS file will only load once, so you can not change after load.

    Maybe you want to use SASS to build the css file.

    0 comments No comments