From 39c4d0c6d41e938540f898eb3a25da4cc988c5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 1 Apr 2024 23:34:29 +0200 Subject: [PATCH] Override Foundation's pow() function Foundation added compatibility with Dart Sass by implementing a `divide` function and using it instead of `/` to perform divisions [1]. However, this made CSS compilation much slower, with the cause being the usage of the `divide` function inside Foundation's recursive `nth-root` and `pow` functions. Since the `nth-root` function is only called by the `pow` function, overriding the `pow` function so it uses the `math.pow` function provided by Dart Sass solves the issue. [1] Pull request 12241 in https://github.com/foundation/foundation-sites --- app/assets/stylesheets/functions/pow.scss | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 app/assets/stylesheets/functions/pow.scss diff --git a/app/assets/stylesheets/functions/pow.scss b/app/assets/stylesheets/functions/pow.scss new file mode 100644 index 000000000..68f297677 --- /dev/null +++ b/app/assets/stylesheets/functions/pow.scss @@ -0,0 +1,5 @@ +@use "sass:math"; + +@function pow($base, $exponent, $prec: 16) { + @return math.pow($base, $exponent); +}