{"id":19228148,"url":"https://github.com/taritsyn/dartsasshost","last_synced_at":"2025-04-21T01:32:02.247Z","repository":{"id":45554659,"uuid":"309700656","full_name":"Taritsyn/DartSassHost","owner":"Taritsyn","description":".NET wrapper around the Dart Sass.","archived":false,"fork":false,"pushed_at":"2025-02-19T14:24:24.000Z","size":14738,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-16T01:11:56.104Z","etag":null,"topics":["csharp","dart-sass","dotnet","sass"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Taritsyn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2020-11-03T13:49:45.000Z","updated_at":"2025-02-19T14:24:28.000Z","dependencies_parsed_at":"2024-01-07T18:32:31.543Z","dependency_job_id":"8fe3938a-648a-4b4c-aa13-c5ad1f4672e0","html_url":"https://github.com/Taritsyn/DartSassHost","commit_stats":{"total_commits":110,"total_committers":1,"mean_commits":110.0,"dds":0.0,"last_synced_commit":"5e60122eacba8cbe32f51cf9530b1542335f8ecf"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Taritsyn%2FDartSassHost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Taritsyn%2FDartSassHost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Taritsyn%2FDartSassHost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Taritsyn%2FDartSassHost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Taritsyn","download_url":"https://codeload.github.com/Taritsyn/DartSassHost/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982567,"owners_count":21355720,"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":["csharp","dart-sass","dotnet","sass"],"created_at":"2024-11-09T15:26:54.122Z","updated_at":"2025-04-21T01:32:02.240Z","avatar_url":"https://github.com/Taritsyn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dart Sass Host for .NET [![NuGet version](http://img.shields.io/nuget/v/DartSassHost.svg)](https://www.nuget.org/packages/DartSassHost/)  [![Download count](https://img.shields.io/nuget/dt/DartSassHost.svg)](https://www.nuget.org/packages/DartSassHost/)\n=======================\n\n![Dart Sass Host logo](https://raw.githubusercontent.com/Taritsyn/DartSassHost/main/images/DartSassHost_Logo.png)\n\n.NET wrapper around the [Dart Sass](https://github.com/sass/dart-sass) with the ability to support a virtual file system.\nUnlike other .NET wrappers around the Dart Sass (e.g. [Citizen17.DartSass](https://github.com/Vampire2008/Citizen17.DartSass) and [AspNetCore.SassCompiler](https://github.com/koenvzeijl/AspNetCore.SassCompiler)), this library is not based on the Dart runtime, but on the [version for JavaScript](https://www.npmjs.com/package/sass).\n\n## Installation\nThis library can be installed through NuGet - [https://nuget.org/packages/DartSassHost](https://nuget.org/packages/DartSassHost).\nSince the original library is written in JavaScript, you will need a JS engine to run it.\nAs a JS engine is used the [JavaScript Engine Switcher](https://github.com/Taritsyn/JavaScriptEngineSwitcher) library.\nFor correct working, you need to install one of the following NuGet packages:\n\n * [JavaScriptEngineSwitcher.ChakraCore](https://nuget.org/packages/JavaScriptEngineSwitcher.ChakraCore/)\n * [JavaScriptEngineSwitcher.Jint](https://www.nuget.org/packages/JavaScriptEngineSwitcher.Jint)\n * [JavaScriptEngineSwitcher.Msie](https://nuget.org/packages/JavaScriptEngineSwitcher.Msie) (only in the Chakra “Edge” JsRT mode)\n * [JavaScriptEngineSwitcher.V8](https://nuget.org/packages/JavaScriptEngineSwitcher.V8)\n\nAfter installing the packages, you will need to [register the default JS engine](https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/Registration-of-JS-engines).\n\n## Usage\nWhen we create an instance of the \u003ccode title=\"DartSassHost.SassCompiler\"\u003eSassCompiler\u003c/code\u003e class by using the constructor without parameters:\n\n```csharp\nvar sassCompiler = new SassCompiler();\n```\n\nThen we always use a JS engine registered by default. In fact, a constructor without parameters is equivalent to the following code:\n\n```csharp\nvar sassCompiler = new SassCompiler(JsEngineSwitcher.Current.CreateDefaultEngine);\n```\n\nThis approach is great for web applications, but in some cases the usage of JS engine registration at global level will be redundant.\nIt is for such cases that the possibility of passing of the JS engine factory to the constructor is provided:\n\n```csharp\nvar sassCompiler = new SassCompiler(new ChakraCoreJsEngineFactory());\n```\n\nYou can also use a delegate that creates an instance of the JS engine:\n\n```csharp\nvar sassCompiler = new SassCompiler(() =\u003e new ChakraCoreJsEngine());\n```\n\nThe main feature of this library is ability to support a virtual file system. You can pass an file manager through constructor of the \u003ccode title=\"DartSassHost.SassCompiler\"\u003eSassCompiler\u003c/code\u003e class:\n\n```csharp\nvar sassCompiler = new SassCompiler(CustomFileManager());\n```\n\nAny public class, that implements an \u003ccode title=\"DartSassHost.IFileManager\"\u003eIFileManager\u003c/code\u003e interface, can be used as a file manager. A good example of implementing a custom file manager, which provides access to the virtual file system, is the \u003ca href=\"https://github.com/Taritsyn/BundleTransformer/blob/master/src/BundleTransformer.SassAndScss/Internal/VirtualFileManager.cs\" target=\"_blank\"\u003e\u003ccode title=\"BundleTransformer.SassAndScss.Internal.VirtualFileManager\"\u003eVirtualFileManager\u003c/code\u003e\u003c/a\u003e class from the \u003ca href=\"https://github.com/Taritsyn/BundleTransformer/wiki/Sass-and-SCSS\" target=\"_blank\"\u003eBundleTransformer.SassAndScss\u003c/a\u003e package.\n\nIt should also be noted, that this library does not write the result of compilation to disk. `Compile` and `CompileFile` methods of the \u003ccode title=\"DartSassHost.SassCompiler\"\u003eSassCompiler\u003c/code\u003e class return the result of compilation in the form of an instance of the \u003ccode title=\"DartSassHost.CompilationResult\"\u003eCompilationResult\u003c/code\u003e class. Consider in detail properties of the \u003ccode title=\"DartSassHost.CompilationResult\"\u003eCompilationResult\u003c/code\u003e class:\n\n\u003ctable border=\"1\" style=\"font-size: 0.7em\"\u003e\n    \u003cthead\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003cth\u003eProperty name\u003c/th\u003e\n            \u003cth\u003eData\u0026nbsp;type\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eCompiledContent\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.String\"\u003eString\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eCSS code.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eIncludedFilePaths\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Collections.Generic.IList\u0026lt;string\u0026gt;\"\u003eIList\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eList of included files.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eSourceMap\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.String\"\u003eString\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eSource map.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eWarnings\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Collections.Generic.IList\u0026lt;DartSassHost.ProblemInfo\u0026gt;\"\u003eIList\u0026lt;ProblemInfo\u0026gt;\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eList of the warnings.\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\nConsider a simple example of usage of the `Compile` method:\n\n```csharp\nusing System;\n\nusing DartSassHost;\nusing DartSassHost.Helpers;\nusing JavaScriptEngineSwitcher.ChakraCore;\n\nnamespace DartSassHost.Example.ConsoleApplication\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            const string inputContent = @\"$font-stack: Helvetica, sans-serif;\n$primary-color: #333;\n\nbody {\n  font: 100% $font-stack;\n  color: $primary-color;\n}\";\n\n            var options = new CompilationOptions { SourceMap = true };\n\n            try\n            {\n                using (var sassCompiler = new SassCompiler(new ChakraCoreJsEngineFactory(), options))\n                {\n                    CompilationResult result = sassCompiler.Compile(inputContent, \"input.scss\",\n                        \"output.css\", \"output.css.map\", options);\n\n                    Console.WriteLine(\"Compiled content:{1}{1}{0}{1}\", result.CompiledContent,\n                        Environment.NewLine);\n                    Console.WriteLine(\"Source map:{1}{1}{0}{1}\", result.SourceMap, Environment.NewLine);\n                    Console.WriteLine(\"Included file paths: {0}\",\n                        string.Join(\", \", result.IncludedFilePaths));\n                }\n            }\n            catch (SassCompilerLoadException e)\n            {\n                Console.WriteLine(\"During loading of Sass compiler an error occurred. See details:\");\n                Console.WriteLine();\n                Console.WriteLine(SassErrorHelpers.GenerateErrorDetails(e));\n            }\n            catch (SassCompilationException e)\n            {\n                Console.WriteLine(\"During compilation of SCSS code an error occurred. See details:\");\n                Console.WriteLine();\n                Console.WriteLine(SassErrorHelpers.GenerateErrorDetails(e));\n            }\n            catch (SassException e)\n            {\n                Console.WriteLine(\"During working of Sass compiler an unknown error occurred. See details:\");\n                Console.WriteLine();\n                Console.WriteLine(SassErrorHelpers.GenerateErrorDetails(e));\n            }\n        }\n    }\n}\n```\n\nFirst we create an instance of the \u003ccode title=\"DartSassHost.SassCompiler\"\u003eSassCompiler\u003c/code\u003e class, in the constructor of which we pass the JS engine factory and compilation options.\nLet's consider in detail properties of the \u003ccode title=\"DartSassHost.CompilationOptions\"\u003eCompilationOptions\u003c/code\u003e class:\n\n\u003ctable border=\"1\" style=\"font-size: 0.7em\"\u003e\n    \u003cthead\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003cth\u003eProperty name\u003c/th\u003e\n            \u003cth\u003eData\u0026nbsp;type\u003c/th\u003e\n            \u003cth\u003eDefault value\u003c/th\u003e\n            \u003cth\u003eDescription\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eCharset\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Boolean\"\u003eBoolean\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eFlag for whether to emit a \u003ccode\u003e@charset\u003c/code\u003e or BOM for CSS with non-ASCII characters.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eFatalDeprecations\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Collections.Generic.IList\u0026lt;string\u0026gt;\"\u003eIList\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eEmpty list\u003c/td\u003e\n            \u003ctd\u003e\n                \u003cp\u003eList of deprecations to treat as fatal.\u003c/p\u003e\n                \u003cp\u003eIf a deprecation warning of any provided ID is encountered during compilation, the compiler will error instead.\u003c/p\u003e\n                \u003cp\u003eIf a version is provided, then all deprecations that were active in that compiler version will be treated as fatal.\u003c/p\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eFutureDeprecations\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Collections.Generic.IList\u0026lt;string\u0026gt;\"\u003eIList\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eEmpty list\u003c/td\u003e\n            \u003ctd\u003e\n                \u003cp\u003eList of future deprecations to opt into early.\u003c/p\u003e\n                \u003cp\u003eFuture deprecations, whose IDs have been passed here, will be treated as active by the compiler, emitting warnings as necessary.\u003c/p\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eIncludePaths\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Collections.Generic.IList\u0026lt;string\u0026gt;\"\u003eIList\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eEmpty list\u003c/td\u003e\n            \u003ctd\u003eList of paths that library can look in to attempt to resolve \u003ccode\u003e@import\u003c/code\u003e declarations.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eIndentType\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"DartSassHost.IndentType\"\u003eIndentType\u003c/code\u003e enumeration\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eSpace\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eIndent type. Can take the following values:\n                \u003cul\u003e\n                    \u003cli\u003e\u003ccode\u003eSpace\u003c/code\u003e - space character\u003c/li\u003e\n                    \u003cli\u003e\u003ccode\u003eTab\u003c/code\u003e - tab character\u003c/li\u003e\n                \u003c/ul\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eIndentWidth\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Int32\"\u003eInt32\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003e2\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eNumber of spaces or tabs to be used for indentation.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eInlineSourceMap\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Boolean\"\u003eBoolean\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eFlag for whether to embed \u003ccode\u003esourceMappingUrl\u003c/code\u003e as data uri.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eLineFeedType\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"DartSassHost.LineFeedType\"\u003eLineFeedType\u003c/code\u003e enumeration\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eLf\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eLine feed type. Can take the following values:\n                \u003cul\u003e\n                    \u003cli\u003e\u003ccode\u003eCr\u003c/code\u003e - Macintosh (CR)\u003c/li\u003e\n                    \u003cli\u003e\u003ccode\u003eCrLf\u003c/code\u003e - Windows (CR LF)\u003c/li\u003e\n                    \u003cli\u003e\u003ccode\u003eLf\u003c/code\u003e - Unix (LF)\u003c/li\u003e\n                    \u003cli\u003e\u003ccode\u003eLfCr\u003c/code\u003e\u003c/li\u003e\n                \u003c/ul\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eOmitSourceMapUrl\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Boolean\"\u003eBoolean\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eFlag for whether to disable \u003ccode\u003esourceMappingUrl\u003c/code\u003e in css output.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eOutputStyle\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"DartSassHost.OutputStyle\"\u003eOutputStyle\u003c/code\u003e enumeration\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eExpanded\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eOutput style for the generated css code. Can take the following values:\n                \u003cul\u003e\n                    \u003cli\u003e\u003ccode\u003eExpanded\u003c/code\u003e\u003c/li\u003e\n                    \u003cli\u003e\u003ccode\u003eCompressed\u003c/code\u003e\u003c/li\u003e\n                \u003c/ul\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eQuietDependencies\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Boolean\"\u003eBoolean\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eFlag for whether to silence compiler warnings from stylesheets loaded by using the \u003ccode\u003eIncludePaths\u003c/code\u003e property.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eSilenceDeprecations\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Collections.Generic.IList\u0026lt;string\u0026gt;\"\u003eIList\u0026lt;string\u0026gt;\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eEmpty list\u003c/td\u003e\n            \u003ctd\u003e\n                \u003cp\u003eList of active deprecations to ignore.\u003c/p\u003e\n                \u003cp\u003eIf a deprecation warning of any provided ID is encountered during compilation, the compiler will ignore it instead.\u003c/p\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eSourceMap\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Boolean\"\u003eBoolean\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eFlag for whether to enable source map generation.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eSourceMapIncludeContents\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.Boolean\"\u003eBoolean\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eFlag for whether to include contents in maps.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eSourceMapRootPath\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"System.String\"\u003eString\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eEmpty string\u003c/td\u003e\n            \u003ctd\u003eValue will be emitted as \u003ccode\u003esourceRoot\u003c/code\u003e in the source map information.\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr valign=\"top\"\u003e\n            \u003ctd\u003e\u003ccode\u003eWarningLevel\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode title=\"DartSassHost.WarningLevel\"\u003eWarningLevel\u003c/code\u003e enumeration\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eDefault\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003eWarning level. Can take the following values:\n                \u003cul\u003e\n                    \u003cli\u003e\u003ccode\u003eQuiet\u003c/code\u003e - warnings are not displayed\u003c/li\u003e\n                    \u003cli\u003e\u003ccode\u003eDefault\u003c/code\u003e - displayed only 5 instances of the same deprecation warning per compilation\u003c/li\u003e\n                    \u003cli\u003e\u003ccode\u003eVerbose\u003c/code\u003e - displayed all deprecation warnings\u003c/li\u003e\n                \u003c/ul\u003e\n            \u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\nThen we call the `Compile` method with the following parameters:\n\n 1. `content` - text content written on Sass/SCSS.\n 1. `inputPath` - path to input Sass/SCSS file. Needed for generation of source map.\n 1. `outputPath` (optional) - path to output CSS file. Needed for generation of source map. If path to output file is not specified, but specified a path to input file, then value of this parameter is obtained by replacing extension in the input file path by `.css` extension.\n 1. `sourceMapPath` (optional) - path to source map file. If path to source map file is not specified, but specified a path to output file, then value of this parameter is obtained by replacing extension in the output file path by `.css.map` extension.\n\nThen output result of compilation to the console.\nIn addition, we provide handling of the following exception types: \u003ccode title=\"DartSassHost.SassCompilerLoadException\"\u003eSassCompilerLoadException\u003c/code\u003e, \u003ccode title=\"DartSassHost.SassCompilationException\"\u003eSassCompilationException\u003c/code\u003e and \u003ccode title=\"DartSassHost.SassException\"\u003eSassException\u003c/code\u003e.\nIn the Dart Sass Host, exceptions have the following hierarchy:\n\n  * \u003ccode title=\"DartSassHost.SassException\"\u003eSassException\u003c/code\u003e\n    * \u003ccode title=\"DartSassHost.SassCompilerLoadException\"\u003eSassCompilerLoadException\u003c/code\u003e\n    * \u003ccode title=\"DartSassHost.SassCompilationException\"\u003eSassCompilationException\u003c/code\u003e\n\nUsing of the `CompileFile` method quite a bit different from using of the `Compile` method:\n\n```csharp\nusing System;\nusing System.IO;\n\nusing DartSassHost;\nusing DartSassHost.Helpers;\nusing JavaScriptEngineSwitcher.ChakraCore;\n\nnamespace DartSassHost.Example.ConsoleApplication\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            const string basePath = \"/Projects/TestSass\";\n            string inputFilePath = Path.Combine(basePath, \"style.scss\");\n            string outputFilePath = Path.Combine(basePath, \"style.css\");\n            string sourceMapFilePath = Path.Combine(basePath, \"style.css.map\");\n\n            var options = new CompilationOptions { SourceMap = true };\n\n            try\n            {\n                using (var sassCompiler = new SassCompiler(new ChakraCoreJsEngineFactory(), options))\n                {\n                    CompilationResult result = sassCompiler.CompileFile(inputFilePath, outputFilePath,\n                        sourceMapFilePath, options);\n\n                    Console.WriteLine(\"Compiled content:{1}{1}{0}{1}\", result.CompiledContent,\n                        Environment.NewLine);\n                    Console.WriteLine(\"Source map:{1}{1}{0}{1}\", result.SourceMap, Environment.NewLine);\n                    Console.WriteLine(\"Included file paths: {0}\",\n                        string.Join(\", \", result.IncludedFilePaths));\n                }\n            }\n            catch (SassCompilerLoadException e)\n            {\n                Console.WriteLine(\"During loading of Sass compiler an error occurred. See details:\");\n                Console.WriteLine();\n                Console.WriteLine(SassErrorHelpers.GenerateErrorDetails(e));\n            }\n            catch (SassCompilationException e)\n            {\n                Console.WriteLine(\"During compilation of SCSS code an error occurred. See details:\");\n                Console.WriteLine();\n                Console.WriteLine(SassErrorHelpers.GenerateErrorDetails(e));\n            }\n            catch (SassException e)\n            {\n                Console.WriteLine(\"During working of Sass compiler an unknown error occurred. See details:\");\n                Console.WriteLine();\n                Console.WriteLine(SassErrorHelpers.GenerateErrorDetails(e));\n            }\n        }\n    }\n}\n```\n\nIn this case, the `inputPath` parameter is used instead of the `content` parameter. Moreover, value of the `inputPath` parameter now should contain the path to real file.\n\n## Who's Using Dart Sass Host for .NET\nIf you use the Dart Sass Host for .NET in some project, please send me a message so I can include it in this list:\n\n * [Abstractions Sass Compiler CI Build](https://www.nuget.org/packages/Abstractions.Sass.CIBuild) by Abstractions AS\n * [Abstractions Sass Compiler Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AbstractionsAS.AbstractionsSassVisualStudioExtension) by Abstractions AS\n * [Bundle Transformer](https://github.com/Taritsyn/BundleTransformer) by Andrey Taritsyn\n * [DartSassBuilder](https://github.com/deanwiseman/DartSassBuilder) by Dean Wiseman\n * [DartSassBuildWatcherTool](https://github.com/MONQDL/DartSassBuildWatcherTool) by Sergey Pismennyi\n * [Excubo.WebCompiler](https://github.com/excubo-ag/WebCompiler) by Stefan Lörwald\n * [LigerShark.WebOptimizer.Sass](https://github.com/ligershark/WebOptimizer.Sass) by Mads Kristensen\n * [WatchSass.Tool](https://github.com/mangeg/sass-watcher-tool) by Magnus Gideryd","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaritsyn%2Fdartsasshost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaritsyn%2Fdartsasshost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaritsyn%2Fdartsasshost/lists"}