Skip to content

fix(BButton): Consume useColorVariantClasses #2640

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

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

dwgray
Copy link
Member

@dwgray dwgray commented Apr 3, 2025

Describe the PR

When I was documenting and fixing up useColorVariantClasses, I missed the fact that BButton didn't actually consume that composible. This fixes that oversight.

Fixes #2637

Small replication

<template>
  <BRow
    ><BCol>Set 'variant': <BButton variant="success"> testing </BButton></BCol></BRow
  >
  <BRow
    ><BCol>Set 'bg-variant': <BButton bg-variant="info"> testing </BButton></BCol></BRow
  >
  <BRow
    ><BCol
      >Set 'text-variant' (background is 'secondary' since 'variant' defaults to 'secondary'):
      <BButton text-variant="info"> testing </BButton></BCol
    ></BRow
  >
  <BRow
    ><BCol
      >Set 'text-variant' and 'bg-variant':
      <BButton text-variant="primary" bg-variant="danger"> testing </BButton></BCol
    ></BRow
  >
  <BRow
    ><BCol
      >Set all three - 'variant' is overridden by 'bg-variant' and 'text-variant':
      <BButton text-variant="primary" bg-variant="danger" variant="success">
        testing
      </BButton></BCol
    ></BRow
  >
</template>

PR checklist

What kind of change does this PR introduce? (check at least one)

  • Bugfix 🐛 - fix(...)
  • Feature - feat(...)
  • ARIA accessibility - fix(...)
  • Documentation update - docs(...)
  • Other (please describe)

The PR fulfills these requirements:

  • Pull request title and all commits follow the Conventional Commits convention or has an override in this pull request body This is very important, as the CHANGELOG is generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be denied

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

pkg-pr-new bot commented Apr 3, 2025

bsvn-vite-ts

npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next@2640
npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next/@bootstrap-vue-next/nuxt@2640

commit: 1376d9e

@VividLemon
Copy link
Member

Its not documented in bootstrap that they use these classes. They only mention btn-variant as a class

@dwgray
Copy link
Member Author

dwgray commented Apr 4, 2025

Its not documented in bootstrap that they use these classes. They only mention btn-variant as a class

Interesting. My reading of this section is that these classes are generally supported within BS. They are explicitly documented on some components, such as badge, but not in many of the places we're already applying useColorVariantClasses unless I'm missing something.

@VividLemon VividLemon merged commit 379fd9a into bootstrap-vue-next:main Apr 8, 2025
4 checks passed
@github-actions github-actions bot mentioned this pull request Apr 8, 2025
dwgray added a commit to dwgray/bootstrap-vue-next that referenced this pull request Apr 9, 2025
VividLemon pushed a commit that referenced this pull request Apr 9, 2025
* Revert "fix(BButton): Consume useColorVariantClasses (#2640)"

This reverts commit 379fd9a.

* docs(BButton): remove reference to non-existent props
@dwgray dwgray deleted the button-variants branch April 22, 2025 16:44
xvaara added a commit to xvaara/bootstrap-vue-next that referenced this pull request Apr 28, 2025
* upstream/main: (184 commits)
  fix(BDropdown): don't calulcate the position when dropdown is not shown.
  docs(BTable): complete documentation for table items provider (bootstrap-vue-next#2662)
  fix(BPagination): right/left/up/down arrow keys now operating better after new page chosen (bootstrap-vue-next#2665)
  add the check to hide as well
  fix(useShowHide): don't run show if component already unmounted (ie. BPopover)
  fix(BAccordionItem): fix initial modelValue
  feat(BModal)!: remove autofocus and autofocusButton props and add more versitile focus prop feat(BOffcanvas)!: remove nofocus prop and add more versitile focus prop feat(BModal): return focus to previous element on close feat(BOffcanvas): return focus to previous element on close fix(BModal): set focus only once
  chore: release main (bootstrap-vue-next#2659)
  bth and btd scope attribute updates and bpagination li element needs presentation role (bootstrap-vue-next#2646)
  feat(BBreadcrumb): allow it to use individual breadcrumb trails with useBreadcrumb by passing prop id to component and id param to composable fixes bootstrap-vue-next#2630
  Revert "fix(BButton): Consume useColorVariantClasses (bootstrap-vue-next#2640)" (bootstrap-vue-next#2654)
  chore: release main fixes bootstrap-vue-next#2643
  feat(BTable): Expose additional functions and document them (bootstrap-vue-next#2632)
  fix(BButton): Consume useColorVariantClasses (bootstrap-vue-next#2640)
  docs(BButton): Outline variant example (bootstrap-vue-next#2639)
  fix(BTab): error in recursion (bootstrap-vue-next#2624)
  fix(BTable): correct multi-sort to not update sortby in place (bootstrap-vue-next#2644)
  Update BDropdownForm.vue (bootstrap-vue-next#2635)
  doc(BTable): Fill out light-weight, helper component and accessibility sections (bootstrap-vue-next#2629)
  chore: release main (bootstrap-vue-next#2626)
  ...
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.

BButton doesn't support text-variant/bg-variant
2 participants