@@ -24,8 +24,13 @@ GITHUB_CORNERS_TEMPLATE.innerHTML = `
24
24
:host a:hover .octo-arm { animation: none; }
25
25
:host .octo-arm { animation: octocat-wave 560ms ease-in-out; }
26
26
}
27
+ :host svg {
28
+ position: fixed;
29
+ border: 0px;
30
+ top: 0px;
31
+ }
27
32
</style>
28
- <svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true" style="position: absolute; border: 0px; top: 0px;" >
33
+ <svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true">
29
34
<a xlink:href="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/uiwjs/react-github-corners" target="_blank" rel="nofollow sponsored" style="fill: rgb(21, 21, 19); color: rgb(255, 255, 255);">
30
35
<g>
31
36
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
@@ -39,8 +44,8 @@ GITHUB_CORNERS_TEMPLATE.innerHTML = `
39
44
export class GithubCorners extends HTMLElement {
40
45
/** Sets the z-order of a positioned element and its descendants or flex items. */
41
46
'z-index' ?: string ;
42
- height ?: string ;
43
- width ?: string ;
47
+ height ?: string | number ;
48
+ width ?: string | number ;
44
49
href ?: string ;
45
50
color ?: string ;
46
51
fill ?: string ;
@@ -53,7 +58,7 @@ export class GithubCorners extends HTMLElement {
53
58
transform ?: string ;
54
59
private shadow : ShadowRoot
55
60
static get observedAttributes ( ) : string [ ] {
56
- return [ 'z-index' , 'target' , 'height' , 'width' , 'href' , 'color' , 'fill' , 'position' , 'top' , 'left' , 'right' , 'bottom' , 'transform' ] ;
61
+ return [ 'style' , ' z-index', 'target' , 'height' , 'width' , 'href' , 'color' , 'fill' , 'position' , 'top' , 'left' , 'right' , 'bottom' , 'transform' ] ;
57
62
}
58
63
constructor ( ) {
59
64
super ( ) ;
@@ -67,7 +72,7 @@ export class GithubCorners extends HTMLElement {
67
72
svg . lastElementChild . setAttribute ( 'xlink:href' , value ) ;
68
73
} else if ( / ( c o l o r | f i l l ) / . test ( name . toLocaleLowerCase ( ) ) ) {
69
74
( svg . firstElementChild as HTMLAnchorElement ) . style [ name as any ] = value ;
70
- } else if ( / ( z - i n d e x | h e i g h t | w i d t h | p o s i t i o n | t o p | l e f t | r i g h t | b o t t o m | t r a n s f o r m ) / . test ( name . toLocaleLowerCase ( ) ) ) {
75
+ } else if ( / ( z - i n d e x | p o s i t i o n | t o p | l e f t | r i g h t | b o t t o m | t r a n s f o r m ) / . test ( name . toLocaleLowerCase ( ) ) ) {
71
76
svg . style [ name as any ] = value ;
72
77
} else {
73
78
svg . setAttribute ( name , value ) ;
0 commit comments