TagHelperPack icon indicating copy to clipboard operation
TagHelperPack copied to clipboard

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

Open DamianEdwards opened this issue 4 years ago • 0 comments

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

DamianEdwards avatar Nov 24 '20 00:11 DamianEdwards