File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -22,28 +22,21 @@ class SparklyText extends HTMLElement {
22
22
z-index: 0;
23
23
}
24
24
25
- .sparkle-wrapper {
25
+ svg {
26
26
position: absolute;
27
27
z-index: -1;
28
28
width: var(--_sparkle-base-size);
29
29
height: var(--_sparkle-base-size);
30
30
transform-origin: center;
31
+ pointer-events: none;
31
32
}
32
33
33
34
@media (prefers-reduced-motion: no-preference) {
34
- .sparkle-wrapper {
35
+ svg {
35
36
animation: sparkle-spin var(--_sparkle-base-animation-length) linear 1;
36
37
}
37
38
}
38
39
39
- svg {
40
- width: var(--_sparkle-base-size) !important;
41
- height: var(--_sparkle-base-size) !important;
42
- display: block;
43
- position: absolute;
44
- pointer-events: none;
45
- }
46
-
47
40
svg path {
48
41
fill: var(--_sparkle-base-color);
49
42
}
@@ -109,9 +102,9 @@ class SparklyText extends HTMLElement {
109
102
110
103
addSparkle ( ) {
111
104
if ( ! sparkleTemplate ) {
112
- sparkleTemplate = document . createElement ( "span" ) ;
113
- sparkleTemplate . classList . add ( "sparkle-wrapper" ) ;
114
- sparkleTemplate . innerHTML = this . #sparkleSvg ;
105
+ const span = document . createElement ( "span" ) ;
106
+ span . innerHTML = this . #sparkleSvg ;
107
+ sparkleTemplate = span . firstElementChild ;
115
108
}
116
109
117
110
const sparkleWrapper = sparkleTemplate . cloneNode ( true ) ;
You can’t perform that action at this time.
0 commit comments