6/9 Sass Mixens and the & Selector


#1

Hello,

I cannot get around 6/9 of Mixens and the & selector. I always get this notice:
Did you include the $stripes mixin and pass in a list defining the arguments as to bottom, 15%, blue, white inside of .definition in main.scss?

I see that others have te same problems, it seems that Chrome browser preferable for Codecademy, but still problems, the full code:

Hope that someone can give insight.

$stripe-properties:to bottom, 15%, blue, white;

@mixin transition($time){
transition: $time;
-webkit-transition: $time;
-moz-transition: $time;
-o-transition; $time;
}

@mixin transform-style($style){
transform-style: $style;
-moz-transform: $style;
-o-transform-style: $style;
-ms-transform-style: $style;
-webkit-transform-style: $style;
}

@mixin backface-visibility ($visibility:hidden) {

//Add an argument
backface-visibility: $visibility;
-webkit-backface-visibility: $visibility;
-moz-backface-visibility: $visibility;
-ms-backface-visibility: $visibility;
-o-backface-visibility: $visibility;
}

@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF) {
background: repeating-linear-gradient(
$direction,
$stripe-background,
$stripe-background ($width-percent - 1),
$stripe-color 1%,
$stripe-background $width-percent
);
}

@mixin transform($transformation) {
transform: $transformation;
-webkit-transform: $transformation;
-moz-transform: $transformation;
-ms-transform: $transformation;
-o-transform: $transformation;
}

@mixin photo-content {
object-fit: cover;
}

//Add your own mixins here

.notecard {

width: 300px;
height: 180px;
border: 1px solid black;
display: inline-block;
margin: 20px;
font-family: Roboto, sans-serif;
box-shadow: 1px 1px 2px 2px rgba(0,0,0,.2);

@include transform-style(preserve-3d);
@include transition(0.4s);

&:hover{
@include transform (rotatey(-180deg));
}

.front, .back {
width: 100%;
height: 100%;
position: absolute;
@include backface-visibility;
}

.front {
z-index: 3;
font-size: 20px;

.word {
  display: block;
  text-align: center;
  position: relative;
  top: 40%;
}

}

.back {
z-index: 1;
word-wrap: break-word;
line-height: 1.6;
@include transform(rotatey(-180deg));
.definition {
width: 100%;
height: 100%;
@include stripes($stripe-properties...);

  .photo {
    width: 60%;
    margin: 0px auto;
    @include stripes($stripe-properties...);
  }
}

}
}

Greetings,


#2

This nested selector should not have a stripes mixin include.


#3

Dear mtf,

Thank you for your reply, I am reacting late. I wasn't able to log in for more than a week. I reported it to Codecademy. You're right the @include stripes ($stripe-properties...); shouldn't be in the .photo part. Maybe type error.

But it also doesn't work in the definition part as well,
.back {
z-index: 1;
word-wrap: break-word;
line-height: 1.6;
@include transform(rotatey(-180deg));
.definition {
width: 100%;
height: 100%;
@include stripes($stripe-properties...);

What am I doing wrong?

I try to log in later and try to sort it out, I am not behind my own computer now.

Thanks,


#4

Instead of including the list variable $stripe-properties: to bottom, 15%, blue, white; at the top of the code, I substituted to bottom, 15%, blue, white for $stripe-properties in @include stripes($stripe-properties...); inside of the .definition selector. That worked just fine for me.


#5

Can you please copy your code as you did it and paste it over here. so I can keep going. This is just driving me crazy.


#6

Sure. Here it is:

@mixin hover-color($color) {
&:hover{
color: $color;
}
}

@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF) {
background: repeating-linear-gradient(
$direction,
$stripe-background,
$stripe-background ($width-percent - 1),
$stripe-color 1%,
$stripe-background $width-percent);
}

@mixin transform($transformation) {
transform: $transformation;
-webkit-transform: $transformation;
-moz-transform: $transformation;
-ms-transform: $transformation;
-o-transform: $transformation;
}

@mixin photo-content($file) {
content: url(#{$file}.jpg);
object-fit: cover;
}

@mixin backface-visibility($visibility:hidden) {
backface-visibility: $visibility;
-webkit-backface-visibility: $visibility;
-moz-backface-visibility: $visibility;
-ms-backface-visibility: $visibility;
-o-backface-visibility: $visibility;
}

@mixin transform-style($style){
transform-style: $style;
-moz-transform-style: $style;
-o-transform-style: $style;
-ms-transform-style: $style;
-webkit-transform-style: $style;
}

@mixin transition($time){
transition: $time;
-webkit-transition: $time;
-moz-transition: $time;
-o-transition: $time;
}

.notecard {
width: 300px;
height: 180px;
border: 1px solid black;
display: inline-block;
margin: 20px;
font-family: Roboto, sans-serif;
box-shadow: 1px 1px 2px 2px rgba(0,0,0,.2);
@include transform-style(preserve-3d);
@include transition(0.4s);

&:hover{
@include transform (rotatey(-180deg));
}

.front, .back {
width: 100%;
height: 100%;
position: absolute;
@include backface-visibility;
}

.front {
z-index: 3;
font-size: 20px;
.word {
display: block;
text-align: center;
position: relative;
top: 40%;
@include hover-color(red);
}
}

.back {
z-index: 1;
word-wrap: break-word;
line-height: 1.6;
@include transform(rotatey(-180deg));
.definition {
width: 100%;
height: 100%;
@include stripes(to bottom, 15%, blue, white;);
.photo {
@include photo-content('titanosaur');
width: 60%;
margin: 0px auto;
}
}
}


I can t move on... please help me! i don t want to give up!
#7

But shows the same error messeage
see!!

@mixin hover-color($color) {
&:hover{
color: $color;
}
}


@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF) {
  background: repeating-linear-gradient(
    $direction,
    $stripe-background,
    $stripe-background ($width-percent - 1),
    $stripe-color 1%,
    $stripe-background $width-percent
  );
}

@mixin transform($transformation) {
  transform: $transformation;
  -webkit-transform: $transformation;
  -moz-transform: $transformation;
  -ms-transform: $transformation;
  -o-transform: $transformation;  
}

@mixin photo-content {
  object-fit: cover;
}


//Add your own mixins here
@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF) {
  background: repeating-linear-gradient(
    $direction,
    $stripe-background,
    $stripe-background ($width-percent - 1),
    $stripe-color 1%,
    $stripe-background $width-percent
  );
}

@mixin transform-style($style){
   transform-style: $style;
  -moz-transform-style: $style;
  -o-transform-style: $style;
  -ms-transform-style: $style;
  -webkit-transform-style: $style;
}

@mixin transition($time){
  transition: $time;
  -webkit-transition: $time;
  -moz-transition: $time;
  -o-transition: $time;
}

.notecard {
  width: 300px;
  height: 180px;
  border: 1px solid black;
  display: inline-block;
  margin: 20px;
  font-family: Roboto, sans-serif;
  box-shadow: 1px 1px 2px 2px rgba(0,0,0,.2);
  @include transform-style(preserve-3d);
  @include transition(0.4s);
  
  &:hover{
  	@include transform (rotatey(-180deg));  
	}	
  
  .front, .back {
    width: 100%;
    height: 100%;
    position: absolute;
    @include backface-visibility;
  }
  
  .front {
  z-index: 3;
  font-size: 20px;

    .word {
      display: block;
      text-align: center;
      position: relative;
      top: 40%;
    }    
  }
  
  
  .back {
  z-index: 1;
  word-wrap: break-word;
  line-height: 1.6;
  @include transform(rotatey(-180deg));  
    
    .definition {
      width: 100%;
      height: 100%;
            @include stripes(to bottom, 15%, blue, white;);
      .photo {
        width: 60%;
        margin: 0px auto;
    @include photo-content('titanosaur')
          
      }
    }
  }
}

#8

works for me:

@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF) {
background: repeating-linear-gradient(
$direction,
$stripe-background,
$stripe-background ($width-percent - 1),
$stripe-color 1%,
$stripe-background $width-percent
);
}

.definition {
@include stripes(to bottom, 15%, blue, white);
}

@mixin transition($time){
transition: $time;
-webkit-transition: $time;
-moz-transition: $time;
-o-transition: $time;
}

@mixin transform-style($style){
transform-style: $style;
-moz-transform-style: $style;
-o-transform-style: $style;
-ms-transform-style: $style;
-webkit-transform-style: $style;
}

@mixin backface-visibility($visibility:hidden) {
//Add an argument
backface-visibility: $visibility;
-webkit-backface-visibility: $visibility;
-moz-backface-visibility: $visibility;
-ms-backface-visibility: $visibility;
-o-backface-visibility: $visibility;
}

@mixin transform($transformation) {
transform: $transformation;
-webkit-transform: $transformation;
-moz-transform: $transformation;
-ms-transform: $transformation;
-o-transform: $transformation;
}

@mixin photo-content {
object-fit: cover;
}

//Add your own mixins here

.notecard {
@include transition(0.4s);
@include transform-style(preserve-3d);
width: 300px;
height: 180px;
border: 1px solid black;
display: inline-block;
margin: 20px;
font-family: Roboto, sans-serif;
box-shadow: 1px 1px 2px 2px rgba(0,0,0,.2);
&:hover{
@include transform (rotatey(-180deg));
}
.front, .back {
width: 100%;
height: 100%;
position: absolute;
@include backface-visibility;
}

.front {
z-index: 3;
font-size: 20px;

.word {
  display: block;
  text-align: center;
  position: relative;
  top: 40%;
}

}

.back {
@include transform(rotatey(-180deg));
z-index: 1;
word-wrap: break-word;
line-height: 1.6;

.definition {
  width: 100%;
  height: 100%;

  .photo {
    width: 60%;
    margin: 0px auto;

  }
}

}
}


#9

Guys I found out this code works, the indenting part in .definition is the problem
Here is my code which helped me pass through

$stripe-properties: to bottom, 15%, blue, white;
@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF) {
  background: repeating-linear-gradient(
    $direction,
    $stripe-background,
    $stripe-background ($width-percent - 1),
    $stripe-color 1%,
    $stripe-background $width-percent
  );


@mixin transform($transformation) {
  transform: $transformation;
  -webkit-transform: $transformation;
  -moz-transform: $transformation;
  -ms-transform: $transformation;
  -o-transform: $transformation;  
}

@mixin photo-content {
  object-fit: cover;
}


//Add your own mixins here
@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF) {
  background: repeating-linear-gradient(
    $direction,
    $stripe-background,
    $stripe-background ($width-percent - 1),
    $stripe-color 1%,
    $stripe-background $width-percent
  );
}

@mixin transform-style($style){
   transform-style: $style;
  -moz-transform-style: $style;
  -o-transform-style: $style;
  -ms-transform-style: $style;
  -webkit-transform-style: $style;
}

@mixin transition($time){
  transition: $time;
  -webkit-transition: $time;
  -moz-transition: $time;
  -o-transition: $time;
}

.notecard {
  width: 300px;
  height: 180px;
  border: 1px solid black;
  display: inline-block;
  margin: 20px;
  font-family: Roboto, sans-serif;
  box-shadow: 1px 1px 2px 2px rgba(0,0,0,.2);
  @include transform-style(preserve-3d);
  @include transition(0.4s);
  
  &:hover{
  	@include transform (rotatey(-180deg));  
	}	
  
  .front, .back {
    width: 100%;
    height: 100%;
    position: absolute;
    @include backface-visibility;
  }
  
  .front {
  z-index: 3;
  font-size: 20px;

    .word {
      display: block;
      text-align: center;
      position: relative;
      top: 40%;
    }    
  }
  
  
  .back {
  z-index: 1;
  word-wrap: break-word;
  line-height: 1.6;
  @include transform(rotatey(-180deg));  
    
    .definition {
      width: 100%;
      height: 100%;
        @include stripes($stripe-properties...);
    }
   
      
      .photo {
        width: 60%;
        margin: 0px auto;      
      }
    }
  }
}

#10

Thank you noac. What I misinterpreted was A. adding the mixin at the top<<<got that. But I interpreted wrongly putting it further down in .definition.
When we look at your at the top where you added $stripes-properties: to bottom, 15%, blue, white; The next step is to add the nestor right there! THANK YOU!


#11

hello,
I am jasonbargy.

I am having the same problem. Can you please help me?

here is a copy of my code. Could you please take at look and tell what is wrong?

@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF){ background: repeating-linear-gradient(
$direction,
$stripe-background,
$stripe-background ($width-percent - 1%)
$stripe-color 1%,
$stripe-background $width-percent
);

@mixin transform($transformation) {
transform: $transformation;
-webkit-transform: $transformation;
-moz-transform: $transformation;
-ms-transform: $transformation;
-o-transform: $transformation;
}

@mixin photo-content {
object-fit: cover;
}

//Add your own mixins here
@mixin stripes($direction, $width-percent, $stripe-color, $stripe-background: #FFF) {
background: repeating-linear-gradient(
$direction,
$stripe-background,
$stripe-background ($width-percent - 1);
$stripe-color 1%,
$stripe-background $width-percent
);
}
.definition {
@include stripes($stripe-properties: to bottom, 15%, blue, white);
}

@mixin transform-style($style){
transform-style: $style;
-moz-transform-style: $style;
-o-transform-style: $style;
-ms-transform-style: $style;
-webkit-transform-style: $style;
}

@mixin transition($time){
transition: $time;
-webkit-transition: $time;
-moz-transition: $time;
-o-transition: $time;
}

.notecard {
width: 300px;
height: 180px;
border: 1px solid black;
display: inline-block;
margin: 20px;
font-family: Roboto, sans-serif;
box-shadow: 1px 1px 2px 2px rgba(0,0,0,.2);
@include transform-style(preserve-3d);
@include transition(0.4s);

&:hover{
@include transform (rotatey(-180deg));
}

.front, .back {
width: 100%;
height: 100%;
position: absolute;
@include backface-visibility;
}

.front {
z-index: 3;
font-size: 20px;

.word {
  display: block;
  text-align: center;
  position: relative;
  top: 40%;
}

}

.back {
z-index: 1;
word-wrap: break-word;
line-height: 1.6;
@include transform(rotatey(-180deg));

.definition {
  width: 100%;
  height: 100%;
}
  .photo {
    width: 60%;
    margin: 0px auto;      
  }
}

}
}


#12

I'm having the same issue. I copied the code from devninja but it still doesn't run. frustrating!


#13

I have tried everything too even reporting the bug to Codecademy. I too am frustrated:
.definition {
width: 100%;
height: 100%;
@include stripes($stripe-properties...);
}


#14

Same here, no matter what code i copy paste i cannot pass it


#15

Same problem here. Even tried Get Code and Reset exercise but it's stuck.


#16

@clovos83 @arrayrockstar67003 @lothar82 @ajaxsolver18332

This topic is old. Please create your own topic with all of the details of the problem you're facing. Thanks.

Closing.


#17