未验证 提交 34aafba6 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #39701 from jacobdufault/add-font-weight-style

Allow decorators to change font-weight and font-style.
......@@ -210,6 +210,8 @@ const _CSS_MAP = {
borderStyle: 'border-style:{0};',
borderWidth: 'border-width:{0};',
fontStyle: 'font-style:{0};',
fontWeight: 'font-weight:{0};',
textDecoration: 'text-decoration:{0};',
cursor: 'cursor:{0};',
letterSpacing: 'letter-spacing:{0};',
......@@ -357,7 +359,7 @@ class DecorationCSSRules {
return '';
}
let cssTextArr: string[] = [];
this.collectCSSText(opts, ['textDecoration', 'cursor', 'color', 'letterSpacing'], cssTextArr);
this.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'cursor', 'color', 'letterSpacing'], cssTextArr);
return cssTextArr.join('');
}
......@@ -385,7 +387,7 @@ class DecorationCSSRules {
cssTextArr.push(strings.format(_CSS_MAP.contentText, escaped));
}
this.collectCSSText(opts, ['textDecoration', 'color', 'backgroundColor', 'margin'], cssTextArr);
this.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'color', 'backgroundColor', 'margin'], cssTextArr);
if (this.collectCSSText(opts, ['width', 'height'], cssTextArr)) {
cssTextArr.push('display:inline-block;');
}
......
......@@ -1560,6 +1560,8 @@ export interface IThemeDecorationRenderOptions {
borderStyle?: string;
borderWidth?: string;
fontStyle?: string;
fontWeight?: string;
textDecoration?: string;
cursor?: string;
color?: string | ThemeColor;
......@@ -1583,6 +1585,8 @@ export interface IContentDecorationRenderOptions {
border?: string;
borderColor?: string | ThemeColor;
fontStyle?: string;
fontWeight?: string;
textDecoration?: string;
color?: string | ThemeColor;
backgroundColor?: string | ThemeColor;
......
......@@ -836,6 +836,16 @@ declare module 'vscode' {
*/
borderWidth?: string;
/**
* CSS styling property that will be applied to text enclosed by a decoration.
*/
fontStyle?: string;
/**
* CSS styling property that will be applied to text enclosed by a decoration.
*/
fontWeight?: string;
/**
* CSS styling property that will be applied to text enclosed by a decoration.
*/
......@@ -902,6 +912,14 @@ declare module 'vscode' {
* CSS styling property that will be applied to text enclosed by a decoration.
*/
borderColor?: string | ThemeColor;
/**
* CSS styling property that will be applied to the decoration attachment.
*/
fontStyle?: string;
/**
* CSS styling property that will be applied to the decoration attachment.
*/
fontWeight?: string;
/**
* CSS styling property that will be applied to the decoration attachment.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册