From 59ca8e63095d7c81e41e2e82647663a5a6e4afe8 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 23 Mar 2022 17:25:12 +0530 Subject: [PATCH] Add explanation of plugin --- scripts/postcss/css-compile-variables.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/postcss/css-compile-variables.js b/scripts/postcss/css-compile-variables.js index 23795145..a3c3aa30 100644 --- a/scripts/postcss/css-compile-variables.js +++ b/scripts/postcss/css-compile-variables.js @@ -16,6 +16,20 @@ limitations under the License. const valueParser = require("postcss-value-parser"); +/** + * This plugin derives new css variables from a given set of base variables. + * A derived css variable has the form --base--operation-argument; meaning that the derived + * variable has a value that is generated from the base variable "base" by applying "operation" + * with given "argument". + * + * eg: given the base variable --foo-color: #40E0D0, --foo-color--darker-20 is a css variable + * derived from foo-color by making it 20% more darker. + * + * All derived variables are added to the :root section. + * + * The actual derivation is done outside the plugin in a callback. + */ + let aliasMap; let resolvedMap; let baseVariables;