Class: Stock

qui.icons.Stock(src, unit, size, width, height, names, variantsopt, nullable, variantAliasesopt)

An icon stock.

Constructor

new Stock(src, unit, size, width, height, names, variantsopt, nullable, variantAliasesopt)

Parameters:
Name Type Attributes Description
src String

image source (normally a URL)

unit String

unit of measurement for icon size (e.g. "em", "rem", "px")

size Number

icon size with respect to the unit (the icon is assumed to be a square)

width Number

the number of icons in a row present in the source

height Number

the number of icon rows present in the source

names Object.<String, Number>

a mapping associating each icon name to its horizontal offset

variants Object.<String, Number> <optional>
<nullable>

a mapping associating each icon variant to its vertical offset; the variants of the default stock (qui.icons.defaultstock are used if not supplied

variantAliases Object.<String, String> <optional>

an optional mapping of aliases to icon variants; the variant aliases of the default stock (qui.icons.defaultstock are used if not supplied

Source:

Methods

parseVariant(variant) → {Object}

Transform a variant into its corresponding filter and final variant.

Parameters:
Name Type Description
variant String
Source:
Returns:
Type
Object

prepare()

Make the stock ready to be used by ensuring all its properties are prepared.

Source: