Пример #1
0
        /// <summary>
        /// Returns a CssSettings object configured to output "pretty" css, as opposed to minified
        /// </summary>
        /// <returns></returns>
        public static CssSettings Pretty()
        {
            var settings = new CssSettings();

            settings.CommentMode       = CssComment.All;
            settings.MinifyExpressions = false;
            settings.OutputMode        = OutputMode.MultipleLines;
            settings.TermSemicolons    = true;
            return(settings);
        }
Пример #2
0
        public CssSettings Clone()
        {
            // create the new settings object and copy all the properties from
            // the current settings
            var newSettings = new CssSettings
            {
                AllowEmbeddedAspNetBlocks = AllowEmbeddedAspNetBlocks,
                ColorNames                = ColorNames,
                CommentMode               = CommentMode,
                FixIE8Fonts               = FixIE8Fonts,
                IgnoreAllErrors           = IgnoreAllErrors,
                IgnoreErrorList           = IgnoreErrorList,
                Indent                    = Indent,
                KillSwitch                = KillSwitch,
                LineBreakThreshold        = LineBreakThreshold,
                MinifyExpressions         = MinifyExpressions,
                OutputMode                = OutputMode,
                PreprocessorDefineList    = PreprocessorDefineList,
                TermSemicolons            = TermSemicolons,
                CssType                   = CssType,
                BlocksStartOnSameLine     = BlocksStartOnSameLine,
                RemoveEmptyBlocks         = RemoveEmptyBlocks,
                IgnoreRazorEscapeSequence = IgnoreRazorEscapeSequence,
                DecodeEscapes             = DecodeEscapes
            };

            // add the resource strings (if any)
            newSettings.AddResourceStrings(ResourceStrings);

            foreach (var item in ReplacementTokens)
            {
                newSettings.ReplacementTokens.Add(item);
            }

            foreach (var item in ReplacementFallbacks)
            {
                newSettings.ReplacementTokens.Add(item);
            }

            foreach (var item in ExcludeVendorPrefixes)
            {
                newSettings.ExcludeVendorPrefixes.Add(item);
            }

            return(newSettings);
        }
Пример #3
0
        public CssSettings Clone()
        {
            // create the new settings object and copy all the properties from
            // the current settings
            var newSettings = new CssSettings()
            {
                AllowEmbeddedAspNetBlocks = this.AllowEmbeddedAspNetBlocks,
                ColorNames             = this.ColorNames,
                CommentMode            = this.CommentMode,
                FixIE8Fonts            = this.FixIE8Fonts,
                IgnoreAllErrors        = this.IgnoreAllErrors,
                IgnoreErrorList        = this.IgnoreErrorList,
                IndentSize             = this.IndentSize,
                KillSwitch             = this.KillSwitch,
                LineBreakThreshold     = this.LineBreakThreshold,
                MinifyExpressions      = this.MinifyExpressions,
                OutputMode             = this.OutputMode,
                PreprocessorDefineList = this.PreprocessorDefineList,
                TermSemicolons         = this.TermSemicolons,
                CssType = this.CssType,
                BlocksStartOnSameLine = this.BlocksStartOnSameLine,
                RemoveEmptyBlocks     = this.RemoveEmptyBlocks,
            };

            // add the resource strings (if any)
            newSettings.AddResourceStrings(this.ResourceStrings);

            foreach (var item in this.ReplacementTokens)
            {
                newSettings.ReplacementTokens.Add(item);
            }

            foreach (var item in this.ReplacementFallbacks)
            {
                newSettings.ReplacementTokens.Add(item);
            }

            foreach (var item in this.ExcludeVendorPrefixes)
            {
                newSettings.ExcludeVendorPrefixes.Add(item);
            }

            return(newSettings);
        }