Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

Sass functions defined in Python should receive the current rule #226

Closed eevee closed 8 years ago

eevee commented 11 years ago

Otherwise they can't get at other variables in the current namespace, whereas a Sass function can. Also can't get at compilation-local data or current options.

This will be a breaking change to @register, but that can be averted if it's implemented at the same time as #132 with a new API (that also divines arguments and specifies types and so forth).

Might be related to #133, in that the current "compilation" is a useful thing to expose to a function as well.

eevee commented 10 years ago

New plan: decorator that opts into receiving the current rule. Vast majority of cases don't care, so.

eevee commented 8 years ago

Added @ns.declare_internal which does exactly that thing I said.