diff --git a/src/client/theme-default/builtins/SourceCode/index.less b/src/client/theme-default/builtins/SourceCode/index.less index 26020477d..b486bd4ee 100644 --- a/src/client/theme-default/builtins/SourceCode/index.less +++ b/src/client/theme-default/builtins/SourceCode/index.less @@ -158,6 +158,24 @@ visibility: hidden; } + &-language { + position: absolute; + top: 2px; + right: 8px; + z-index: 2; + font-size: 12px; + font-weight: 500; + user-select: none; + user-select: none; + color: @c-text-note; + transition: color 0.4s, opacity 0.4s; + } + + &:hover &-language { + opacity: 0; + visibility: hidden; + } + @{dark-selector} & { @bg-color: shade(@c-site-bg-dark, 50%); diff --git a/src/client/theme-default/builtins/SourceCode/index.tsx b/src/client/theme-default/builtins/SourceCode/index.tsx index 87e24814f..e6f61174d 100644 --- a/src/client/theme-default/builtins/SourceCode/index.tsx +++ b/src/client/theme-default/builtins/SourceCode/index.tsx @@ -91,6 +91,9 @@ const SourceCode: FC = (props) => { return (
+ {!lang ? null : ( + {lang} + )} {