Properly align hyperlink underline layers regardless of their text in Sketch
Version 1.1:
- [add] Support vertical align
If you underline links in your design templates, then it maybe hard to align underlines when text links changes. The plugin aligns underlines with the width of their corresponding text link.
This plugin has been tested on Sketch v3.3.2
- Download ZIP of this repo.
- Extract and rename folder to suit your taste.
- Put the folder in your Sketch plugin folder (Use
Plugins>Reveal Plugins Folder
to find it).
Folder name and plugin filename will show up as items in Sketch Plugins
menu.
- Your links should be groups of text and line layers. Line layer should be named "underline:0". By default underline aligned by bottom border of text layer and this border is depends on line height of text layer. Aditionally you can adjust vertical space between text and underline by changing the value after colon underline:0.
- Keyboard shortcut:
Alt + Cmd + L
or usePlugins
menu. - Demo of usage https://vimeo.com/144957919
-
Open Sketch's plugins folder. You can do it by choosing custom script from the Plugins menu, then click the gear icon and choose "Open Plugins Folder".
-
Open the file "Align underlines.sketchplugin" in text editor.
-
The shortcut is on the first line:
// Align underlines (alt cmd l)
Change it.