@@ -918,31 +918,36 @@ export function findMetadata(colorThemeData: ColorThemeData, captureNames: strin
918
918
const standardToken = toStandardTokenType ( captureNames [ captureNames . length - 1 ] ) ;
919
919
metadata |= ( standardToken << MetadataConsts . TOKEN_TYPE_OFFSET ) ;
920
920
921
- if ( themeRule ?. settings . fontStyle === 'italic' ) {
922
- metadata |= FontStyle . Italic | MetadataConsts . ITALIC_MASK ;
923
- } else if ( themeRule ?. settings . fontStyle !== 'bold' ) {
924
- metadata |= FontStyle . Bold | MetadataConsts . BOLD_MASK ;
925
- } else if ( typeof tokenStyle ?. underline !== 'undefined' ) {
926
- metadata |= FontStyle . Underline | MetadataConsts . UNDERLINE_MASK ;
927
- } else if ( typeof tokenStyle ?. strikethrough !== 'undefined' ) {
928
- metadata |= FontStyle . Strikethrough | MetadataConsts . STRIKETHROUGH_MASK ;
929
- } else {
930
- if ( typeof tokenStyle ?. italic !== 'undefined' ) {
931
- const italicbit = ( tokenStyle ?. italic ? FontStyle . Italic : 0 ) ;
932
- metadata |= italicbit | MetadataConsts . ITALIC_MASK ;
933
- }
934
- if ( typeof tokenStyle ?. bold !== 'undefined' ) {
935
- const boldBit = ( tokenStyle ?. bold ? FontStyle . Bold : 0 ) ;
936
- metadata |= boldBit | MetadataConsts . BOLD_MASK ;
937
- }
938
- if ( typeof tokenStyle ?. underline !== 'undefined' ) {
939
- const underlineBit = ( tokenStyle ?. underline ? FontStyle . Underline : 0 ) ;
940
- metadata |= underlineBit | MetadataConsts . UNDERLINE_MASK ;
941
- }
942
- if ( typeof tokenStyle ?. strikethrough !== 'undefined' ) {
943
- const strikethroughBit = ( tokenStyle ?. strikethrough ? FontStyle . Strikethrough : 0 ) ;
944
- metadata |= strikethroughBit | MetadataConsts . STRIKETHROUGH_MASK ;
945
- }
921
+ switch ( themeRule ?. settings . fontStyle ) {
922
+ case 'italic' :
923
+ metadata |= FontStyle . Italic | MetadataConsts . ITALIC_MASK ;
924
+ break ;
925
+ case 'bold' :
926
+ metadata |= FontStyle . Bold | MetadataConsts . BOLD_MASK ;
927
+ break ;
928
+ case 'underline' :
929
+ metadata |= FontStyle . Underline | MetadataConsts . UNDERLINE_MASK ;
930
+ break ;
931
+ case 'strikethrough' :
932
+ metadata |= FontStyle . Strikethrough | MetadataConsts . STRIKETHROUGH_MASK ;
933
+ break ;
934
+ default :
935
+ if ( typeof tokenStyle ?. italic !== 'undefined' ) {
936
+ const italicbit = ( tokenStyle ?. italic ? FontStyle . Italic : 0 ) ;
937
+ metadata |= italicbit | MetadataConsts . ITALIC_MASK ;
938
+ }
939
+ if ( typeof tokenStyle ?. bold !== 'undefined' ) {
940
+ const boldBit = ( tokenStyle ?. bold ? FontStyle . Bold : 0 ) ;
941
+ metadata |= boldBit | MetadataConsts . BOLD_MASK ;
942
+ }
943
+ if ( typeof tokenStyle ?. underline !== 'undefined' ) {
944
+ const underlineBit = ( tokenStyle ?. underline ? FontStyle . Underline : 0 ) ;
945
+ metadata |= underlineBit | MetadataConsts . UNDERLINE_MASK ;
946
+ }
947
+ if ( typeof tokenStyle ?. strikethrough !== 'undefined' ) {
948
+ const strikethroughBit = ( tokenStyle ?. strikethrough ? FontStyle . Strikethrough : 0 ) ;
949
+ metadata |= strikethroughBit | MetadataConsts . STRIKETHROUGH_MASK ;
950
+ }
946
951
}
947
952
const foreground = themeRule ? themeRule . settings . foreground : tokenStyle ?. foreground ;
948
953
if ( foreground ) {
0 commit comments