7. Is it a bug or am i dumb?


#1



String interpolation


The code should be 100% correct but it's not working properly.
i get the error msg "Did you include the photo-content mixin inside of the .photo class selector and pass in a value of titanosaur?" when I'm pretty sure I did. Sorry in advance if i waste anyones time.


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

@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
  );
}

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

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

//Add your own mixins here
@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($transformation) {
  transform: $transformation;
  -webkit-transform: $transformation;
  -moz-transform: $transformation;
  -ms-transform: $transformation;
  -o-transform: $transformation;  
}
@mixin transform-style($style) {
  transform-style: $style;
  -webkit-transform-style: $style;
  -moz-transform-style: $style;
  -ms-transform-style: $style;
  -o-transform-style: $style;
}

.notecard {
  @include transform-style(preserve-3d);
  @include transition(0.4s);
  &:hover{
    @include transform(rotatey(-180deg));
  			}
  
  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);
  
  .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 {
        @include photo-content('titanosaur');
        width: 60%;
        margin: 0px auto;
      }
    }
  }
}


#2

I am getting the exact same error also.

cant seems to get around this.


#3
  • Resolved the issue. Hope this helps

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

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

@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) {
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;
}

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

.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);

.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 {

    @include photo-content('titanosaur');
    width: 60%;
    margin: 0px auto;  

  }
}

}


#4

Copy and pasted your exact code, restarted my computer, still nothing :frowning:


#5

Same problem here, already reported a bug


#6

to move forward paste: content: url(titanosaur.jpg);
inside .photo class in the mai.css file NOT main.scss


#7

Main.css is read only, that is, you cannot write anything in it haha


#8

Same here. Pretty sure my code is right.


#9

I couldn't get by either - but if you open the main.css in the first window, you can add "content: url(titanosaur.jpg);" in the .photo section of that file, and it will let you move on.


#10

same problem here!!! please help!


#11

it keeps saying "can't read property '1' of null!! why does it do that?


#12

The problem in a bug that appears only when using Safari. When you try the same code in a Chrome all good. So this is the "Code academy" bug.


#13

Not really, i got the error when on chrome...


#14

This helped! :smiley: Thanks! Just open the .css file and edit as @bytewhiz54022 said.


#15

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