From b8db01a5b66d87f07887d0f4e02b30def7cb5740 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Wed, 28 Aug 2024 11:04:30 +0800 Subject: [PATCH] Explain the function behavior further --- packages/block-editor/src/utils/transform-styles/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/utils/transform-styles/index.js b/packages/block-editor/src/utils/transform-styles/index.js index 2fb9ed71fabb5..936ebb016fa1b 100644 --- a/packages/block-editor/src/utils/transform-styles/index.js +++ b/packages/block-editor/src/utils/transform-styles/index.js @@ -26,7 +26,11 @@ const ROOT_SELECTOR_TOKENS = [ * instead, but this results in inconsistent specificity. * * This function instead inserts the prefix after the root tags but before - * any other part of the selector. + * any other part of the selector. This results in consistent specificity: + * - If a `:where()` selector is used for the prefix, all selectors output + * by `transformStyles` will have no specificity increase. + * - If a classname, id, or something else is used as the prefix, all selectors + * will have the same specificity bump when transformed. * * @param {string} prefix The prefix. * @param {string} selector The selector.