File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ new MutationObserver((mutations, observer) => {
4
4
var cssScopePattern = new RegExp ( '(\\.me|\\.this|\\.self)(?![A-Za-z0-9\_\-])' , 'g' ) // Can use: .me .this .self
5
5
for ( var mutation of mutations ) {
6
6
if ( mutation . type !== "childList" ) continue
7
- var nodes = [ ...mutation . addedNodes ] // For subtree mutations (ex: htmx) we check all added nodes.
7
+ var nodes = [ ...mutation . addedNodes ] // Check new nodes.
8
8
for ( var node = nodes . shift ( ) ; node != null ; node = nodes . shift ( ) ) {
9
- nodes . push ( ...node . childNodes ) // Add all child nodes, too .
9
+ nodes . push ( ...node . childNodes ) // Check children of this new node (subtree) .
10
10
if ( node . nodeName !== 'STYLE' ) continue // Not a <style>
11
11
if ( ! node . parentNode || node . parentNode . nodeName === 'HEAD' ) continue // Must have parent. Don't style <head>
12
12
var scope = 'self_' + ( window . cssScopeCount ++ ) // Ready. Make unique scope, example: .self_1234
You can’t perform that action at this time.
0 commit comments