C
C#16mo ago
happy_nips

❔ Best way to Blazor/CSS and Terminology clarifications

Hey, new to Blazor new to CSS and can't google my way though it. Anything wrapped " I'm unclear on the correct terminology I've get a "conditionally" css style to work, while trying to convert a tutorial in html, css and .js to blazor. The "variable" data-nav woks and by button changes color when the bool is 'True'. Is there a more "Blazor" way to do this?
2 Replies
blinkbat
blinkbat16mo ago
use a <details> elem this behavior is in native html5 you can do this more directly,
@if (ShowNav)
{
// nav content
}

<button id="nav-toggle" class="@(ShowNav ? "active" : "")" ...
@if (ShowNav)
{
// nav content
}

<button id="nav-toggle" class="@(ShowNav ? "active" : "")" ...
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.