Can't get the code to work! 6. Variables in Sass


#1



https://www.codecademy.com/en/courses/learn-sass/lessons/hello-sass/exercises/variables?action=resume


I am not sure what I am doing wrong. Can someone please help?


@import url(https://fonts.googleapis.com/css?family=Pacifico);
//Add variables here:
$translucent-white: rbga(255,255,255,0.3);

h1 {
  font-family: Roboto, sans-serif;
  text-align: center;
}

.banner {
  border : {
    top: 4px solid black;
    bottom: 4px solid black;
  }
  font-family: 'Pacifico', cursive;
  height: 400px;
  background-image: url("lemonade.jpg");
  .slogan {
    position: absolute;
    border: 4px solid black;
    top: 200px;
    left: 25%;
    width: 50%;
    height: 200px;
    background-color: $translucent-white;
    text-align: center;
    span {
      font-size: 24px;
      line-height: 200px;
    }
    
  }
}

.container {
  text-align: center;
  font-family: 'Pacifico', cursive;
  .icon {
    display: inline-block;
    margin: 2%;
    border: 4px solid black;
    font-size: 32px;
  }
}


#2

Typo,,,

$translucent-white: rgba(255,255,255,0.3);

#3

Aside

The compiled CSS has two linter warnings. We can avert those warnings while we're here...

  1. Not all user agents can be trusted to support rgba (alpha channel). A default background-color property is recommended
  2. @import hogs the download channel and does not permit asynchronous downloading of files.

We can address #1 with,

    background-color: white;               /* non-alpha state */
    background-color: $translucent-white;

And #2 with,

<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Pacifico">

in index.html , and remove,

@import url(https://fonts.googleapis.com/css?family=Pacifico);

from main.scss.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.