Skip to content

Chalarangelo/mini.css-code-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A module for mini.css to better present code blocks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages