提交 d59362a4 编写于 作者: M Matt Bierner

Add opacity decoration option

Adds a new opacity option for text decorations. This controls the opacity of the text (it does not effect the border or background added by the decoration since those already have alpha channels)

Fixes #43004
上级 2aa30865
......@@ -194,6 +194,7 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider {
const _CSS_MAP = {
color: 'color:{0} !important;',
opacity: 'opacity:{0};',
backgroundColor: 'background-color:{0};',
outline: 'outline:{0};',
......@@ -357,7 +358,7 @@ class DecorationCSSRules {
return '';
}
let cssTextArr: string[] = [];
this.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'cursor', 'color', 'letterSpacing'], cssTextArr);
this.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'cursor', 'color', 'opacity', 'letterSpacing'], cssTextArr);
return cssTextArr.join('');
}
......@@ -385,7 +386,7 @@ class DecorationCSSRules {
cssTextArr.push(strings.format(_CSS_MAP.contentText, escaped));
}
this.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'color', 'backgroundColor', 'margin'], cssTextArr);
this.collectCSSText(opts, ['fontStyle', 'fontWeight', 'textDecoration', 'color', 'opacity', 'backgroundColor', 'margin'], cssTextArr);
if (this.collectCSSText(opts, ['width', 'height'], cssTextArr)) {
cssTextArr.push('display:inline-block;');
}
......
......@@ -509,6 +509,7 @@ export interface IThemeDecorationRenderOptions {
textDecoration?: string;
cursor?: string;
color?: string | ThemeColor;
opacity?: number;
letterSpacing?: string;
gutterIconPath?: string | UriComponents;
......
......@@ -893,6 +893,11 @@ declare module 'vscode' {
*/
color?: string | ThemeColor;
/**
* CSS styling property that will be applied to text enclosed by a decoration.
*/
opacity?: string;
/**
* CSS styling property that will be applied to text enclosed by a decoration.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册