Typesetter-Original-gtbu/include/thirdparty/less.php
gtbu 242963b878 Less update 3.21
Update because of deprecations with php 8.2.
4.1 as reserve
2023-04-24 17:13:37 +02:00
..
____4.1 Less update 3.21 2023-04-24 17:13:37 +02:00
bin Less update 3.21 2023-04-24 17:13:37 +02:00
Exception Less update 3.21 2023-04-24 17:13:37 +02:00
Output Less update 3.21 2023-04-24 17:13:37 +02:00
SourceMap Less update 3.21 2023-04-24 17:13:37 +02:00
Tree Less update 3.21 2023-04-24 17:13:37 +02:00
Visitor Less update 3.21 2023-04-24 17:13:37 +02:00
API.md Less update 3.21 2023-04-24 17:13:37 +02:00
Autoloader.php Less update 3.21 2023-04-24 17:13:37 +02:00
Cache.php Less update 3.21 2023-04-24 17:13:37 +02:00
CHANGES.md Less update 3.21 2023-04-24 17:13:37 +02:00
CODE_OF_CONDUCT.md Less update 3.21 2023-04-24 17:13:37 +02:00
Colors.php Less update 3.21 2023-04-24 17:13:37 +02:00
Configurable.php Less update 3.21 2023-04-24 17:13:37 +02:00
Environment.php Less update 3.21 2023-04-24 17:13:37 +02:00
Functions.php Less update 3.21 2023-04-24 17:13:37 +02:00
Less.php.combine Update Less 3.1 from 1.7 - php8 2021-10-12 15:02:25 +02:00
lessc.inc.php Less update 3.21 2023-04-24 17:13:37 +02:00
LICENSE Less update 3.21 2023-04-24 17:13:37 +02:00
Mime.php Less update 3.21 2023-04-24 17:13:37 +02:00
NOTICE.txt Less update 3.21 2023-04-24 17:13:37 +02:00
Output.php Less update 3.21 2023-04-24 17:13:37 +02:00
Parser.php Less update 3.21 2023-04-24 17:13:37 +02:00
README.md Less update 3.21 2023-04-24 17:13:37 +02:00
SECURITY.md Less update 3.21 2023-04-24 17:13:37 +02:00
Tree.php Less update 3.21 2023-04-24 17:13:37 +02:00
Version.php Less update 3.21 2023-04-24 17:13:37 +02:00
Visitor.php Less update 3.21 2023-04-24 17:13:37 +02:00
VisitorReplacing.php Less update 3.21 2023-04-24 17:13:37 +02:00

Packagist

Less.php

This is a PHP port of the official LESS processor.

About

The code structure of Less.php mirrors that of upstream Less.js to ensure compatibility and help reduce maintenance. The port is currently compatible with Less.js 2.5.3. Please note that "inline JavaScript expressions" (via eval or backticks) are not supported.

Installation

You can install the library with Composer or standalone.

If you have Composer installed:

  1. Run composer require wikimedia/less.php
  2. Use Less_Parser in your code.

Or standalone:

  1. Download Less.php and upload the PHP files to your server.
  2. Include the library:
    require_once '[path to]/less.php/lib/Less/Autoloader.php';
    Less_Autoloader::register();
    
  3. Use Less_Parser in your code.

Security

The LESS processor language is powerful and includes features that may read or embed arbitrary files that the web server has access to, and features that may be computationally exensive if misused.

In general you should treat LESS files as being in the same trust domain as other server-side executables, such as PHP code. In particular, it is not recommended to allow people that use your web service to provide arbitrary LESS code for server-side processing.

See also SECURITY.

Who uses Less.php?

Integrations

Less.php has been integrated with various other projects.

Transitioning from Leafo/lessphp

If you're looking to transition from the Leafo/lessphp library, use the lessc.inc.php adapter file that comes with Less.php.

This allows Less.php to be a drop-in replacement for Leafo/lessphp.

Download Less.php, unzip the files into your project, and include its lessc.inc.php instead.

Note: The setPreserveComments option is ignored. Less.php already preserves CSS block comments by default, and removes LESS inline comments.

Drupal

Less.php can be used with Drupal's less module via the lessc.inc.php adapter. Download Less.php and unzip it so that lessc.inc.php is located at sites/all/libraries/lessphp/lessc.inc.php, then install the Drupal less module as usual.

WordPress

  • wp_enqueue_less is a Composer package for use in WordPress themes and plugins. It provides a wp_enqueue_less() function to automatically manage caching and compilation on-demand, and loads the compressed CSS on the page.
  • JBST framework bundles a copy of Less.php.
  • The lessphp plugin bundles a copy of Less.php for use in other plugins or themes. This dependency can also be combined with the TGM Library.

Credits

Less.php was originally ported to PHP in 2011 by Matt Agar and then updated by Martin Jantošovič in 2012. From 2013 to 2017, Josh Schmidt lead development of the library. Since 2019, the library is maintained by Wikimedia Foundation.