M
M
mumus2017-01-13 16:29:07
Less
mumus, 2017-01-13 16:29:07

Protecting a variable in LESS?

Good afternoon, there is a file for example modal.less in which the @gutter variable is used, for example:

modal{
        display: flex;
        align-items: flex-start;
        flex-shrink:0;
        position: fixed;
        padding:@gutter;
        background-color: @color_1;
    }

this file is connected to the common main.less file, which defines variables including @gutter.
Is it possible to make "protection" in the modal.less itself: if @gutter is not defined somewhere, then for example @gutter will be equal to 15px, otherwise the one defined in variables.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Nesmeyanov, 2017-07-08
@verdex

In php it is desirable to never use interpolation at all. Yes, and PHP_EOL is cross-platform, it will not work on one of the OS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question