RSS

Tag Archives: Minifying

Additions to combine control

Ok, I’ve slightly changed some of the behaviour of the script combining control. In addition it now combines, compresses, minifies and caches CSS files! The CSS can also be used to target certain browsers and versions. It can be used like this:

<cc:CSSCombine ID="CSSCombiner" runat="server" CSSHandler="~/Handlers/CSSCombine.ashx">
<CSSReferences>
<cc:CSSReference TargetBrowser="All" Path="~/Styles/admin.css" /> <%--Will target all versions of all browsers--%>
<cc:CSSReference Path="~/Styles/webTV.css" /> <%-- Will target all versions of all browsers --%>
<cc:CSSReference TargetBrowser="IE" TargetVersion="8" Path="~/Styles/admin_old.css" /> <%-- Will target version 8 of IE --%>
<cc:CSSReference TargetBrowser="FF" TargetVersion="2" Path="~/Styles/screen.css" /> <%-- Will target versions 2 of FireFox --%>
<cc:CSSReference TargetBrowser="Chrome" Path="~/Styles/main.css" /> <%-- Will target all versions of Chrome --%>
<cc:CSSReference TargetBrowser="Safari" Path="~/Styles/sifr.css" /> <%-- Will target all versions of Safari --%>
</CSSReferences>
</cc:CSSCombine>

<cc:CSSCombine ID="CSSCombiner" runat="server" CSSHandler="~/Handlers/CSSCombine.ashx">

<CSSReferences>

<cc:CSSReference TargetBrowser="All" Path="~/Styles/admin.css" /> <%--Will target all versions of all browsers--%>

<cc:CSSReference Path="~/Styles/webTV.css" /> <%-- Will target all versions of all browsers --%>

<cc:CSSReference TargetBrowser="IE" TargetVersion="8" Path="~/Styles/admin_old.css" /> <%-- Will target version 8 of IE --%>

<cc:CSSReference TargetBrowser="FF" TargetVersion="2" Path="~/Styles/screen.css" /> <%-- Will target versions 2 of FireFox --%>

<cc:CSSReference TargetBrowser="Chrome" Path="~/Styles/main.css" /> <%-- Will target all versions of Chrome --%>

<cc:CSSReference TargetBrowser="Safari" Path="~/Styles/sifr.css" /> <%-- Will target all versions of Safari --%>

</CSSReferences>

</cc:CSSCombine>

Download it download

Advertisements
 
Leave a comment

Posted by on June 5, 2009 in C# Development, HTML / CSS, JavaScript

 

Tags: , , , , , ,