Comments (3)
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.
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.
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)
- parse error: failed at `$result: &;` (stdin) HOT 1
- Will the project uodated to teh newest less version? HOT 2
- @supports CSS Feature Queries not working HOT 3
- Both DOS and UNIX style line endings issue on Theme Check WordPress Plugin
- guarded recursion fails on exit
- setPreserveComments changes line endings
- Parse error with CSS Grid Layout and named grid lines/areas HOT 3
- lessphp fatal error: expected color value: /home/iler/public_html/wp-content/themes/CherryFramework-child2/bootstrap/less/bootstrap.less on line 63
- less parser fails with UIKIT 3 less files HOT 3
- less parser fails with less.js built-in function color() HOT 1
- recursive mixin not working in nested rule
- Background SVG animation breaks generation
- PHP Fatal error: Uncaught Exception: E_NOTICE in PHP 7.4 HOT 3
- Error parse: calc function HOT 1
- Deprecated Array and string offset access syntax with curly braces is deprecated HOT 5
- Imported files get optimized incorrectly. HOT 1
- Deprecated stuff under PHP 8.1 HOT 3
- each loop -> Uncaught Exception: parse error: failed at `); `
- Support for PHP 8.2 HOT 4
- Deprecated things under PHP 8.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lessphp.