HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/ridderstee.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