Skip to content

Commit

Permalink
Fix link styling for text components (microsoft#10449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Gagnon authored May 15, 2020
1 parent e0bdfc8 commit 0f10f44
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/sql/workbench/browser/modelComponents/text.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import * as azdata from 'azdata';
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
import { TitledComponent } from 'sql/workbench/browser/modelComponents/titledComponent';
import { IComponentDescriptor, IComponent, IModelStore } from 'sql/platform/dashboard/browser/interfaces';
import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
import { textLinkForeground, textLinkActiveForeground } from 'vs/platform/theme/common/colorRegistry';

@Component({
selector: 'modelview-text',
Expand Down Expand Up @@ -99,3 +101,24 @@ export default class TextComponent extends TitledComponent implements IComponent
return this.requiredIndicator || !!this.description;
}
}

registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
const linkForeground = theme.getColor(textLinkForeground);
if (linkForeground) {
collector.addRule(`
a.modelview-text-link:link,
a.modelview-text-link:visited {
color: ${linkForeground};
}
`);
}

const activeForeground = theme.getColor(textLinkActiveForeground);
if (activeForeground) {
collector.addRule(`
a.modelview-text-link:hover {
color: ${activeForeground};
}
`);
}
});

0 comments on commit 0f10f44

Please sign in to comment.