Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Design PHP Switch type in LESS

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #270410
    jdadwilson
    Participant

    I am fairly new to LESS. Love it so far. I am in the need to have something similar to PHP switch in LESS. I have several color schemes that a user can select from when installing my scripts onto their website. Now I have to change the code prior to installation. I would like to include the option to choose the color scheme in the installation package. What I would like is something in a LESS file that would work similar to the PHP switch coding. Something like this…

    $color_scheme: “tan”;

    switch $color_scheme {
    case “tan” {
    @color_01: #789654;
    @color_02: #741258;
    }
    case “green” {
    @color_01: #852147;
    @color_02: #123654;
    }
    }

    Hope this makes sense. TIA for any support

Viewing 1 post (of 1 total)
  • The forum ‘Design’ is closed to new topics and replies.