Less if string is not empty conditional logic

Moorkepupelry

New Member
I'm using dotless to dynamically change the look of my site from an admin page.Essentially I use regular expressions to read the variables defined in the less and then give the user the option to change the value of the variables.I'm wanting to have the option to set a background image. Essentially I need a way to check if the string is empty if its not then add the background image mixin.\[code\]@BackgroundImage: '';.showBackground(@fileName) when (@fileName != '') { background-image: url('../Themes/images/backgrounds/@{fileName}');}body { .showBackground(@BackgroundImage)}\[/code\]So the default is no background '' when the user sets a background the variable @BackgroundImage will be set to 'backgroundImage1.jpg'How can I get this empty string logic to work?P.S I've tried setting the variable to #000000 and using isstring() but it would appear to return true.
 
Top