Is there a way to use something like $ {resource (dir: 'images', file: 'myimage.png')} in a CSS file with grails? I can define URLs, usually in CSS, but it is not portable.
Try changing the extension of your css file from ".css" to ".css.gsp". You can then use the resource tags inside these files.
Relative URLs are rewritten by the resource plugin. See this SO question .
If you want to use groovy code and grails plugins inside CSS, you can use the GSP Resource Plugin .
Source: https://habr.com/ru/post/1494024/More articles:How to load Json data - javascriptScan image to text in Python-Django - pythonRedirect Loop (HTTP_REFERER) - redirecthttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1494022/uploading-photos-to-facebook-adding-parameters-before-executing-the-newuploadphotorequest-call-gives-the-oauthexception-error&usg=ALkJrhgtQakAgFpgTdzdLGp6lqWzG9m3mQHow to limit the total number of rows in a mysql table - mysqlHow do you create a threshold or limit a mysql table? - mysqlGatling plugin for Jenkins without pom.xml - jenkinsitextsharp doesn't care about my html styles - c #Does DOM elements hide performance? - performanceList of tuples in django template - pythonAll Articles