C
C#2y 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
blinkbat2y 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
Accord2y 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.
Want results from more Discord servers?
Add your server