Skip to content

Commit 36691cd

Browse files
committed
inject style
1 parent cd8756d commit 36691cd

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

index.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
create: function(codefundId) {
44
return function(hook, vm) {
55
hook.ready(function() {
6-
window.DocsifyCodefund.injectCodeFundContainer();
6+
window.DocsifyCodefund.injectCodeFundStyle();
77
window.DocsifyCodefund.injectCodeFundScript(codefundId);
88
})
9+
10+
hook.doneEach(function () {
11+
window.DocsifyCodefund.injectCodeFundContainer();
12+
})
913
}
1014
},
1115

@@ -25,6 +29,20 @@
2529
script.src = "https://codefund.app/properties/" + codefundId + "/funder.js?template=docsify"
2630
script.async = "async"
2731
document.body.appendChild(script)
32+
},
33+
34+
injectCodeFundStyle() {
35+
var style = document.createElement('style');
36+
window.DocsifyCodefund.injectCodeFundContainer();
37+
var css = '#cf span.cf-wrapper { background-color: transparent!important } #cf a.cf-text { color: #444!important; font-weight: 400!important; font-size: 10px!important }';
38+
39+
style.type = 'text/css';
40+
if (style.styleSheet){
41+
style.styleSheet.cssText = css;
42+
} else {
43+
style.appendChild(document.createTextNode(css));
44+
}
45+
document.head.appendChild(style);
2846
}
2947
}
30-
})(window)
48+
})(window)

0 commit comments

Comments
 (0)