This is how I refer my css
file in my index.xhtml
:
<h:outputStylesheet library="css" name="vendors/fontello.css" />
And that's how I'm using #resources
, which works fine:
background-image: url("#{resource['img:lang/ico-en.gif']}");
This way is how it's working in a HTML project:
@font-face {
font-family: 'fontello';
src: url('../font/fontello69db.eot?24671060');
src: url('../font/fontello69db.eot?24671060#iefix') format('embedded-opentype'),
url('../font/fontello69db.woff?24671060') format('woff'),
url('../font/fontello69db.ttf?24671060') format('truetype'),
url('../font/fontello69db.svg?24671060#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?24671060#fontello') format('svg');
}
}
*/
Then as I'm moving the HTML project into JSF 2 project I would like to use #resources
, right ? So I did the same thing as before but doesn't work:
@font-face {
font-family: 'fontello';
src: url("#{resource[css:font/fontello69db.eot?24671060']}");
/* src: url("#{resource[css:font/fontello69db.eot?24671060');*/
src: url("#{resource[css:font/fontello69db.eot?24671060#iefix']}") format('embedded-opentype'),
url("#{resource[css:font/fontello69db.woff?24671060']}") format('woff'),
url("#{resource[css:font/fontello69db.ttf?24671060']}") format('truetype'),
url("#{resource[css:font/fontello69db.svg?24671060#fontello']}") format('svg');
font-weight: normal;
font-style: normal;
}
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url("#{resource[css:font/fontello.svg?24671060#fontello']}") format('svg');
}
}
*/
And this is my project structure:
Any idea how to use #resource
correctly in this case ?