How to make Stylus to see the variable that has been initialized in other scope?

Viewed 166

In SASS:

.DocumentationArticle

  $DocumentationArticle-Heading__TopLevel--Selector: null

  &-Heading
    &__TopLevel
      $DocumentationArticle-Heading__TopLevel--Selector: &
    &__Section
      @debug($DocumentationArticle-Heading__TopLevel--Selector) // OK: ".DocumentationArticle-Heading__TopLevel"

In Stylus, in variable value has been changed, this change visible only in scope where it has been changed:

.DocumentationArticle

  DocumentationArticle-Heading__TopLevel--Selector = null

  &-Heading
    &__TopLevel
      DocumentationArticle-Heading__TopLevel--Selector = selector()
    &__Section
      warn(DocumentationArticle-Heading__TopLevel--Selector) // null!

How to make DocumentationArticle-Heading__TopLevel--Selector new value visible in &__Section scope?

Fiddle

0 Answers
Related