Questions tagged [lessphp]

a compiler that generates CSS; designed to be compatible with less.js.

lessphp is a compiler written in similar to

It is designed to be compatible with the JavaScript version of the LESS compiler, and suitable as a drop-in replacement.

Plugins exist to integrate lessphp into popular content management systems and frameworks such as Symfony, WordPress, Drupal, CakePHP, and Magento.

lessphp is compatible with PHP 5.1+.

52 questions
10
votes
4 answers

Compiling Less CSS for Bootstrap 3 with PHP

There are two LessCSS compilers in PHP that I am aware of: http://leafo.net/lessphp/ http://lessphp.gpeasy.com/ Both claim to be compatible with Bootstrap (version 3). However I am struggling to get anything going given the steep learning curve of…
Jodes
  • 14,118
  • 26
  • 97
  • 156
9
votes
1 answer

Overriding Bootstrap LESS variables after @import

I am trying to override some bootstrap LESS variables before compiling e.g. // Core variables @import "variables.less"; // Trying to override @white from variables.less @white: #de1de1; // other bootstrap @imports.... The above code doesn't…
GWed
  • 15,167
  • 5
  • 62
  • 99
7
votes
2 answers

Override LESS variables

I have the following stack: Symfony2 Twig with lessphp filter installed. Twitter Boostrap In base.css i have: // base.less @import '/path/to/bootstrap.less' @linkColor: 13px; Variable name is not important at all. It can be any other variable…
Viorel
  • 1,420
  • 1
  • 17
  • 27
3
votes
2 answers

CSS file with LESS variables

I need create customization of web template and give my customers form to configuration of styles. I created styles of website in LESS, and when customer changes some setting in form (and click submit) PHP creates dynamically CSS files based on…
Cichy
  • 4,602
  • 3
  • 23
  • 28
3
votes
1 answer

Simplifying Repetitive LESS

I am creating a themeing system for a WordPress network that supports multiple layout themes that can support color schemes for a variety of universities. To do so, I periodically compile a LESS file (using lessphp) with school-specific variables…
Andrew Cafourek
  • 431
  • 4
  • 11
2
votes
3 answers

LessCss: nesting groups of selectors

Say in my main.less file which gets compiled into main.css, I have the following: .section1 { .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, …
Jodes
  • 14,118
  • 26
  • 97
  • 156
2
votes
1 answer

"Fatal Error: infinite loop detected" via lessphp

I'm try to compile this .less code to .css via lessphp and get this error: Fatal Error: ==================== infinite loop detected: @pos-x: failed at `background-position: @pos-x 0; }` line: 3 Here is my code. @pos-x : 0; @w : 30px; .a {…
Love Senya
  • 23
  • 2
2
votes
1 answer

Override Twitter's Bootstrap LESS variables with LESSPHP

I've been messing around with lessphp and bootstrap-colorpicker and I'd like to find out if it's possible to override less variables with a hex color set by bootstrap-colorpicker, something like:
dcd0181
  • 1,493
  • 4
  • 29
  • 52
2
votes
1 answer

How to convert LESS @import... to LESS variable?

I am using lessphp from http://leafo.net/lessphp/ there are certain files that depending on condition should not be compiled in style.less I have: @import "@{bootstrap}"; @import "layout.less"; @import "grid.less"; @import "color.less"; @import…
Benn
  • 4,840
  • 8
  • 65
  • 106
2
votes
2 answers

Unable to inject less variables when parsing string from PHP in lessphp

I've got the following less code. I've read around that there is a limitation in less.js when using variables in url() declaration and so i used two suggested workarounds, but the real problem is that the variable comes from PHP and it seem it's not…
Nicola Peluchetti
  • 76,206
  • 31
  • 145
  • 192
1
vote
1 answer

lessphp failed to parse passed in variable error

I'm using lessphp in my Joomla website, I'm building a template, I'd like to set some variables and use them in a less file, to do that I'm using the class autoCompileLess but I'm getting the error failed to parse passed in variable @font: This is…
valentina.a87
  • 117
  • 1
  • 3
  • 15
1
vote
1 answer

"Quoting" argument variable in LESS mixin

I have the following array of color definitions: @colors: ~"black" #000, ~"white" #fff, ~"blue" #008FD6, ~"bluehover" #44A1E0, ~"grayborder" #DBDBDB; And I use the following function to use those colors within CSS declarations. .colorkey(@key) { …
HandiworkNYC.com
  • 10,914
  • 25
  • 92
  • 154
1
vote
0 answers

How to comple Sass with scssphp compiler cache

Less PHP (http://leafo.net/lessphp/docs/) has a great method function autoCompileLess($inputFile, $outputFile) { // load the cache $cacheFile = $inputFile.".cache"; if (file_exists($cacheFile)) { $cache =…
Dpave
  • 11
  • 1
1
vote
1 answer

@media in mixin (lessphp)

I would like to make own mixin wtih mediaqueries like this. @maxWidth: 1170px; .breakpoint(@maxWidth) { @media screen and (max-width: @maxWidth) { @content; } } But @media in mixin doesn't work. Support it lessphp or not? If not, how can…
Egor
  • 248
  • 7
  • 17
1
vote
0 answers

How to insert php variables into less?

For days I've been looking all over the internet for a way to dynamically create a less file, into which I would pass color and font variables set inside the wordpress theme customizer api. The closest thing I came up with is a way to insert these…
Goran Tesic
  • 719
  • 1
  • 13
  • 28
1
2 3 4