Skip to content

Commit

Permalink
[theme] css rule tag function
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Mar 23, 2017
1 parent 8c95810 commit f4d020f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/vs/platform/theme/common/themeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,22 @@ platform.Registry.add(Extensions.ThemingContribution, themingRegistry);

export function registerThemingParticipant(participant: IThemingParticipant): IDisposable {
return themingRegistry.onThemeChange(participant);
}

/**
* Tag function for strings containing css rules
*/
export function cssRule(literals, ...placeholders) {
let result = '';
for (let i = 0; i < placeholders.length; i++) {
result += literals[i];
let placeholder = placeholders[i];
if (placeholder === null) {
result += 'transparent';
} else {
result += placeholder.toString();
}
}
result += literals[literals.length - 1];
return result;
}

0 comments on commit f4d020f

Please sign in to comment.