logo
Expand description

provides function and macro for html units such as px, %, em, etc.

Functions

Relative to the width of the “0” (zero)

centimeters

Represent an angle in degrees https://developer.mozilla.org/en-US/docs/Web/CSS/angle

Relative to the font-size of the element (2em means 2 times the size of the current font)

Relative to the x-height of the current font (rarely used)

Represents an angle in gradians https://developer.mozilla.org/en-US/docs/Web/CSS/angle

inches (1in = 96px = 2.54cm) Example:

milimeters

Represents a time in milliseconds. https://developer.mozilla.org/en-US/docs/Web/CSS/time

picas (1pc = 12 pt)

percentage Example:

points (1pt = 1/72 of 1in)

pixels (1px = 1/96th of 1in)

1q is equivalent to 1/40th of 1cm.

Represent an angle in radians https://developer.mozilla.org/en-US/docs/Web/CSS/angle

Relative to font-size of the root element

Represents a time in seconds. https://developer.mozilla.org/en-US/docs/Web/CSS/time

Represents an angle in a number of turns. One full circle is 1turn. https://developer.mozilla.org/en-US/docs/Web/CSS/angle

Relative to 1% of the height of the viewport*

Relative to 1% of the width of the viewport*