/// <summary>
        /// Minify the css into one file
        /// </summary>
        /// <param name="helper">The helper.</param>
        /// <param name="filenames">The filenames.</param>
        /// <param name="outputPathandFilename">The output pathand filename.</param>
        /// <returns></returns>
        public static string Css(this HtmlHelper helper, IEnumerable <string> filenames, string outputPathandFilename)
        {
            ICssBundle        bundle  = Bundle.Css();
            ICssBundleBuilder builder = null;

            foreach (string filename in filenames)
            {
                if (builder == null)
                {
                    builder = bundle.Add(filename);
                }
                else
                {
                    builder.Add(filename);
                }
            }

            return(builder != null ? builder.Render(outputPathandFilename) : string.Empty);
        }
Example #2
0
 public static MvcHtmlString RenderMvc(this ICssBundleBuilder cssBundleBuilder, string renderTo)
 {
     return(MvcHtmlString.Create(cssBundleBuilder.Render(renderTo)));
 }
Example #3
0
 public static IHtmlString RenderMvc(this ICssBundleBuilder cssBundleBuilder, string renderTo)
 {
     return(new MvcHtmlString(cssBundleBuilder.Render(renderTo)));
 }