File: D:/HostingSpaces/SBogers10/zuiderbos.komma.pro/wwwroot/css/functions/_grid.sass
/* ==========================================================================
Functions used in grid calculation
========================================================================== */
/**
* This is where the magic happens
* Return percentage based on amount of columns
* Use parent column size to adjust the origin
*/
@function calculateColumnSize($columnCount : 1, $origin : $gridColumns)
// Calculate the width for a single column on a full grid
$singleColumnSize : 100 / $gridColumns
// Get the origin size in percentage from the full grid
$originPercentage : $origin / $gridColumns * 100
// Calculate single column from new origin
$newSingleColumnSize : $singleColumnSize / $originPercentage * 100
// Return amount of columns as percentage
@return ($newSingleColumnSize * $columnCount)
/**
* Default function for columns
* Return as percentage
*/
@function column($columnCount : 1, $origin : $gridColumns)
@return calculateColumnSize($columnCount,$origin) * 1%
/**
* Return as viewport width
*/
@function columnVw($columnCount : 1, $origin : $gridColumns)
@return calculateColumnSize($columnCount,$origin) * 1vw