Fórumok

Use of VM Variables in CSS Files

thumbnail
MANOVINAYAK AYYAPPAN, módosítva 11 év-val korábban

Use of VM Variables in CSS Files

Regular Member Bejegyzések: 131 Csatlakozás dátuma: 2011.06.13. Legújabb bejegyzések
Hi All,

I would like to reference VM variables inside CSS files.

I tried the following:

I tried to load an Image referenced in one of my CSS files using the VM variable $images_folder as shown below:

#demo-Background{
	background-color: #0B2D53;
	/* background-image:url('../images/bg.jpg'); */
	background-image:url($images_folder/bg.jpg);
	height: 100%;
}


But the Image failed to Load.

Please let me know whether there is any other way to use VM variables apart from using the relative or absolute path.

I saw in Liferay source code that images are referenced in CSS file only using relative path:

portlet.css

.portlet-icon-back {
	background: url(../images/arrows/01_left.png) no-repeat 0 50%;
	font-weight: bold;
	padding: 5px 5px 5px 18px;
}