Shazwazza / Smidge

A lightweight runtime CSS/JavaScript file minification, combination, compression & management library for ASP.Net Core
MIT License
365 stars 47 forks source link

How to append media="screen" to css files refs #154

Closed craigs100 closed 1 year ago

craigs100 commented 2 years ago

I'm converting an old V7 Umbraco site to V9 and to use Smidge. The old site had:- <link rel="stylesheet" href="/fancybox/jquery.fancybox.css?v=2.1.5" media="screen" />

The new site has:- SmidgeHelper.RequiresCss("~/fancybox/jquery.fancybox.css");

How do we add the 'media="screen"' part, or can't we? Similar will apply for print css files of course which is probably more appropriate.

Thanks.

Shazwazza commented 1 year ago

You just use the link tag like you had before with your bundle name. Smidge supports tag helpers so you can just use tags. See docs https://github.com/Shazwazza/Smidge/wiki/Rendering