Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New to sass, expecting expected selector

Im new to sass and tried some code:

$blue: #3bbfce
$margin: 16px

.content-navigation
border-color: $blue
color: darken($blue, 9%)

.border
 padding: $margin / 2
 margin: $margin / 2
 border-color: $blue

But now in my rails app i get this error:

 Invalid CSS after "$margin": expected selector or at-rule, was ": 16px"

Whats wrong?


Now i tried something with zurb:

.your-class-name {
  @include button;
  @include dropdown-button($padding, $pip-color, $base-style);
}

But now i get the error

  Undefined mixin 'dropdown-button'.
like image 707
John Smith Avatar asked Aug 29 '13 17:08

John Smith


Video Answer


1 Answers

You're missing semicolons after your style declarations. You also need to encapsulate selector declarations within curly brackets:

$blue: #3bbfce;
$margin: 16px;

.content-navigation {
  border-color: $blue;
  color: darken($blue, 9%);
}

.border {
  padding: $margin / 2;
  margin: $margin / 2;
  border-color: $blue;
}

You might like to read over this primer from the creators of SASS.

like image 80
zeantsoi Avatar answered Sep 18 '22 12:09

zeantsoi