stylus icon indicating copy to clipboard operation
stylus copied to clipboard

Will +prefix-classes change the mixins of rulesets permanently? Can the rulesets been set back?

Open yushengh opened this issue 9 years ago • 3 comments

Stylus code:

selectors() {
  .class  {
    color:red;
  }
}

Prefix()
  if $widgetContext != 'default'
    +prefix-classes($enclosingClass + '.')
      selectors();
  else
    selectors();

$enclosingClass = "Toolstip"

// First
$widgetContext = "default"
Prefix()

// Second
$widgetContext = "toolstip"
Prefix()

// Third
$widgetContext = "default"
Prefix()

// Fourth
$widgetContext = "toolstip"
Prefix()

CSS output:

.class {
  color: #f00;
}
.Toolstip.class {
  color: #f00;
}
.Toolstip.class {
  color: #f00;
}
.Toolstip.class {
  color: #f00;
}

I do see that once a mixins of selectors has been prefix a class, it can never get it off or prefix another class anymore. I want to know is there a way to recover the selectors back to original styles in the third step.

yushengh avatar Jun 17 '15 15:06 yushengh

The problem will be solved? or is there another solution?

docccdev avatar Nov 23 '16 11:11 docccdev

Still not fixed, will it ever be?

hmalaud avatar Apr 17 '18 09:04 hmalaud

Still no one fixed it :(

tientq64 avatar Jul 12 '21 05:07 tientq64