Created
April 26, 2025 06:15
-
-
Save korrio/569b8f27f3bb714f9526b8a8ddcfc1a1 to your computer and use it in GitHub Desktop.
kanit.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// นำเข้า Google Font Kanit | |
let fontLink = document.createElement('link'); | |
fontLink.href = 'https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;700&display=swap'; | |
fontLink.rel = 'stylesheet'; | |
document.head.appendChild(fontLink); | |
// สร้าง style element ใหม่ | |
let styleElement = document.createElement('style'); | |
styleElement.textContent = ` | |
* { | |
font-family: 'Kanit', sans-serif !important; | |
} | |
`; | |
document.head.appendChild(styleElement); | |
console.log('เปลี่ยนฟอนต์เป็น Kanit เรียบร้อยแล้ว'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment