{% include "@bolt-components-code-snippet/code-snippet.twig" with {
display: "block",
lang: "html",
content: "Some code snippet"
} only %}
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
display
|
Defines if the code text is inline or block. |
string
|
block
|
|
lang
|
Language of the code text. |
string
|
html
|
|
syntax
|
Toggle between a light and dark syntax highlighting, or turn it off. Separate from Bolt theming. |
string
|
light
|
|
npm install @bolt/components-code-snippet
Code snippet can be a block of code, and
display
block
display: block;
margin: 0 0 1.65rem 0;
Well, code snippet can also be inline like this
display:inline;
display
inline
<header>
<h1>Headline</h1>
</header>
<header><h1>Headline</h1></header>
.my-css {
display: block;
}
.my-scss {
@include my-mixin;
}
<header>
<h1>Headline</h1>
</header>
import { props } from '@bolt/core-v3.x/utils';
{% include "@bolt-components-code-snippet/code-snippet.twig" with {
display: "block",
lang: "html",
content: "Some code snippet"
} only %}
<header>
<h1>Headline</h1>
</header>
<header>
<h1>Headline</h1>
</header>
<header>
<h1>Headline</h1>
</header>