Skip to content

Commit 36123fc

Browse files
committed
shrink explanation
1 parent 84b6f8b commit 36123fc

File tree

1 file changed

+2
-24
lines changed
  • packages/svelte/src/compiler/phases/2-analyze/css

1 file changed

+2
-24
lines changed

packages/svelte/src/compiler/phases/2-analyze/css/Selector.js

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,30 +69,8 @@ export default class Selector {
6969
}
7070

7171
/**
72-
* Determines whether the given selector is used within the component's nodes
73-
* and marks the corresponding blocks for encapsulation if so.
74-
*
75-
* In CSS nesting, the selector might be used in one nested rule, but not in another
76-
* e.g:
77-
* ```css
78-
* a, b {
79-
* c {
80-
* color: red;
81-
* }
82-
* ```
83-
*
84-
* ```svelte
85-
* <a>
86-
* <c>...</c>
87-
* </a>
88-
* <b>
89-
* No 'c' here
90-
* </b>
91-
* ```
92-
*
93-
* In the above example, the selector `a c` is used, but `b c` is not.
94-
* We should mark it for encapsulation as a result.
95-
*
72+
* Determines whether the given selector potentially applies to `node` —
73+
* if so, marks both the selector and the node as encapsulated
9674
* @param {import('#compiler').RegularElement | import('#compiler').SvelteElement} node - The node to apply the selector to.
9775
* @returns {void}
9876
*/

0 commit comments

Comments
 (0)