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

.btn-link shouldn't have a gradient when they're enabled #37077

Closed
mdo opened this issue Sep 2, 2022 Discussed in #36998 · 0 comments · Fixed by #37078
Closed

.btn-link shouldn't have a gradient when they're enabled #37077

mdo opened this issue Sep 2, 2022 Discussed in #36998 · 0 comments · Fixed by #37078
Labels

Comments

@mdo
Copy link
Member

mdo commented Sep 2, 2022

Discussed in #36998

Originally posted by jon48 August 21, 2022
Hello,

Following the buttons refactoring in v5.2, there is a change of default behaviour on the btn-link buttons, which I find quite undesirable, and have not found a native way to neutralise.

Basically, from 5.2, all btn buttons have a gradient defined, and applied when compiling with $enable-gradients: true;. That was not the case in 5.1.3, so even if gradients were enabled, only the buttons with background (btn-primary, btn-secondary...) had the gradient and btn-link was left with a "flat" design, which I think is more appropriate.

To reproduce the error, I have the minimal following code.

SCSS:

$enable-gradients: true;

@import "../node_modules/bootstrap/scss/bootstrap";

.testarea {
    background-color: tan;
}

HTML:

<div class="container">
   <div class="row">
      <div class="col">
         <h2 class="font-weight-light">Bootstrap 5.2</h2>
         <div class="testarea">
             <button class="btn btn-dark m-2">Dark</button><br>
             <button class="btn btn-link m-2">Link</button>
         </div>
     </div>
   </div>
</div>

When running with Bootstrap 5.1.3, I get the following output (with gradient on Dark and no gradient on Link):
image
When running with Bootstrap 5.2.0, I get the following output (with gradients on both Dark and Link)
image
I have not found a flag in Bootstrap to restore the previous behaviour or apply the gradient more specifically, and could only think of applying the following in my custom SCSS after importing Bootstrap. Should I stick with this "hack" or raise an issue?

.btn-link {
    background-image: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant