How to set default variable value in LESS css

I am using LessPHP, and basically want to do the following:

@var = "new val"; if(isnull(@var)){ @var = "default"; } 

I know that there are no isnull or if expressions. I also know that you can use parametric functions, but I want to work with @var in a global scope.

+4
source share
1 answer

I am not familiar with Less in LessPHP, but as far as I remember there are no if statements. SASS (sass-lang.com/) is much more familiar with it

+1
source

Source: https://habr.com/ru/post/1401907/


All Articles