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

Developer technologies | .NET | Blazor
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 81,981 Reputation points Volunteer Moderator
    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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.