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

CSS Classname API for CB/MSCB items #5212

Closed
1 of 14 tasks
rolfsmeds opened this issue Apr 5, 2024 · 0 comments
Closed
1 of 14 tasks

CSS Classname API for CB/MSCB items #5212

rolfsmeds opened this issue Apr 5, 2024 · 0 comments
Labels
acceptance criteria used for the acceptance criteria checklist DS Design System feature (e.g. component) V24.5

Comments

@rolfsmeds
Copy link
Collaborator

rolfsmeds commented Apr 5, 2024

Description

An API for applying CSS classnames to items in Combo Box and Multi-Select Combo Box, for individual styling of dropdown items and MSCB chips.

Acceptance criteria

  • Item classname generator API:
    • Java: setClassNameGenerator(SerializableFunction<T,String>)
    • WC/React: itemClassNameGenerator: ItemClassNameGenerator
  • Applies classnames to
    • vaadin-combo-box-items
    • vaadin-multi-select-combo-box-items
    • vaadin-multi-select-combo-box-chips

Code example

Java:

var mscb = new MultiSelectComboBox<Person>();
mscb.setClassNameGenerator(person -> {
  return person.getGender().toString().toLowerCase();
});

CSS:

vaadin-multi-select-combo-box-chip, vaadin-multi-select-combo-box-item {
  &.male {
    background: cornflowerblue;
  }
  &.female {
    background: lightpink;
  }
  &.other {
    background: lightgrey;
  }
}

General criteria

  • APIs reviewed
  • Performance
  • UX/DX tests in Alpha
  • Documentation:
  • How to test?
  • Limitations:

Security

  • Security implications have been taken into account (elaborate or link to product security requirement specification if there are implications)
@rolfsmeds rolfsmeds added acceptance criteria used for the acceptance criteria checklist DS Design System feature (e.g. component) labels Apr 5, 2024
@rolfsmeds rolfsmeds added this to Roadmap May 6, 2024
@rolfsmeds rolfsmeds moved this from Under consideration to June 2024 in Roadmap May 6, 2024
@github-project-automation github-project-automation bot moved this to Under consideration in Roadmap May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acceptance criteria used for the acceptance criteria checklist DS Design System feature (e.g. component) V24.5
Projects
Status: September 2024 (24.5)
Development

No branches or pull requests

2 participants