Web Developer
ASP.NET, Visual Basic.NET, C#, TSQL, HTML, CSS, PHP, JavaScript, WordPress, WooCommerce
Windows Server, Internet Information Server, SQL Server, Hyper-V

Минимизация каскадных стилей на VB.NET

Фунция для минимизации каскадных стилей на VB.NET:

Public Shared Function RemoveWhiteSpaceFromStylesheets(body As String) As String

    body = Regex.Replace(body, "[a-zA-Z]+#", "#")
    body = Regex.Replace(body, "[nr]+s*", String.Empty)
    body = Regex.Replace(body, "s+", " ")
    body = Regex.Replace(body, "s?([:,;{}])s?", "$1")
    body = body.Replace(";}", "}")
    body = Regex.Replace(body, "([s:]0)(px|pt|%|em)", "$1")
    body = Regex.Replace(body, "/*[dD]*?*/", String.Empty)

    Return body

End Function
Share

You may also like...

Добавить комментарий

Ваш адрес email не будет опубликован.