mercredi 28 octobre 2020

Button text color is not changing to white in SCSS code

I was practicing my CSS(SCSS) at codepen link: https://codepen.io/zubaer41/pen/XWKzomo?editors=1100 but there is a problem I faced and couldn't fix it. There are two buttons that should appear and the text in them should be white. I can change the background color of the buttons but I can't make the button text color white even though I couldn't find any reason why it's happening. HELP PLEASE !!
//==== HTML & CSS(SCSS) CODE ====


    <nav >
      <ul class="navigation">
        <li><a href="#">About us</a></li>
        <li><a href="#">Pricing</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
      <div class="button">
        <a class="btn-main" href="#">Sign up</a>
        <a class="btn-hot" href="#">Get a quote</a>
      </div>
    </nav>```
      
    
    =========================================================
    =================== CSS (SCSS) CODE =====================
    =========================================================
    
    ```* {
      margin: 0;
      padding: 0;
    }
    
    $color-primary: #f9ed69; //yellow color
    $color-secondary: #f08a5d; //orange color
    $color-tertiary: #b83b5e; //pink color
    $color-text-dark: #333;
    $color-text-light: #eee;
    
    $width-button: 150px;
    
    @mixin clearfix {
         &::after {
        content: "";
        clear: both;
        display: table;
      }
    }
    
    @mixin style-link-text($color) {
      text-decoration: none;
      text-transform: uppercase;
      color: $color;
    }
    
    @function divide($a, $b) {
      @return $a / $b;
    }
    
    nav {
      margin: divide(60, 2) * 1px;
      background-color: $color-primary;
      
      @include clearfix;
    }
    
    .navigation {
      list-style: none;
      float: left;
      
      li {
        display: inline-block;
        margin-left: 30px;
        margin-top: 10px;
        
        &:first-child {
        margin: 10px;
        }
        
        a {
          @include style-link-text($color-text-dark);
        }
      }
    }
    
    .button {
      float: right;
    }
    
    %btn-placeholder {
      padding: 10px;
      display: inline-block;
      text-align: center;
      border-radius: 100px;
      width: $width-button;
      @include style-link-text($color-text-light);
    }
    
    .btn-main {
      &:link {
        @extend %btn-placeholder;
        background-color: $color-secondary;
      }
      
      &:hover {
        background-color: darken($color-secondary, 10%);
      }
    }
    
    .btn-hot {
      &:link {
        @extend %btn-placeholder;
        background-color: $color-tertiary;
      }
      
      &:hover {
        background-color: lighten($color-tertiary, 10%);
      }
    }```




Aucun commentaire:

Enregistrer un commentaire