Is the Bootstrap SASS custom button invisible within tables or cards?

I recently revamped the btn-default style in Bootstrap 3 by adding some SCSS code. When I apply this button directly on a page, it looks fine. However, when I use it inside a table or a card, all I see is the border and text with a transparent background and blue font color instead of black.

Here is the code snippet that I added:

.btn-default {
    @extend .btn;
    border-color: #BCBCBC;
}

This is how I implement it:

<button type="button" id="btnReset" class="btn-default btn-sm">
    <span class="fas fa-sync-alt" aria-hidden="true"></span> Reset
</button>

UPDATE - SOLUTION

After considering the suggestions provided here, I made some adjustments to the code. While it's not an exact match to the original BS3 color, I decided to go for a slightly darker shade than what BS3 offers.

.btn-default {
    $color-bg: #DCDCDC;
    $color-border: #BCBCBC;
    $hover-bg: #BFBFBF;
    $active-bg: #BFBFBF;

    @include button-variant( $color-bg, $color-border, $hover-bg, darken($color-border, 10%), $active-bg, darken($color-border, 12.5%) );
}

Answer №1

When creating new button styles, utilizing the button-variant mixin provided in Bootstrap 4 is key.

As an example, here is how I designed a white button:

.btn-white {
    $color-bg: #ffffff;
    $color-border: $border-color;
    $hover-bg: #84898F;
    $active-bg: #84898F;

    @include button-variant(
            $color-bg,
            $color-border,
            $hover-bg,
            darken($color-border, 10%),
            $active-bg,
            darken($color-border, 12.5%)
    );
}

This will apply styling related to color solely to the button class while maintaining the appearance of a Bootstrap 4 button.

In Bootstrap 4, there isn't a feature that allows you to switch back the appearance of a specific button style to that of Bootstrap 3. This task would require manually applying the desired styles to the respective class.

Answer №2

This post is essentially a replica of: How to customize button text color in Bootstrap 4 and Sass?

Below is the specific method for customizing btn-default...

.btn-default {
    @include button-variant(#ffffff, #cccccc, #e6e6e6, #adadad, #e6e6e6, #adadad);
}

After this modification, it will take effect wherever it is utilized:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When using ReactJS, hovering over a row in a table should trigger a change in the background color of the corresponding row in another table with the same index

I need to create a feature where hovering over a row in the first table will highlight a corresponding row in the second table. The highlighting should be based on the index of the hovered row. Here is an example: <div> <table> < ...

Challenges with arranging bootstrap columns on a Wordpress archive page

I have a website that I created, with all the elements set up on one page to be added to different pages on my site. However, when I try to add videos to the archive page, the columns always appear stacked on top of each other instead of side by side like ...

Styling with CSS: The Art of Showcasing Initials or Images of Individuals

By following this elegant HTML and CSS example, I am able to showcase my initials over my photo. While this is wonderful, I would like the initials to be displayed only if the image does not exist; if the image is present, the person's initials shoul ...

Adding a uniform header and footer across all pages simultaneously in HTML

I am currently working on a project where I want to apply the same header and footer design from my homepage to all pages. However, I need a method that allows me to update the header and footer in one place, so that any changes I make will automatically r ...

Tips for extracting specific values from JavaScript using jQuery in ASP to be utilized in the C# code behind section

I want to extract the selected values from a multiselect jQuery and use them in the code behind in C#. The script sources can be found at the following link: https://github.com/nobleclem/jQuery-MultiSelect Below is the ASP code I am using: <div class ...

Unlocking the power of video.js integration with create-next-app in Next.js

I am currently having some difficulty with integrating Video.js in my create-next-app project, specifically in loading the video.js.css file. Here is a snippet of how my component is structured: import videojs from 'video.js' import videoStyles ...

What is the most crucial element to focus on when initially building a website?

I have recently embarked on the journey of learning various programming languages for web development, and I strongly believe that the best way to enhance my skills is by brainstorming ideas and bringing them to life through coding. (Please feel free to co ...

Tips for adding a red dot at the top-right corner of a necessary HTML input label, similar to an asterisk

Is there a way to replace the asterisk with a dot in an HTML label for a required input? The dot should be positioned in the top-right corner similar to where the asterisk would typically be. ...

Div tag stuck in place, no movement detected

I have organized my items within a div tag and am attempting to align the images and text horizontally so that they reach the maximum length of the page, overflowing into the next line and forming a horizontal list instead of a vertical one (at least, in t ...

Having trouble activating my Nav Toggle button on Bootstrap 4

My navbar toggle button isn't working and I'm not sure why. Could it be that I'm missing a class? Any help would be greatly appreciated as I've tried to find a solution on my own without success. Thanks <head> <meta charse ...

What could be causing the failure of loading CSS images or JS in my Laravel project?

This is a continuation of my previous question where I managed to get the site up and running. Initially, all files including css, js, and images were loading properly. However, now I am encountering issues as the files are not loading and the console disp ...

Scroll Bar Menu (User-Controlled)

I'm looking for any libraries out there that can replicate or provide a similar horizontal scrolling menu to that of espn.com's homepage. I'm relatively new to jquery and feeling a bit lost on where to begin. I did some searching on Google, ...

Modifying the style of the HTML placeholder tag

One approach I am taking involves utilizing a placeholder element within my search box input: <input id="searchBarTextbox" type="search" class="k-textbox" placeholder="Search For..." /> My challenge now is to enhance the aesthetics of the placehold ...

HTML files do not inherit from other HTML files

I am venturing into the world of VSCode for the first time to create a web application. Starting with the basics, I have an index.html page with a simple "Hello, world!" message. Additionally, I have developed a layout.html file that contains code for a na ...

Is there a way to assign a unique background color to the menu title based on each menu item or the specific article being viewed?

I've been working on a Joomla 2.5 based website and have a submenu with a title at the top, displaying the name of the top menu category. The title currently has a background color, but now I want to have a different background color for the title on ...

What is the best way to adjust the font size for a bootstrap-select dropdown menu?

I attempted to create a new CSS class to customize the appearance of the dropdown menu, but unfortunately, it doesn't seem to be taking effect. #form.py class fundForm(forms.Form): fund = forms.ChoiceField(choices=FUND, required=True, widget=for ...

Tips for avoiding my photobanner from being truncated on a webpage and ensuring there is an automatic scrollbar

My website used to have photobanners displayed horizontally with the ability to scroll through them, but after accidentally deleting some code, I realized that now the images are cut off at the edge of the webpage without a scrollbar. How can I restore the ...

What strategies can I use to ensure that the navigation bar is responsive when viewed on a

Check out my CSS file here for the navigation styling. See the screenshot of my HTML file showcasing the navigation panel here. I'm seeking assistance in making my navigation responsive on all mobile devices, as it is currently not functioning prope ...

Creating a responsive card layout in Bootstrap 4 that utilizes the vertical space of the viewport with a scrollbar

We are working on a page that has specific requirements: The page should not have a scroll bar. The card must expand vertically to fill the remaining space, even if there is no content in the card-body. We need a scroll bar for the card-body only when the ...

Creating a fixed sidebar in Bootstrap 3 that spans the full width of the column

I'm working with two columns - col-md-8 and col-md-4. In the second column, I have a fixed sidebar that I want to be 100% width of the col-md-4 column. The black box in the image below represents the second column. Despite trying setting the width to ...