{"id":13669364,"url":"https://github.com/leafo/lessphp","last_synced_at":"2025-05-13T18:09:18.754Z","repository":{"id":44610664,"uuid":"256408","full_name":"leafo/lessphp","owner":"leafo","description":"LESS compiler written in PHP","archived":false,"fork":false,"pushed_at":"2024-05-16T00:46:15.000Z","size":840,"stargazers_count":2191,"open_issues_count":218,"forks_count":521,"subscribers_count":102,"default_branch":"master","last_synced_at":"2025-04-25T14:50:48.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://leafo.net/lessphp","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leafo.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":"2009-07-21T04:00:36.000Z","updated_at":"2025-04-24T02:38:17.000Z","dependencies_parsed_at":"2024-06-18T10:37:30.729Z","dependency_job_id":"7d79b548-70c9-4af9-8d2a-7b0ae17d2841","html_url":"https://github.com/leafo/lessphp","commit_stats":{"total_commits":523,"total_committers":50,"mean_commits":10.46,"dds":"0.17973231357552577","last_synced_commit":"1fdc40e77824a692d7f4811ba86ed89669a66135"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafo%2Flessphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafo%2Flessphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafo%2Flessphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafo%2Flessphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leafo","download_url":"https://codeload.github.com/leafo/lessphp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000850,"owners_count":21997441,"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":[],"created_at":"2024-08-02T08:01:11.095Z","updated_at":"2025-05-13T18:09:18.730Z","avatar_url":"https://github.com/leafo.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/leafo/lessphp.svg?branch=master)](https://travis-ci.org/leafo/lessphp)\n\n# lessphp v0.5.0\n### \u003chttp://leafo.net/lessphp\u003e\n\n`lessphp` is a compiler for LESS written in PHP. The documentation is great,\nso check it out: \u003chttp://leafo.net/lessphp/docs/\u003e.\n\nHere's a quick tutorial:\n\n### How to use in your PHP project\n\nThe only file required is `lessc.inc.php`, so copy that to your include directory.\n\nThe typical flow of **lessphp** is to create a new instance of `lessc`,\nconfigure it how you like, then tell it to compile something using one built in\ncompile methods.\n\nThe `compile` method compiles a string of LESS code to CSS.\n\n```php\n\u003c?php\nrequire \"lessc.inc.php\";\n\n$less = new lessc;\necho $less-\u003ecompile(\".block { padding: 3 + 4px }\");\n```\n\nThe `compileFile` method reads and compiles a file. It will either return the\nresult or write it to the path specified by an optional second argument.\n\n```php\n\u003c?php\necho $less-\u003ecompileFile(\"input.less\");\n```\n\nThe `checkedCompile` method is like `compileFile`, but it only compiles if the output\nfile doesn't exist or it's older than the input file:\n\n```php\n\u003c?php\n$less-\u003echeckedCompile(\"input.less\", \"output.css\");\n```\n\nIf there any problem compiling your code, an exception is thrown with a helpful message:\n\n```php\n\u003c?php\ntry {\n  $less-\u003ecompile(\"invalid LESS } {\");\n} catch (exception $e) {\n  echo \"fatal error: \" . $e-\u003egetMessage();\n}\n```\n\nThe `lessc` object can be configured through an assortment of instance methods.\nSome possible configuration options include [changing the output format][1],\n[setting variables from PHP][2], and [controlling the preservation of\ncomments][3], writing [custom functions][4] and much more. It's all described\nin [the documentation][0].\n\n\n [0]: http://leafo.net/lessphp/docs/\n [1]: http://leafo.net/lessphp/docs/#output_formatting\n [2]: http://leafo.net/lessphp/docs/#setting_variables_from_php\n [3]: http://leafo.net/lessphp/docs/#preserving_comments\n [4]: http://leafo.net/lessphp/docs/#custom_functions\n\n\n### How to use from the command line\n\nAn additional script has been included to use the compiler from the command\nline. In the simplest invocation, you specify an input file and the compiled\ncss is written to standard out:\n\n    $ plessc input.less \u003e output.css\n\nUsing the -r flag, you can specify LESS code directly as an argument or, if\nthe argument is left off, from standard in:\n\n    $ plessc -r \"my less code here\"\n\nFinally, by using the -w flag you can watch a specified input file and have it\ncompile as needed to the output file:\n\n    $ plessc -w input-file output-file\n\nErrors from watch mode are written to standard out.\n\nThe -f flag sets the [output formatter][1]. For example, to compress the\noutput run this:\n\n    $ plessc -f=compressed myfile.less\n\nFor more help, run `plessc --help`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafo%2Flessphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafo%2Flessphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafo%2Flessphp/lists"}