chanan / BlazorStyled

CSS in Blazor Components
https://blazorstyled.io
The Unlicense
191 stars 19 forks source link

Generated class names #80

Closed nicucomiati990 closed 4 years ago

nicucomiati990 commented 4 years ago

Is there a way to control the generated class names? I would prefer having an understandable class instead of it being all generated. I saw this on blazorstyled.io and thought that it might be possible.

chanan commented 4 years ago

Sorry, I didnt see this till now.

BlazorStyled (like Glamor, Glamorous and Emotion in the JS world) control the class name to work. However you can add a label to the css that will be appended to your classname:

<Styled @Bind-Classname="@MyClass">
  label: some-label;
  color: red;
</Styled>

This will generate a class with the words "-some-label" appended at the end of it.