Skip to content

Cascading Style Sheets

Taiizor edited this page Mar 1, 2023 · 2 revisions

CssExtension Class

The CssExtension class contains extension methods for CSS minification and beautification using NUglify and WebMarkupMin libraries.

Methods

ToMinify(string Css = MCCM.Css)

Minifies the CSS string using NUglify's KristensenCssMinifier.

Parameters

  • Css: The CSS string to be minified.

Returns

A string containing the minified CSS code.

Exceptions

  • Skylark.Exception: Throws an exception if the minification process encounters an error.

Task<string> ToMinifyAsync(string Css = MCCM.Css)

Asynchronously minifies the CSS string using NUglify's KristensenCssMinifier.

Parameters

  • Css: The CSS string to be minified.

Returns

A Task<string> containing the minified CSS code.

ToBeauty(string Css = MCCM.Css)

Beautifies the CSS string using NUglify's Uglify.Css method with CssSettings.Pretty().

Parameters

  • Css: The CSS string to be beautified.

Returns

A string containing the beautified CSS code.

Exceptions

  • Skylark.Exception: Throws an exception if the beautification process encounters an error.

Task<string> ToBeautyAsync(string Css = MCCM.Css)

Asynchronously beautifies the CSS string using NUglify's Uglify.Css method with CssSettings.Pretty().

Parameters

  • Css: The CSS string to be beautified.

Returns

A Task<string> containing the beautified CSS code.

Namespaces

  • NUglify
  • NUglify.Css
  • WebMarkupMin.Core
  • Skylark.Exception
  • Skylark.Helper.Length
  • Skylark.Standard.Manage.Css.CssManage
Clone this wiki locally