%{
	( _arg ) &&  ( _load = _arg);
    def a = _load
    if (!a) {
        a = _import
    }

    def caller = _caller
    while (caller._caller) caller = caller._caller
    def sm = caller.gsSM
    if (a) sm.addCss(a, _media)
}%

#{if (_output)}
    #{if (sm.minimize())}
        %{
        	def l = sm.getCssList(_media)
        	def fn = play.modules.greenscript.utils.Minimizor.minimizeCss(l);
        	def cdn = sm.getCdnItems(l)
        }%
        #{list items:cdn, as: '_'}
        	<link rel="stylesheet" type="text/css" media="${_media?:'all'}" href="${_}">
        #{/list}
        <link rel="stylesheet" type="text/css" media="${_media?:'all'}" href="${sm.gsUrl(fn)}">
    #{/if}
    #{else}
        #{list items:sm.getCssList(_media), as:'name'}
            <link rel="stylesheet" type="text/css" media="${_media?:'all'}" href="${sm.cssUrl(name)}">
        #{/list}
    #{/else}
#{/if}
