{"id":33228878,"url":"https://github.com/xoofx/SharpScss","last_synced_at":"2025-11-17T03:00:48.082Z","repository":{"id":60773450,"uuid":"55464652","full_name":"xoofx/SharpScss","owner":"xoofx","description":"A portable cross-platform pinvoke .NET wrapper around libsass to convert SCSS to CSS","archived":false,"fork":false,"pushed_at":"2024-11-02T10:50:46.000Z","size":21780,"stargazers_count":58,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T23:45:40.514Z","etag":null,"topics":["css","dotnet","dotnet-core","dotnet-standard","libsass","sass","scss"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xoofx.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","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},"funding":{"github":["xoofx"]}},"created_at":"2016-04-05T03:26:26.000Z","updated_at":"2025-03-23T17:33:14.000Z","dependencies_parsed_at":"2024-04-09T22:50:44.007Z","dependency_job_id":"5ec92d36-0bd2-48fd-8bbc-b94bdc3249d8","html_url":"https://github.com/xoofx/SharpScss","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"06a3128c660bf7b62d6e58e153dc33c37f418329"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/xoofx/SharpScss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FSharpScss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FSharpScss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FSharpScss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FSharpScss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xoofx","download_url":"https://codeload.github.com/xoofx/SharpScss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoofx%2FSharpScss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284813088,"owners_count":27067232,"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-11-17T02:00:06.431Z","response_time":55,"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":["css","dotnet","dotnet-core","dotnet-standard","libsass","sass","scss"],"created_at":"2025-11-16T17:00:34.389Z","updated_at":"2025-11-17T03:00:48.067Z","avatar_url":"https://github.com/xoofx.png","language":"C#","funding_links":["https://github.com/sponsors/xoofx"],"categories":["Tools"],"sub_categories":["Miscellaneous"],"readme":"# SharpScss [![ci](https://github.com/xoofx/SharpScss/actions/workflows/ci.yml/badge.svg)](https://github.com/xoofx/SharpScss/actions/workflows/ci.yml) [![NuGet](https://img.shields.io/nuget/v/SharpScss.svg)](https://www.nuget.org/packages/SharpScss/)\n\n\u003cimg align=\"right\" width=\"160px\" height=\"160px\" src=\"https://raw.githubusercontent.com/xoofx/SharpScss/master/img/SharpScss.png\"\u003e\n\nSharpScss is a P/Invoke .NET wrapper around [libsass](https://github.com/sass/libsass) to convert SCSS to CSS.\n\n\u003e Based on the version of `libsass 3.6.6`\n\n## Features\n\n- Pure P/Invoke .NET wrapper, no C++/CLI involved\n- Supports converting from a string or from a file\n- Supports include paths\n- Supports for source maps\n- Supports for `libsass` user custom importer callback in `ScssOptions.TryImport`\n- Supports for `netstandard2.0` and `net8.0`+\n- Supports the following platforms:\n    - `win-x86`\n    - `win-x64`\n    - `win-arm`\n    - `win-arm64`\n    - `linux-x64`\n    - `linux-arm`\n    - `linux-arm64`\n    - `linux-musl-x64`\n    - `linux-musl-arm`\n    - `linux-musl-arm64`\n    - `osx-x64`\n    - `osx-arm64`\n\nFor older .NET2.0, .NET3.5, .NET4.x+ and `netstandard1.3`, you need to download the `1.4.0` version.\n\n## Download\n\nSharpScss is available on [![NuGet](https://img.shields.io/nuget/v/SharpScss.svg)](https://www.nuget.org/packages/SharpScss/)\n\n## Usage\n\nSharpScss API is simply composed of a main `Scss` class:\n\n- `Scss.ConvertToCss`: to convert a `SCSS` string to a `CSS`  \n\n```\nvar result = Scss.ConvertToCss(\"div {color: #FFF;}\")\nConsole.WriteLine(result.Css);\n```\n\n- `Scss.ConvertFileToCss`: to convert a `SCSS` file to a `CSS`  \n\n```\nvar result = Scss.ConvertFileToCss(\"test.scss\")\nConsole.WriteLine(result.Css);\n```\n\nUsing the `ScssOptions` you can specify additional parameters:\n\n```\nvar result = Scss.ConvertToCss(@\"div {color: #FFF;}\", new ScssOptions()\n{\n\tInputFile = \"Test.scss\",\n\tOutputFile = \"Test.css\", // Note: It will not generate the file, \n                             // only used for exception reporting\n                             // includes and source maps\n\tGenerateSourceMap = true\n});\nConsole.WriteLine(result.Css);\nConsole.WriteLine(result.SourceMap);\n```\n\nYou can use also custom dynamic import through the delegate `ScssOptions.TryImport`. Note that in that cases `ScssOptions.IncludePaths` is not used \nand it is the responsability of the `TryImport` to perform the resolution (e.g on a virtual file system):\n\n``` \nvar result = Scss.ConvertToCss(@\"@import \"\"foo\"\";\", new ScssOptions()\n{\n\tInputFile = \"test.scss\",\n\tTryImport = (ref string file, string path, out string scss, out string map) =\u003e\n\t{\n        // Add resolve the file\n        // file = resolvedFilePath; // Can change the file resolved\n\t\tscss = ...; // TODO: handle the loading of scss for the specified file\n\t\tmap = null;\n\t\treturn true;\n\t}\n});\n```\n\n## Runtime\n\nSharpScss depends on the native runtime `libsass`. This runtime is compiled for the following platform/runtime:\n\n- `win-x86`\n- `win-x64`\n- `win-arm`\n- `win-arm64`\n- `linux-x64`\n- `linux-arm`\n- `linux-arm64`\n- `linux-musl-x64`\n- `linux-musl-arm`\n- `linux-musl-arm64`\n- `osx-x64`\n- `osx-arm64`\n\nOn .NET Core (`net8.0`), the runtime is selected based on the [Runtime Identifier - RID](https://docs.microsoft.com/en-us/dotnet/articles/core/rid-catalog) of your project.\n\n- You can add to your csproj the specific targeting runtimes your `net8.0` with `\u003cRuntimeIdentifiers\u003ewin-x86;linux-x64\u003c/RuntimeIdentifiers\u003e` or `\u003cRuntimeIdentifier\u003e` if you have only one runtime to target (See [Additions to the csproj format for .NET Core](https://docs.microsoft.com/en-us/dotnet/articles/core/tools/csproj))\n\n## Build\n\nCurrently, the compiled version of libsass shipped with SharpScss is a custom build from the fork [xoofx/libsass](https://github.com/xoofx/libsass)\n\nThis fork is mainly allowing to compile libsass without the MSVC C/C++ Runtime on Windows and provide a GitHub CI action to compile all different platforms.\n\n## License\n\nThis software is released under the [BSD-Clause 2 license](http://opensource.org/licenses/BSD-2-Clause). \n\n## Author\n\nAlexandre Mutel aka [xoofx](https://xoofx.github.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxoofx%2FSharpScss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxoofx%2FSharpScss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxoofx%2FSharpScss/lists"}