Typography » Factory Calculate Relative SizeLink
Since: 2.0.0 New IssueCalculates a size, relative to a base size. By default, we use $font-size-base
to
assist with calculating the ratio for ems. However, you can pass your own base for
using with your own unit standard. You can also choose not to scale by passing
'true' to 'scaled'. You might choose to do this if your minimums and maximums
are already scaled units, such as with line-height, or if you specify your min
and max font-sizes in ems.
@param {int} $step - The step within your scale you want to calculate.
@param {int} $rate - The rate of growth at which your scale changes. Leave at 1 for even
(linear) growth. Anything higher will create exponential growth.
@param {int} $scale - A scaling number determined by your maximum value, if you have one.
You may wish to use the calc-scale
function to find this number. Leave at 1 if you do
not need an upper limit.
@param {int} $min - The minimum amount you need returned.
@param {bool} $scaled - Whether or not to return a scaled value, using $base
as the base
unit. By default, this will scale to ems, returning a value based on $font-size-base
equalling
1 em.
@param {int} $base - A value to divide by in order to return a scaled value. The units on this
value need to match $min
- that is, if $min
is in pixels, this needs to be in pixels as well.
@return {int} - A unitless size.
-
@requires pow
an exponential function in the mathsass library @see calc-scale
_typography-tools.scss, line 255
View Source