Modified pull request from #361 with suggested changes.
I've left string operations with nulls as they were:
property: 'foo' + null; // 'foo'
property: 'foo' - null; // 'foo-'
But added a SyntaxError whenever a null is involved in other operations:
property: null + 1; // Sass::SyntaxError
property: black / null; // Sass::SyntaxError
Also, we discussed properties not printing when they have empty values. Currently, a SyntaxError is thrown in that case. Is there any reason to change from this?
Add null literal.
@petebrowne The reason to omit properties that are set to null, an empty string, or an empty list is that it optimizes a very common case of omitting a property that not explicitly passed without a bunch of @if boilerplate. It's also not obviously a conceptual error because if you set a property to nothing has a very similar feeling to not setting it.
Omit properties with empty resolved values.
The following will still throw a SyntaxError:
But properties with resolved values that are empty are omitted:
c: 'foo'; }
Disallow null in String operations.
Mention null in @if documentation.
I merged this in, with the change that null now throws an error for all non-boolean operations, including with strings.
Awesome! @chriseppstein, @nex3 Thanks for the help & suggestions