mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
fix(code): fix line number styling for better visibility
This commit is contained in:
@@ -135,11 +135,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
// line numbers (lineNumbersInTable=true)
|
||||
.lnt {
|
||||
display: block;
|
||||
width: calc(#{fi-var(line-digit)} * 1ch);
|
||||
min-width: 0.75rem;
|
||||
text-align: right;
|
||||
}
|
||||
// line numbers (lineNumbersInTable=false)
|
||||
.ln {
|
||||
padding-right: 0.75rem;
|
||||
display: inline-block;
|
||||
width: calc(#{fi-var(line-digit)} * 1ch);
|
||||
min-width: 0.75rem;
|
||||
text-align: right;
|
||||
padding-right: 0.75rem;
|
||||
position: sticky;
|
||||
left: 0;
|
||||
}
|
||||
@@ -474,7 +483,8 @@
|
||||
content: counter(codeNos);
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
min-width: calc(#{fi-var(line-digit)} * 1ch);
|
||||
width: calc(#{fi-var(line-digit)} * 1ch);
|
||||
min-width: 0.75rem;
|
||||
padding-inline: 0.75rem;
|
||||
flex-shrink: 0;
|
||||
color: fi-var(global-font-secondary-color);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{{- $lines := cond .Inner (len (split .Inner "\n")) 0 -}}
|
||||
{{- $maxShownLines := $config.maxshownlines -}}
|
||||
{{- $lineNoStart := cond (ne .Options.linenostart nil) .Options.linenostart 1 -}}
|
||||
{{- $lineNosDigit := strings.RuneCount (add $lines $lineNoStart) -}}
|
||||
{{- $lineNosDigit := strings.RuneCount (sub (add $lines $lineNoStart) 1) -}}
|
||||
{{- $class := "highlight" -}}
|
||||
{{- with $config.class -}}{{ $class = add $class " " . }}{{- end -}}
|
||||
{{- $targetClass := add "code-block " $class -}}
|
||||
|
||||
Reference in New Issue
Block a user