暂时分享个显示代码语言的css,以提交给作者,以后会成为该插件的扩展功能。受限于当前代码块的标签布局,在超长代码块中,右上角的语言代码会跟随滚动条滑动,无法避免。
/* 代码语言 */
code[class*=language-],code.hljs{position:relative}code[class*=language-]:before,code.hljs::before{position:absolute;z-index:3;right:1em;font-size:.75rem;color:hsla(0,0%,100%,.4)}code[class~=language-js]:before,code.hljs.js:before{content:"js"}code[class~=language-ts]:before,code.hljs.ts:before{content:"ts"}code[class~=language-html]:before,code.hljs.html:before{content:"html"}code[class~=language-md]:before,code.hljs.md:before{content:"md"}code[class~=language-vue]:before,code.hljs.vue:before{content:"vue"}code[class~=language-css]:before,code.hljs.css:before{content:"css"}code[class~=language-sass]:before,code.hljs.sass:before{content:"sass"}code[class~=language-scss]:before,code.hljs.scss:before{content:"scss"}code[class~=language-less]:before,code.hljs.less:before{content:"less"}code[class~=language-stylus]:before,code.hljs.stylus:before{content:"stylus"}code[class~=language-go]:before,code.hljs.go:before{content:"go"}code[class~=language-java]:before,code.hljs.java:before{content:"java"}code[class~=language-c]:before,code.hljs.c:before{content:"c"}code[class~=language-sh]:before,code.hljs.sh:before{content:"sh"}code[class~=language-bash]:before,code.hljs.bash:before{content:"sh"}code[class~=language-yaml]:before,code.hljs.yaml:before{content:"yaml"}code[class~=language-py]:before,code.hljs.py:before{content:"py"}code[class~=language-docker]:before,code.hljs.docker:before{content:"docker"}code[class~=language-dockerfile]:before,code.hljs.dockerfile:before{content:"dockerfile"}code[class~=language-makefile]:before,code.hljs.makefile:before{content:"makefile"}code[class~=language-javascript]:before,code.hljs.javascript:before{content:"js"}code[class~=language-typescript]:before,code.hljs.typescript:before{content:"ts"}code[class~=language-markup]:before,code.hljs.markup:before{content:"html"}code[class~=language-markdown]:before,code.hljs.markdown:before{content:"md"}code[class~=language-json]:before,code.hljs.json:before{content:"json"}code[class~=language-ruby]:before,code.hljs.ruby:before{content:"rb"}code[class~=language-python]:before,code.hljs.python:before{content:"py"}code[class~=language-php]:before,code.hljs.php:before{content:"php"}code[class~=language-xml]:before,code.hljs.xml:before{content:"xml"}code[class~=language-nginx]:before,code.hljs.nginx:before{content:"conf"}code[class~=language-bbcode]:before,code.hljs.bbcode:before{content:"bbcode"}