Property with null value is not omitted if it has !important flag.
See original GitHub issueGiven the following code:
// null value example
$some-value: null !default;
.class {
color: $some-value;
color: $some-value !important;
}
The first color property is omitted since it’s value is null
. The second is not omitted and invalid CSS is outputted: color: !important;
. I’d expect the !important
flag not to matter when the value is null and both properties to be omitted, but it’s not that clear to me what the expected result should be from the null page.
This can be worked around by using an if rule around the property using important and checking for the variable, so it’s not a huge issue.
Playground: https://www.sassmeister.com/gist/b04fe1d7b7902c62593b2afac2516e26
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
What does it mean for a property to be [Required] and nullable?
The reason for making a property nullable and marked with the [Required] attribute is to protect against under-posting attacks.
Read more >Flag Null Values in your Datasets - salesforceblogger.com
Well, if you group by a dimension containing null value those records with null values are omitted from the result, which means that...
Read more >Use empty string, null or remove empty property in API request ...
While most modern serializers have optional fields, omitting nulls from the response is not always a good idea, because it may introduce ...
Read more >Property flags and descriptors - The Modern JavaScript Tutorial
Until now, a property was a simple “key-value” pair to us. ... otherwise not listed. configurable – if true , the property can...
Read more >Terraform Optional Variables and Attributes — Using Null and ...
This is because the variables could cause the resource arguments to be triggered with expected values even though you set nonsense default values...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
if you need a workaround to get rid of the errors, you can assign to a variable before returning,
@connorskees Thank you so much, really appreciate it.