{"id":21823533,"url":"https://github.com/jbzoo/less","last_synced_at":"2025-04-14T04:30:58.609Z","repository":{"id":4188907,"uuid":"52270301","full_name":"JBZoo/Less","owner":"JBZoo","description":"PHP wrapper for wikimedia/less.php.","archived":false,"fork":false,"pushed_at":"2024-02-16T18:15:51.000Z","size":345,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T18:21:26.343Z","etag":null,"topics":["assets","css","jbzoo","less","php","wikimedia"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JBZoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-22T11:56:53.000Z","updated_at":"2024-04-27T21:40:25.000Z","dependencies_parsed_at":"2024-11-27T17:43:20.677Z","dependency_job_id":null,"html_url":"https://github.com/JBZoo/Less","commit_stats":{"total_commits":56,"total_committers":5,"mean_commits":11.2,"dds":0.6785714285714286,"last_synced_commit":"8204fe032fe325f6afdfd54237dbc866ad9da888"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBZoo%2FLess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBZoo%2FLess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBZoo%2FLess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBZoo%2FLess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JBZoo","download_url":"https://codeload.github.com/JBZoo/Less/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248821677,"owners_count":21166926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets","css","jbzoo","less","php","wikimedia"],"created_at":"2024-11-27T17:33:16.235Z","updated_at":"2025-04-14T04:30:58.573Z","avatar_url":"https://github.com/JBZoo.png","language":"PHP","readme":"# JBZoo / Less\n\n[![CI](https://github.com/JBZoo/Less/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Less/actions/workflows/main.yml?query=branch%3Amaster)    [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Less/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Less?branch=master)    [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Less/coverage.svg)](https://shepherd.dev/github/JBZoo/Less)    [![Psalm Level](https://shepherd.dev/github/JBZoo/Less/level.svg)](https://shepherd.dev/github/JBZoo/Less)    [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/less/badge)](https://www.codefactor.io/repository/github/jbzoo/less/issues)    \n[![Stable Version](https://poser.pugx.org/jbzoo/less/version)](https://packagist.org/packages/jbzoo/less/)    [![Total Downloads](https://poser.pugx.org/jbzoo/less/downloads)](https://packagist.org/packages/jbzoo/less/stats)    [![Dependents](https://poser.pugx.org/jbzoo/less/dependents)](https://packagist.org/packages/jbzoo/less/dependents?order_by=downloads)    [![GitHub License](https://img.shields.io/github/license/jbzoo/less)](https://github.com/JBZoo/Less/blob/master/LICENSE)\n\n\n\nPHP wrapper for [wikimedia/less.php](https://github.com/wikimedia/less.php). \n\n\n## Install\n```sh\ncomposer require jbzoo/less\n```\n\n## Usage\n```php\nuse JBZoo\\Less\\Less;\n\ntry { // Any error handling\n\n    // There is not option required\n    $less = new Less([\n        'force'        =\u003e false,                    // Can forced compile on each compile() calling\n        'debug'        =\u003e false,                    // On/Off Source map for browser debug console\n\n        'root_url'     =\u003e 'http://site.com/',       // Root URL for all CSS files and debug mode\n                                                    // For example - background:url('http://site.com/image.png')\n\n        'root_path'    =\u003e '/full/path/to/site',     // Full path to root of web directory\n\n        'global_vars'  =\u003e [                         // Some vars that will be in all less files\n            'color'  =\u003e '#f00',                     // @color: #f00;\n            'media' =\u003e 'print',                     // @media: print;\n        ],\n\n        'autoload'     =\u003e [                         // Autoload before eash compiling\n            '/full/path/to/my_mixins.less',         // See the best of collection here\n        ],                                          // https://github.com/JBZoo/JBlank/tree/master/less/misc\n\n        'import_paths' =\u003e [                         // Import paths\n            '/full/path/to/assets/less/' =\u003e 'http://site.com/assets/less/',\n            './or/relative/path/to/dir/' =\u003e './or/relative/path/to/dir/',\n        ],\n\n        'cache_path'   =\u003e './cache',                // Where JBZoo/Less will save compiled CSS-files\n        'cache_ttl'    =\u003e 2592000,                  // How often rebuild css files (in seconds)\n\n        'functions' =\u003e [                            // Custom functions for less (only for gpeasy!)\n            'str-revert' =\u003e function ($arg) {       // Register name `str-revert()`\n                $arg-\u003evalue = strrev($arg-\u003evalue);  // Just revert argument\n                return $arg;                        // Result: str-revert('1234567890'); =\u003e '0987654321';\n            },\n        ],\n    ]);\n\n    $less-\u003esetImportPath(\n        '/full/path/to/other/import/directory/',    // Full or relative path\n        'http://site.com/other/import/directory/'   // Not required\n    );\n\n    $fullCSSpath_1 = $less-\u003ecompile('/full/path/to/styles.less');       // Basepath from config\n    $fullCSSpath_2 = $less-\u003ecompile('./relative/path/to/styles.less');  // OR relative path\n    $fullCSSpath_3 = $less-\u003ecompile(\n        './relative/path/to/styles.less',\n        'http://site.com/relative/path/to/'                             // Force base path for any URLs\n    );\n\n} catch (JBZoo\\Less\\Exception $e) {\n    echo 'JBZoo/Less: ' . $e-\u003egetMessage();\n}\n\n```\n\n\n## Unit tests and check code style\n```sh\nmake update\nmake test-all\n```\n\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbzoo%2Fless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbzoo%2Fless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbzoo%2Fless/lists"}