Last active
September 18, 2024 01:28
-
-
Save ryonakae/6564138a75401a7c3c9be3c73a3a2d02 to your computer and use it in GitHub Desktop.
FigmaのRun Plugin APIプラグインで使える便利なコードスニペット集
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
// 現在のページにあるハイパーリンクが設定されているすべてのテキストに下線を引く | |
function main() { | |
const textNodes: TextNode[] = figma.currentPage.findAll(node => { | |
return node.type === 'TEXT' && node.hyperlink !== null | |
}) | |
textNodes.forEach(async textNode => { | |
await Promise.all(textNode.getRangeAllFontNames(0, textNode.characters.length).map(figma.loadFontAsync)) | |
textNode.textDecoration = 'UNDERLINE' | |
}) | |
figma.currentPage.selection = textNodes | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment