From 2a90254379a84c4cf601ef962ba6d2112b2c06ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Roche?= Date: Wed, 29 Nov 2023 16:22:57 +0100 Subject: [PATCH] sass function --- styles/_functions.scss | 7 +++++++ styles/_layout.scss | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/styles/_functions.scss b/styles/_functions.scss index 5455b7ce..e0a5af2a 100644 --- a/styles/_functions.scss +++ b/styles/_functions.scss @@ -50,3 +50,10 @@ $mobile-height: get('viewports.mobile.height'); @content; } } + +@function columns($columns) { + @return calc( + (#{$columns} * var(--layout-column-width)) + + ((#{$columns} - 1) * var(--layout-columns-gap)) + ); +} diff --git a/styles/_layout.scss b/styles/_layout.scss index e7fb7315..bb305793 100644 --- a/styles/_layout.scss +++ b/styles/_layout.scss @@ -83,10 +83,3 @@ $layout: ( grid-gap: var(--layout-columns-gap); width: 100%; } - -@function columns($columns) { - @return calc( - (#{$columns} * var(--layout-column-width)) + - ((#{$columns} - 1) * var(--layout-columns-gap)) - ); -}