stylus / nib

Stylus mixins, utilities, components, and gradient image generation
http://stylus.github.io/nib
MIT License
1.9k stars 250 forks source link

Proper background-size keyword support #201

Open artnez opened 11 years ago

artnez commented 11 years ago

Prevents the background-size property from being ignored for non-retina screens.

artnez commented 11 years ago

I tried to avoid a "private" mixin at first (nib-image--background-size), but duplicating the logic that generates background-size seemed worse.

Here's a quick (untested) example that illustrates the scoping issue:

mymixin(someargument = 'defaultvalue')
  someargument = 'anothervalue' // we override someargument, but it does not bleed into the nested scope below
  someproperty someargument
  @media blah
    someproperty someargument

body
  mymixin()

// .. produces something like ..

body {
  someproperty: 'anothervalue';
}
@media blah {
  body {
    someproperty: 'defaultvalue';
  }
}