Allow mixins outputting selectors to be used at the stylesheet root #1527

Open
wants to merge 1 commit into
from

2 participants

@JohnAlbin

I was converting a CSS ruleset of:

::selection {
  background: #ca322c;
  color: white;
}

to use Compass, when I saw that the Compass mixin required a * { } wrapper. With Sass 3.3's #{&} capability, it should be possible to use any mixin that outputs a selector at the root level of the stylesheet.

Currently, doing this at the root of a stylesheet produces an error, but it shouldn't:

@include selection(#ca322c, white);
@chriseppstein
Compass member

Script parent didn't get into Sass 3.3. Instead, I've added a custom function at-stylesheet-root() which returns true when & used to return null. Can you rework this patch to use that instead?

See: 5fb0b88

@chriseppstein
Compass member

@JohnAlbin Also, this needs tests :)

@chriseppstein chriseppstein added this to the 1.0.x milestone Mar 9, 2014
@chriseppstein
Compass member

@JohnAlbin Sass 3.4 is being released today. want to dust this off for 1.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment