Working with text styles to customize links

Something that comes up from time to time is how text styles can help in Sparkle.

This is specifically about text links. Suppose you have a text block like this:

Make one word a link, and change the link to blue, and remove the underline:

Now if you want to make this new style the default for text links, with the text link selected, you see the style says "body - link” style, and the (*) means it is changed compared to the default style for a body - link. So I can either revert it or apply it. If I click apply changes, the style becomes the new default for body links.

Now when I create a new link it will be in that style:

Now if I decide I want to change the default link style to red, I pick red and click apply changes, and now all links are red:

Text styles are very helpful in accelerating styling of a site, and are invaluable when adapting a page for multiple devices. Hope this helps!

7 Likes

I’ve finally started using text styles. Best to use them right from the start. Don’t forget the advanced ‍text ‍options; it’s easy to make an additional Link style (click ‍on ‍the ‍cogwheel ‍icon) ‍to reveal them.

I’m probably not understanding how to use this properly, but what if I want links to always be in the style of the text they are “replacing”? So, I have a paragraph of text that I have already stylized, and I go in and make some of the words or phrases links–I want them to maintain the font and size of the text that is already there. Instead, they get changed to some predetermined style and I have to change each one back. How can I fix this?

I know this is an old post, so please forgive me if new features make this irrelevant; I’m just having problems with link styles.

This problem often comes up when you use the body style for differently styled text blocks. Links have a style that’s tied to the underlying text style, a “sub style” if you will. As long as you use distinct text styles for different text blocks, the link sub style will be coherent with that.

You assume Sparkle is picking an arbitrary font for the link sub style, it’s actually using the one you previously used.

Separate text styles and you will be able to have separate link styles.