Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ava-cassiopeia
Copy link
Contributor

@ava-cassiopeia ava-cassiopeia commented Aug 20, 2025

This allows for users to compose together a ClassList object dynamically. For example:

override render() {
  const classes: ClassInfo = {
    'class1': true,
    'class2': true,
  };
  // Conditionally add another class
  if (condition) classes['class3'] = true;

  // use it
  const containerClasses = classMap(classes);
  
  // etc.
}

Closes #5024

@changeset-bot
Copy link

changeset-bot bot commented Aug 20, 2025

🦋 Changeset detected

Latest commit: 386bcb9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
lit Patch
lit-element Patch
lit-html Patch
@lit/reactive-element Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ava-cassiopeia ava-cassiopeia changed the title Add MutableClassList as a complement to ClassList Make ClassList mutable Aug 20, 2025
@ava-cassiopeia ava-cassiopeia marked this pull request as ready for review August 20, 2025 20:17
@justinfagnani justinfagnani changed the title Make ClassList mutable [lit-html] Make ClassInfo mutable Aug 21, 2025
@justinfagnani
Copy link
Collaborator

Thanks @ava-cassiopeia!

@justinfagnani justinfagnani merged commit 0d0170e into lit:main Aug 22, 2025
1 check passed
@lit-robot lit-robot mentioned this pull request Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[lit-html] Provide write-able version of ClassInfo

2 participants