0.0.5 • Published 4 years ago
@stefanlazarevic/components.code-block v0.0.5
CodeBlock
npm i @stefanlazarevic/components.code-block
yarn add @stefanlazarevic/component.code-block
Коришћење
import CodeBlock from "@stefanlazarevic/component.code-block";
<CodeBlock>{"const x = 10;"}</CodeBlock>;
API
назив | тип | подразумевана вредност | опис |
---|---|---|---|
content | string | undefined | 📘 |
className | string | undefined | 📘 |
language | string | undefined | 📘 |
showLines | boolean | undefined | 📘 |
style | object | undefined | 📘 |
testid | string | undefined | 📘 |
id | string | undefined | 📘 |
Стилизација
Пример стилова који се могу копирати у пројекат.
:root {
--hljs-background-color: #222634;
--hljs-color: #bdbdbf;
--hljs-keyword: #cca5f7;
--hljs-string: #88d61f;
--hljs-number: #efb28c;
--hljs-function: #82b1ff;
--hljs-attr: #efb28c;
--hljs-tag: #8bd9fd;
--hljs-name: #db7978;
--hljs-built_in: #db7978;
--hljs-comment: #9e9e9e;
}
Списак свих подржаних језика можете пронаћи на highlight.js/SUPPORTED_LANGUAGES