I've written two custom helper functions at the top of my SCSS file, but they don't seem to be evaluated by Sasson:

@function em($resize, $inherited) {
  @return ($resize / $inherited) + 'em';
}

@function pc($amount, $parent) {
  @return (($amount / $parent) * 100) + '%';
}

Instead, parts of the function declarations are being stripped(?) at runtime and rendered out in the theme CSS file as follows:

@function em {  @return {  }}

@function pc {  @return {  }}

Further down in the rendered CSS file, the function calls remain intact where they should have been evaluated by the custom functions into strings:

body {
  font-size: 1em;
  line-height: em(20, 16);
}

I've created a jsfiddle example to show my SCSS function syntax is valid and should work.

Comments

tsi’s picture

Status: Active » Postponed

Marking as a Phamlp compiler issue.
The PHP compiler, while serving us well, will always lag behind the original ruby-compass compiler, this is why the upcoming release (v3.x) of Sasson will use assetic to compile Sass using the original ruby compiler.
Unfortunately, bugs with the php compiler is probably not something we will have time to work on anytime soon, since most of the effort is going into the v3.x branch which uses the original ruby-compass, so marking all Phamlp issue as postponed.
If #1825006: Phamlp can't get arguments as @media queries values is solved, we might find a way to support the php compiler as a fallback for people developing on a server that can't install ruby (we recommend developing locally, on a local server with ruby and compass installed).
Any help with this will be most appreciated.

tsi’s picture

Component: Code » Phamlp
tsi’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

The PHP compiler used in Sasson 2.x is no longer needed in v3.x and I don't see me or anyone else getting to maintain it.
Marking all relevant issues as won't fix. sorry.
You are welcome to try the much more powerful v3.x