File tree Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 4141 v-for =" (line , index ) in syntaxHighlightedLines "
4242 ><span
4343 :key =" index"
44- :class =" ['code-line-container',{ highlighted: isHighlighted(index) }]"
44+ :class =" ['code-line-container',{ highlighted: isHighlighted(index),
45+ 'user-highlighted': isUserHighlighted(index) }]"
4546 ><span
4647 v-if =" showLineNumbers"
4748 class =" code-number"
@@ -163,10 +164,10 @@ export default {
163164 },
164165 methods: {
165166 isHighlighted (index ) {
166- const lineNumber = this .lineNumberFor (index);
167- const h1 = this . highlightedLineNumbers . has (lineNumber);
168- const h2 = this . highlightSet . has (lineNumber);
169- return (h1 || h2 );
167+ return this .highlightedLineNumbers . has ( this . lineNumberFor (index) );
168+ },
169+ isUserHighlighted ( index ) {
170+ return this . highlightSet . has ( this . lineNumberFor (index) );
170171 },
171172 // Returns the line number for the line at the given index in `content`.
172173 lineNumberFor (index ) {
@@ -237,6 +238,15 @@ export default {
237238 }
238239}
239240
241+ .user-highlighted {
242+ background : var (--user-line-highlight , var (--color-user-code-line-highlight ));
243+ border-left : $highlighted-border-width solid var (--color-user-code-line-highlight-border );
244+
245+ .code-number {
246+ padding-left : $code-number-padding-left - $highlighted-border-width ;
247+ }
248+ }
249+
240250pre {
241251 padding : $code-listing-with-numbers-padding ;
242252 display : flex ;
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export default {
8484 ' --text' : codeColors .text ,
8585 ' --background' : codeColors .background ,
8686 ' --line-highlight' : codeColors .lineHighlight ,
87+ ' --user-line-highlight' : codeColors .userLineHighlight ,
8788 ' --url' : codeColors .commentURL ,
8889 ' --syntax-comment' : codeColors .comment ,
8990 ' --syntax-quote' : codeColors .comment ,
Original file line number Diff line number Diff line change 3737 --color-badge-default : var (--color-badge-dark-default );
3838 --color-button-background-active : #{dark-color (fill-blue )} ;
3939 --color-code-line-highlight : #{change-color (dark-color (figure-blue ), $alpha : 0.08 )} ;
40+ --color-user-code-line-highlight : #{change-color (dark-color (figure-orange ), $alpha : 0.32 )} ;
4041 --color-dropdown-background : var (--color-dropdown-dark-background );
4142 --color-dropdown-border : var (--color-dropdown-dark-border );
4243 --color-dropdown-option-text : var (--color-dropdown-dark-option-text );
Original file line number Diff line number Diff line change 7777 --color-code-collapsible-text : var (--color-figure-gray-secondary-alt );
7878 --color-code-line-highlight : #{change-color (light-color (figure-blue ), $alpha : 0.08 )} ;
7979 --color-code-line-highlight-border : var (--color-figure-blue );
80+ --color-user-code-line-highlight : #{change-color (light-color (figure-orange ), $alpha : 0.32 )} ;
81+ --color-user-code-line-highlight-border : var (--color-figure-orange );
8082 --color-code-plain : var (--color-figure-gray );
8183 --color-dropdown-background : #{transparentize (light-color (fill ), 0.2 )} ;
8284 --color-dropdown-border : #{light-color (fill-gray )} ;
You can’t perform that action at this time.
0 commit comments