Njax3SmmM2x2a0Zf7Hpd
Njax3SmmM2x2a0Zf7Hpd

Reputation: 1364

How add a CSS Jelly file to Jenkins Plugin?

I have made my own stylesheet that I require to include on the Jenkins plugin.

   <l:layout css="/plugin/myPlugin/css/jquery-ui.css">
        <link rel="stylesheet" href="${rootURL}/plugin/myPlugin/jquery-ui.css" type="text/css" media="screen" />

Please advice me..

Thanks..

Upvotes: 2

Views: 3936

Answers (3)

whatsTheDiff
whatsTheDiff

Reputation: 745

Using a <link> element with the $rootURL as noted above worked for me. The important thing that I noticed was to make sure to place the <link> element after <l:layout>. I had it right after the <j:jelly> tag originally and it wasn't able to render the ${rootURL}.

The <link> tag will be much cleaner than doing inline styling.

Upvotes: 2

Ahmed Soliman
Ahmed Soliman

Reputation: 21

Place your css file(s) under

/src/webapp/css

and reference them as ..

" href="${rootURL}/plugin//css/layout.css"

Upvotes: 2

Sascha Vetter
Sascha Vetter

Reputation: 2506

To link CSS files in Jelly files is deprecated, see jelly tags documentation:

This was originally added to allow plugins to load their stylesheets, but the use of thie 
attribute is discouraged now. plugins should now do so by inserting <style> elements 
and/or <script> elements in <l:header/> tag.

Please use inline css tags instead (code example).

Upvotes: 3

Related Questions