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

Buttons: make .btn-secondary default state with transparent background #2004

Merged
merged 8 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
9 changes: 8 additions & 1 deletion scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,14 @@
// scss-docs-end btn-variant-loops
// End mod

// Boosted mod: no .btn-outline
// Boosted mod: only secondary variant
.btn-outline-secondary {
@include button-variant(transparent, $black, $black, $disabled-background: $white, $disabled-border: $gray-500, $disabled-color: $gray-500);
julien-deramond marked this conversation as resolved.
Show resolved Hide resolved
&.btn-inverse {
@include button-variant(transparent, $white, $white, $white, $white, $black, $primary, $primary, $black, transparent, $gray-700, $gray-700, $black);
}
}
// End mod

// Boosted mod: border-only on :hover and :active
.btn-no-outline {
Expand Down
11 changes: 10 additions & 1 deletion site/content/docs/5.3/components/buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,17 @@ When using button classes on `<a>` elements that are used to trigger in-page fun
<input class="btn btn-primary" type="reset" value="Reset">
{{< /example >}}

<!-- Boosted mod: No outline buttons -->
## Outline buttons

In need of a button with a transparent default background color? Replace the default modifier classes with the `.btn-outline-secondary` one to remove all background colors on buttons.

{{< example class="bg-supporting-blue" >}}
<button type="button" class="btn btn-outline-secondary">Secondary</button>
{{< /example >}}

{{< callout info >}}
This button should only be used on a light background in order to have sufficient contrast, otherwise use its dark variant.
{{< /callout >}}

## Sizes

Expand Down
3 changes: 3 additions & 0 deletions site/content/docs/5.3/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ Learn more by reading the new [color modes documentation]({{< docsref "/customiz

- <span class="badge bg-warning">Deprecated</span> The `.alert-variant()` mixin is now deprecated. We now [use a Sass loop]({{< docsref "/components/alerts#sass-loops" >}}) directly to modify the component's default CSS variables for each variant.

- **Buttons**
- <span class="badge bg-success">New</span> Outlined button `.btn-outline-secondary` is now provided. It is basically `.btn-secondary` with default transparent background.

- **Cards**
- Cards now have a `color` set on them to improve rendering across color modes.

Expand Down