Skip to content

Can SCSS Replace Classes? #500

Answered by crftwrk
cahoskins asked this question in Q&A
Jun 6, 2023 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Sure, here is a rough example how to target classes inside the #masthead wrapper. You need !important to override Bootstrap utilities.

  • navbar-secondary does not exist
  • Don't know what you did with navbar-brand, but override display utilities with !important
  • offcanvas-title has already margin-bottom: 0;, no need to add mb-0 class
#masthead {

  // Navbar bg
  .bg-light {
    background-color: var(--#{$prefix}secondary) !important;
  }

  // Nav links
  .nav-link {
    color: $navbar-dark-color;

    &:hover,
    &:focus {
      color: $navbar-dark-hover-color;
    }

    .active {
      color: $navbar-dark-active-color;
    }
  }

  // Offcanvas
  #offcanvas-navbar {

    .offcanvas-body

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@cahoskins
Comment options

Answer selected by cahoskins
Comment options

You must be logged in to vote
1 reply
@crftwrk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants