mini.css-code-component

1.0.1 • Public • Published

mini.css Code Component

A mini.css module for better code presentation.

Example

Installation

npm install mini.css-code-component

yarn add mini.css-code-component

Usage

  1. Create a <pre> element.
  2. Wrap every line of code into a <span class="code-line">.
  3. Apply highlights by wrapping text in <span class="highlight-a">, <span class="highlight-b"> or <span class="highlight-c">.

Example

<pre>
<span class="code-line"><span class="highlight-a">if</span> condition:</span>
<span class="code-line">  value = <span class="highlight-c">'Result:'</span> . <span class="highlight-b">10</span></span>
<span class="code-line">  <span class="highlight-a">print</span>(value)</span>
<span class="code-line"><span class="highlight-a">return</span></span>
</pre>

Customization

You can customize the color palette and other parameters, by modifying and recompiling the Sass file.

License

This mini.css module is licensed under the MIT License.

Package Sidebar

Install

npm i mini.css-code-component

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • chalarangelo