()
| 1 | var computedCodeStyle; |
| 2 | |
| 3 | function getComputedCodeStyle() { |
| 4 | if (!computedCodeStyle) { |
| 5 | const div = document.createElement("code"); |
| 6 | |
| 7 | div.style.display = "none"; |
| 8 | div.className = "language-xxx"; |
| 9 | |
| 10 | document.body.appendChild(div); |
| 11 | |
| 12 | computedCodeStyle = window.getComputedStyle(div); |
| 13 | } |
| 14 | |
| 15 | return computedCodeStyle; |
| 16 | } |
| 17 | |
| 18 | module.exports = getComputedCodeStyle; |