MediaWiki
REL1_22
|
Static Public Member Functions | |
static | embed ($frame, $less) |
Convert an image URI to a base64-encoded data URI. | |
static | embeddable ($frame, $less) |
Check if an image file reference is suitable for embedding. |
Definition at line 23 of file ResourceLoaderLESSFunctions.php.
static ResourceLoaderLESSFunctions::embed | ( | $ | frame, |
$ | less | ||
) | [static] |
Convert an image URI to a base64-encoded data URI.
.fancy-button { background-image: embed('../images/button-bg.png'); }
Definition at line 58 of file ResourceLoaderLESSFunctions.php.
References $file, and CSSMin\encodeImageAsDataURI().
static ResourceLoaderLESSFunctions::embeddable | ( | $ | frame, |
$ | less | ||
) | [static] |
Check if an image file reference is suitable for embedding.
An image is embeddable if it (a) exists, (b) has a suitable MIME-type, (c) does not exceed IE<9 size limit of 32kb. This is a LESS predicate function; it returns a LESS boolean value and can thus be used as a mixin guard.
.background-image(@url) when(embeddable(@url)) { background-image: url(@url) !ie; }
Definition at line 38 of file ResourceLoaderLESSFunctions.php.
References $file, CSSMin\EMBED_SIZE_LIMIT, and CSSMin\getMimeType().