<Styled @bind-Classname="@p1">
    font-size: 30px;
</Styled>

<Styled Classname="@p1" MediaQuery="MediaQueries.LargerThanMobile">
    font-size: 50px;
</Styled>

<p class="@p1">Some text!</p>

@code {
    private string p1;
}