Coder Social home page Coder Social logo

Comments (3)

xdissent avatar xdissent commented on June 23, 2024

Handling multidimensional option arrays, dealing with variable name collisions, keeping options from breaking LESS in the context of mixin arguments - there are a lot of ins and outs to this issue. I'm not sure any one convention will ever meet all needs that are tempting you with this functionality, so it might just be best left up to PHP. I've accomplished passing PHP vars to the LESS compiler by parsing an options array and generating a LESS snippet with all of my LESS variable definitions, adding it to the front of my LESS file (read into PHP not through lessc::compile()) and then parsing through the LESS compiler. All this took was like 4 lines, and it's gone through a few iterations as my style generation scheme has developed. It's my opinion that an "official" way to do this will not fit all applications, and a lot of time will be wasted on trying to force it to do exactly that. It's just PHP and LESS after all, the sky is already the limit.

from lessphp.

rahmansal avatar rahmansal commented on June 23, 2024

This feature will be very nice, I am designing a website with base color and every other color is depending in this color with lighten() and darken() functions, It will be very powerful if i can give the user the ability to change the base color so he can change all other colors.

from lessphp.

leafo avatar leafo commented on June 23, 2024

http://leafo.net/lessphp/docs/#setting_variables_from_php

It works a little bit differently than described, it doesn't overwrite variables in the top scope. Something which I think I should change.

from lessphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.