MediaWiki  REL1_22
ResourceLoaderLESSFunctions Class Reference

List of all members.

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.

Detailed Description

Definition at line 23 of file ResourceLoaderLESSFunctions.php.


Member Function Documentation

static ResourceLoaderLESSFunctions::embed ( frame,
less 
) [static]

Convert an image URI to a base64-encoded data URI.

Example:
   .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.

Example:
   .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().


The documentation for this class was generated from the following file: