Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DamianEdwards opened this issue Nov 24, 2020 · 0 comments

Comments

@DamianEdwards
Copy link
Owner

DamianEdwards commented Nov 24, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant