{"id":18553710,"url":"https://github.com/websemantics/lcss2php","last_synced_at":"2025-09-07T08:36:06.018Z","repository":{"id":57079134,"uuid":"74580666","full_name":"websemantics/lcss2php","owner":"websemantics","description":"A straightforward library that extracts variable declarations from multiple Less / Scss sources and returns a PHP associative array.","archived":false,"fork":false,"pushed_at":"2018-01-09T14:19:56.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-31T04:29:09.377Z","etag":null,"topics":["less","php","scss"],"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/websemantics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-23T13:45:18.000Z","updated_at":"2021-01-13T19:51:35.000Z","dependencies_parsed_at":"2022-08-24T13:10:09.782Z","dependency_job_id":null,"html_url":"https://github.com/websemantics/lcss2php","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/websemantics/lcss2php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websemantics%2Flcss2php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websemantics%2Flcss2php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websemantics%2Flcss2php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websemantics%2Flcss2php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/websemantics","download_url":"https://codeload.github.com/websemantics/lcss2php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/websemantics%2Flcss2php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274013203,"owners_count":25207415,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["less","php","scss"],"created_at":"2024-11-06T21:18:03.555Z","updated_at":"2025-09-07T08:36:05.977Z","avatar_url":"https://github.com/websemantics.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n                                       ╭────────▞────────╮                                   \n                                       │                 │                                   \n                                       │   ╭─────────╮   │                                   \n                                       │   │         │   │                                   \n        ┬  ╭─╮╭─╮╭─╮    ╭─╮╭─╮╭─╮╭─╮   ┃   │   ░ ░░░ │   ┃ ┬╭─╮    ╭─╮┬ ┬╭─╮    ╭─╮┬ ┬╭─╮ \n        │  ├┤ ╰─╮╰─╮    ╰─╮│  ╰─╮╰─╮   ┃   │   ░░░░░ │   ┃─┤├─╯    ├─╯├─┤├─╯    ├─╯├─┤├─╯    \n        ┴─╯╰─╯╰─╯╰─╯    ╰─╯╰─╯╰─╯╰─╯   ┃   ╰─────────╯   ┃ ┴┴      ┴  ┴ ┴┴      ┴  ┴ ┴┴             \n    ╭──────────────────────────────────┤                 ├──────────────────────────────────╮     \n    │  ◯   ◯   ◯   ◯   ◯   ◯   ◯   ◯   │   ▯ ▯ ▯ ▯ ▯ ▯   │  ◯   ◯   ◯   ◯   ◯   ◯   ◯   ◯   │   \n    ╰──┬┬─────┬┬─────┬┬─────┬┬─────┬┬──┤                 ├───┬┬─────┬┬─────┬┬─────┬┬─────┬┬─╯     \n       ││     ││     ││     ││     ││  │      ╭───╮      │   ││     ││     ││     ││     ││        \n    ───┤├─────┤├─────┤├─────┤├─────┤├──┤      │───│      ├───┤├─────┤├─────┤├─────┤├─────┤├────\n      ─┴┴ ─   ┴┴    ─┴┴   ─ ┴┴─   ─┴┴  │      │   │      │   ┴┴ ─  ─┴┴─    ┴┴─   ─┴┴   ─ ┴┴─       \n                                       ╰──────╯   ╰──────╯                                   \n```\n\u003e A straightforward library that extracts variable declarations from multiple `Less` / `Scss` sources and returns a `PHP` associative array.\n\n## Install\n \n1- Use `Composer` to install as follows, \n\n```bash\ncomposer require websemantics/lcss2php\n```\n\n## Getting Started\n\nPass a list of files (`Less`, `Scss` or a mix ) to a newly created instance of `Lcss2php` class. Get a list of all the variables using the `all` method.\n\n```php\n$files = ['/usr/etc/variables.less', '/usr/etc/_variables.scss'];\n\n$lcss2php = new Lcss2php($files);\n\n$variables = $lcss2php-\u003eall();\n```\n\nBy default all variable types are returned, for example, `Color`, `Dimension`, etc. You can use the `ignore` function to filter some types from the final variables list,\n\n```php\n$variables = (new Lcss2php($files))-\u003eignore(['Color', 'Dimension'])-\u003eall();\n```\nNotice that, there are two different variable types for each lanaguage (`Less`, `Scss`). For a list of all the types, check class `Type` at `lcss2php/src/Node/Type.php`.\n\n## Example\n\nQuick run of what to expect; take this `Scss` example code,\n\n```sass\n$green: #24ce7b !default;\n$blue: #38b5e6 !default;\n$orange: #f48714 !default;\n$red: #f6303e !default;\n\n$brand-success: $green;\n$brand-info: $blue;\n$brand-warning: $orange;\n$brand-danger: $red;\n\n$spacer: 1rem !default;\n$spacer-x: $spacer !default;\n$spacer-y: $spacer !default;\n```\n\nWill be converted to, \n\n```php\n[\n  \"green\" =\u003e \"#24ce7b\"\n  \"blue\" =\u003e \"#38b5e6\"\n  \"orange\" =\u003e \"#f48714\"\n  \"red\" =\u003e \"#f6303e\"\n  \"brand-success\" =\u003e \"#24ce7b\"\n  \"brand-info\" =\u003e \"#38b5e6\"\n  \"brand-warning\" =\u003e \"#f48714\"\n  \"brand-danger\" =\u003e \"#f6303e\"\n  \"spacer\" =\u003e \"1rem\"\n  \"spacer-x\" =\u003e \"1rem\"\n  \"spacer-y\" =\u003e \"1rem\"\n]\n```\n\n## Support\n\nStar :star: this repository if you find this project useful, to show support or simply, for being awesome :) \n\nNeed help or have a question? post at [StackOverflow](https://stackoverflow.com/questions/tagged/lcss2php websemantics).\n\n*Please don't use the issue trackers for support/questions.*\n\n## Contribution\n\nContributions to this project are accepted in the form of feedback, bugs reports and even better - pull requests.\n\n## Open Source\n\nThese project have been used in the making of this project, thanks you!\n\n- [SCSS Compiler](https://github.com/oyejorge/less.php), SCSS compiler written in PHP.\n- [LESS Compiler](https://github.com/leafo/scssphp), Less.js ported to PHP.\n\n## License\n\n[MIT license](http://opensource.org/licenses/mit-license.php)\nCopyright (c) Web Semantics, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebsemantics%2Flcss2php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebsemantics%2Flcss2php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebsemantics%2Flcss2php/lists"}