CSS Advanced Sass Advanced Functions Introspection: Part 1

Mokanye Tumelo Tricia
Mokanye Tumelo Tricia
9,981 Points

help me please

The following Sass will set the content of .block elements to fail. Make the global-variable-exists call return true, so that content is set to pass, instead.

style.scss
.block {
  $test: 'pass';
  @if global-variable-exists(test) {
    content: $test;
  } @else {
    content: 'fail';
  }
}

1 Answer

THAPELO MOKOKO
THAPELO MOKOKO
9,457 Points
.block {
  $test: 'pass';
  @if global-variable-exists(test) return true {
    content: $test;
  } @else {
    content: 'fail';
  }
}
Rich Donnellan
Rich Donnellan
Treehouse Moderator 25,635 Points

Answer updated with code formatting. Check out the Markdown Cheatsheet below the Add an Answer submission for syntax examples.