Skip to content

Commit b8db01a

Browse files
committed
Explain the function behavior further
1 parent 534a8b5 commit b8db01a

File tree

1 file changed

+5
-1
lines changed
  • packages/block-editor/src/utils/transform-styles

1 file changed

+5
-1
lines changed

packages/block-editor/src/utils/transform-styles/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ const ROOT_SELECTOR_TOKENS = [
2626
* instead, but this results in inconsistent specificity.
2727
*
2828
* This function instead inserts the prefix after the root tags but before
29-
* any other part of the selector.
29+
* any other part of the selector. This results in consistent specificity:
30+
* - If a `:where()` selector is used for the prefix, all selectors output
31+
* by `transformStyles` will have no specificity increase.
32+
* - If a classname, id, or something else is used as the prefix, all selectors
33+
* will have the same specificity bump when transformed.
3034
*
3135
* @param {string} prefix The prefix.
3236
* @param {string} selector The selector.

0 commit comments

Comments
 (0)