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

Added multi class functionality #907

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

mikebronner
Copy link

Description

This PR attempts to implement allowing multi-class configs for all elements across the board.

    classNames: {
      containerOuter: 'choices',
      containerInner: 'choices__inner class2 class3', //this works for any of these className options
      input: 'choices__input',
      inputCloned: 'choices__input--cloned',
      list: 'choices__list',
      listItems: 'choices__list--multiple',
      listSingle: 'choices__list--single',
      listDropdown: 'choices__list--dropdown',
      item: 'choices__item',
      itemSelectable: 'choices__item--selectable',
      itemDisabled: 'choices__item--disabled',
      itemChoice: 'choices__item--choice',
      placeholder: 'choices__placeholder',
      group: 'choices__group',
      groupHeading: 'choices__heading',
      button: 'choices__button',
      activeState: 'is-active',
      focusState: 'is-focused',
      openState: 'is-open',
      disabledState: 'is-disabled',
      highlightedState: 'is-highlighted',
      selectedState: 'is-selected',
      flippedState: 'is-flipped',
      loadingState: 'is-loading',
      noResults: 'has-no-results',
      noChoices: 'has-no-choices'
    },

Types of changes

  • Chore (tooling change or documentation change)
  • Refactor (non-breaking change which maintains existing functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@Matth10
Copy link

Matth10 commented Oct 1, 2020

@mikebronner I opened a PR to solve this issue 2month ago. #889. But this lib doesn't seem to be maintained anymore.

@mikebronner
Copy link
Author

HI @Matth10, yea I saw that :) I updated additional code that your PR didn't cover. :)
But I have moved on as well, I could not get this package to work well with tailwind at all, because it relies on nested CSS class rules for formatting. I ended up building my drop-down from scratch.

@Matth10
Copy link

Matth10 commented Oct 1, 2020

But I have moved on as well, I could not get this package to work well with tailwind at all, because it relies on nested CSS class rules for formatting. I ended up building my drop-down from scratch.

Yes this is exactly our cases. And I think I will also end up building my own one too.

@ju5t
Copy link

ju5t commented Jan 28, 2021

@Matth10 @mikebronner what did you guys end up with?

@mikebronner
Copy link
Author

@ju5t I needed up writing my own from scratch.

@mtriff
Copy link
Member

mtriff commented Dec 19, 2021

This would be great functionality to add. If you are still interested in getting this merged, I think it makes more sense to require multiple classes be provided as an array instead of doing all the string splitting internally.

If you aren't interested in making the change anymore just let us know.

@mikebronner
Copy link
Author

@mtriff Sorry, we have moved on at this point. If you would like to continue working on this PR and refining it, that would be great.

@mtriff mtriff linked an issue Dec 22, 2021 that may be closed by this pull request
@mtriff mtriff added the changes required Pull request requires changes before it can be merged label Jan 13, 2022
@gaetan-hexadog
Copy link

hi @mtriff ,

I just made the PR #1074 to finalize this feature.
Tell me if you need some changes.

regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes required Pull request requires changes before it can be merged help wanted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Class names can't contain spaces
5 participants