{"id":20931154,"url":"https://github.com/scssphp/server","last_synced_at":"2026-03-05T20:00:05.397Z","repository":{"id":44768242,"uuid":"192614633","full_name":"scssphp/server","owner":"scssphp","description":"Server for on-the-fly .scss compilation","archived":false,"fork":false,"pushed_at":"2023-03-01T17:24:31.000Z","size":39,"stargazers_count":7,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-10T13:27:44.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scssphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-06-18T21:25:39.000Z","updated_at":"2024-06-18T23:28:58.000Z","dependencies_parsed_at":"2024-11-18T21:42:41.890Z","dependency_job_id":"992c59c1-8213-468a-992a-99b64e0314aa","html_url":"https://github.com/scssphp/server","commit_stats":{"total_commits":15,"total_committers":8,"mean_commits":1.875,"dds":0.6,"last_synced_commit":"905066da4d5a51138e60250cef60d375f6e94d99"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/scssphp/server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scssphp%2Fserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scssphp%2Fserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scssphp%2Fserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scssphp%2Fserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scssphp","download_url":"https://codeload.github.com/scssphp/server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scssphp%2Fserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30147961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T16:58:46.102Z","status":"ssl_error","status_checked_at":"2026-03-05T16:58:45.706Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-18T21:39:29.403Z","updated_at":"2026-03-05T20:00:04.716Z","avatar_url":"https://github.com/scssphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Server Example\n\nIf you just want to start serving compiled `scss` files as quick as possible\nthen start here. The **scssphp/server** project provides an easy-to-use example\nthat demonstrates how to automatically compile `scss` files and serve them from\na directory that you specify.\n\nCreate a file, like `style.php`:\n\n```\nuse ScssPhp\\Server\\Server;\n\n$directory = \"stylesheets\";\n\n$server = new Server($directory);\n$server-\u003eserve();\n```\n\nCreate the directory set in the script alongside the script, then add your\n`scss` files to it.\n\nBy default, **scssphp** expects a `scss_cache` directory to exist inside the\nstylesheets directory where it will cache the compiled output. This way it can\nquickly serve the files if no modifications have been made. Your PHP script\nmust have permission to write in `scss_cache`.\n\nGoing to the URL `example.com/style.php/style.scss` will attempt to compile\n`style.scss` from the `stylesheets` directory, and serve it as CSS.\n\nIf it can not find the file it will return an HTTP 404 page:\n\n```\n/* INPUT NOT FOUND scss v0.0.1 */\n```\n\nIf the file can't be compiled due to an error, then an HTTP 500 page is\nreturned. Similar to the following:\n\n```\nParse error: failed at 'height: ;' stylesheets/test.scss on line 8\n```\n\nAlso, because SCSS server writes headers, make sure no output is written before\nit runs.\n\n### Constructor\n\nUse the `Server` constructor to specify the cache directory and even the\ninstance of the `Compiler` that is used to compile SCSS.\n\n* `new Server($sourceDir, $cacheDir, $scss)` creates a new server that\n  serves files from `$sourceDir`. The cache dir is where the cached compiled\n  files are placed. When `null`, `$sourceDir . '/scss_cache'` is used. `$scss`\n  is the instance of `scss` that is used to compile.\n\nJust call the `serve` method to let it render its output.\n\nHere's an example of creating a SCSS server that outputs compressed CSS:\n\n```\nuse ScssPhp\\ScssPhp\\Compiler;\nuse ScssPhp\\Server\\Server;\n\n$scss = new Compiler();\n$scss-\u003esetOutputStyle(\\ScssPhp\\ScssPhp\\OutputStyle::COMPRESSED);\n\n$server = new Server('stylesheets', null, $scss);\n\n$server-\u003eserve();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscssphp%2Fserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscssphp%2Fserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscssphp%2Fserver/lists"}