public Dotless(DotlessOptions options = null)
 {
     if (options == null)
     {
         options = new DotlessOptions(); // defaults
     }
     _config = DotlessConfiguration.GetDefault();
     _config.KeepFirstSpecialComment = options.KeepFirstSpecialComment;
     _config.RootPath = options.RootPath;
     if (!String.IsNullOrWhiteSpace(_config.RootPath) && !_config.RootPath.EndsWith("/"))
     {
         _config.RootPath += "/";
     }
     _config.InlineCssFiles       = options.InlineCssFiles;
     _config.ImportAllFilesAsLess = options.ImportAllFilesAsLess;
     _config.MinifyOutput         = options.MinifyOutput;
     _config.Debug        = options.Debug;
     _config.Optimization = options.Optimization;
     _config.StrictMath   = options.StrictMath;
     _cssToLess           = new FilenameTransform(options.CssMatchPattern, options.LessSourceFilePattern);
     _stylizer            = new PlainStylizer();
 }
        public static StaticFileTransformBuilder UseDotless(this StaticFileTransformBuilder builder, DotlessOptions options)
        {
            var dotless = new Dotless(options);

            return(builder.Use(dotless.Apply).IfMatches(dotless.Matches).WithCompilerPriority());
        }
 public static IServiceCollection AddDotless(this IServiceCollection collection, DotlessOptions options = null)
 => collection.AddSingleton <IStaticFileTransform>(services => new StaticFileTransformBuilder().UseDotless(options).Build());