Skip to content

Commit

Permalink
Merge pull request #109 from commerce-docs/code-include
Browse files Browse the repository at this point in the history
Add CodeInclude component
  • Loading branch information
keharper authored Nov 12, 2024
2 parents 270c781 + 24bd13f commit fae7872
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/components/CodeInclude.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
import { Code } from '@astrojs/starlight/components';
export interface Props {
code: string;
lang?: string;
meta?: string;
locale?: string;
title?: string;
frame?: 'none';
mark?: string;
ins?: string;
del?: string;
collapse?: string;
collapsePreserveIndent?: true;
showLineNumbers?: false;
startLineNumber?: 1;
wrap?: false;
preserveIndent?: true;
}
const props = Astro.props;
---

<div id="code-block" class="code-block">
<Code {...props} />
</div>

<style>
.code-block {
margin: 0;
border-radius: 3px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
</style>

0 comments on commit fae7872

Please sign in to comment.