chanan / BlazorStyled

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

Media Queries compile error #90

Closed esso23 closed 4 years ago

esso23 commented 4 years ago

Can't compile project when using media queries. Am I doing something wrong?

Code:

<Styled @bind-Classname="@ExtraSmallOnlyClass">
    @media (min-width:0px) and (max-width:599.95px) {
        display: none;
    }
</Styled>

Error:

1>...\Component1.razor(2,6,2,11): error CS0103: The name 'media' does not exist in the current context

Based on docs: https://blazorstyled.io/media

chanan commented 4 years ago

Because the @ sign is the razor symbol, you need to “encode it” by putting two @ signs: @@media

esso23 commented 4 years ago

Oh, thanks. Will you update the docs or can I close the issue?

chanan commented 4 years ago

I will close it. I have an issue already open to review all the docs for accuracy when I publish the next version