posit-dev / publisher

MIT License
3 stars 0 forks source link

Support link underlines accessibility setting #1935

Open dotNomad opened 3 days ago

dotNomad commented 3 days ago

VSCode 1.91.0 added a new setting accessibility.underlineLinks which does what it says on the tin

To make links easier to distinguish from regular text in the workbench, you can enable the setting accessibility.underlineLinks to underline links.

https://code.visualstudio.com/updates/v1_91#_link-underlines

This PR ensures all of our text links (<a>) support the feature and toggle appropriately.

Preview https://github.com/posit-dev/publisher/assets/19917631/eb4d859f-7771-4c7f-a4ff-1cd501048800

Intent

Resolves #1934

Type of Change

Approach

The injected CSS does the below

.monaco-workbench p>a {
    text-decoration: var(--text-link-decoration);
}

The --text-link-decoration variable changes based on the setting.

To support this, anywhere do an text anchor link we could use that CSS variable, or if it is text we can wrap the anchor in a p element. I did the latter here.