Add landing pages library with comprehensive components and demos
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -31,11 +31,11 @@ export type CodeBlockVariant = 'default' | 'minimal' | 'bordered';
|
||||
@if (showLineNumbers && lineCount() > 1) {
|
||||
<div class="code-block__line-numbers" [attr.aria-hidden]="true">
|
||||
@for (lineNum of lineNumbers(); track lineNum) {
|
||||
<span
|
||||
<div
|
||||
class="code-block__line-number"
|
||||
[class.code-block__line-number--highlighted]="isLineHighlighted(lineNum)">
|
||||
{{ lineNum }}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@@ -95,7 +95,14 @@ export class CodeBlockComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
readonly lineCount = computed(() => {
|
||||
return this.code ? this.code.split('\n').length : 0;
|
||||
if (!this.code) return 0;
|
||||
|
||||
const lines = this.code.split('\n');
|
||||
// Remove the last empty line if the code ends with a newline
|
||||
if (lines.length > 1 && lines[lines.length - 1] === '') {
|
||||
return lines.length - 1;
|
||||
}
|
||||
return lines.length;
|
||||
});
|
||||
|
||||
readonly lineNumbers = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user