Skip to content

Create a Tag Helper to make adding a CSS class to an element conditionally prettier #31

Description

@DamianEdwards

Something like this:

<h1 class-if-className="@Model.SomeBoolExpressionHere"></h1>

Some things to consider:

  • Translation of casing from attribute name to class name, e.g. camelCase -> kebab-case?, underscores vs. dashes in class names
  • Multiple uses on same Tag Helper, i.e. composition of multiple class name values into single attribute value output
  • Anything that will make @terrajobst happy

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions