8000 Revert "fix(BButton): Consume useColorVariantClasses (#2640)" by dwgray · Pull Request #2654 · bootstrap-vue-next/bootstrap-vue-next · GitHub
[go: up one dir, main page]

Skip to content

Revert "fix(BButton): Consume useColorVariantClasses (#2640)" #2654

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/src/data/components/button.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
default: 'secondary',
},
}),
['bgVariant', 'size', 'tag', 'textVariant', 'variant']
['size', 'tag', 'variant']
),
} satisfies Record<
Exclude<keyof BvnComponentProps['BButton'], keyof typeof linkProps>,
Expand Down
6 changes: 0 additions & 6 deletions apps/docs/src/docs/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ padding and size of a button.

**Tip:** remove the hover underline from a link variant button by setting `underline-opacity="0"`.

::: warning Interactions between Variant props
`BButton` implements `bg-variant` and `text-variant` to provide finer control of colors, they take
precedence over the `variant` prop. See the
[Color Variant Reference](/docs/reference/color-variants#variant-interactions) for details.
:::

## Block level buttons

Create responsive stacks of full-width, “block buttons” by wrapping the button(s) in a div and specifying
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/src/docs/reference/color-variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ $dark: $gray-900;
</template>
</HighlightCard>

<script setup lang="ts">
import {BCard} from 'bootstrap-vue-next'
import HighlightCard from '../../components/HighlightCard.vue'

</script>

<style lang="scss">
.bg-body-tertiary [class^="border"] {
display: inline-block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ import {useLinkClasses} from '../../composables/useLinkClasses'
import {onKeyStroke} from '@vueuse/core'
import type {BButtonProps} from '../../types/ComponentProps'
import {useDefaults} from '../../composables/useDefaults'
import type {BorderColorVariant, ColorExtendables, ColorVariant} from '../../types/ColorTypes'
import {useColorVariantClasses} from '../../composables/useColorVariantClasses'
import type {ColorVariant} from '../../types/ColorTypes'

defineSlots<{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down Expand Up @@ -142,14 +141,10 @@ const linkValueClasses = useLinkClasses(
: undefined),
}))
)
const colorClasses = useColorVariantClasses(
props as ColorExtendables & {borderVariant?: BorderColorVariant | null}
)

const computedClasses = computed(() => [
variantIsLinkType.value === true && computedLink.value === false
? linkValueClasses.value
: colorClasses.value,
: undefined,
[`btn-${props.size}`],
{
[`btn-${props.variant}`]: props.variant !== null && variantIsLinkTypeSubset.value === false,
Expand Down
4 changes: 1 addition & 3 deletions packages/bootstrap-vue-next/src/types/ComponentProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,7 @@ type CustomLinkVariant = {
[K in ColorVariant as `link-${K}`]: unknown
}

export interface BButtonProps
extends Omit<BLinkProps, 'variant'>,
Omit<ColorExtendables, 'variant'> {
export interface BButtonProps extends Omit<BLinkProps, 'variant'> {
loading?: boolean
loadingFill?: boolean
loadingText?: string
Expand Down
Loading
0