Code Monkey home page Code Monkey logo

microlight's Introduction

microlight.js

Note: This is a fork to add css based selection, view the original at https://github.com/asvd/microlight

microlight.js is a micro-library (2.2k minified) which improves readability of code snippets by highlighting, for any programming language, yet without attaching additional language packages:

![preview] (https://raw.githubusercontent.com/lopeax/microlight/css-based/microlight.PNG)

For a demo refer to http://codepen.io/zephyr/pen/MewjYd

Installation

This library is installable by either npm or bower

-- NPM

npm i microlight-css-selection

-- Bower

bower install microlight-css-selection

CSS

The following are some recommended css rules to target the elements within microlight

.microlight {
    font-family: monospace;
    white-space: pre;
    background-color: #263238;
    color: #AABBC3;
    padding: 15px;
    text-align: left;
    overflow-x: auto;
    box-shadow: 0 2px 3px rgba(0,0,0,0.5);
    border-radius: 0.2em;
}

.microlight:not(:last-child) {
    margin-bottom: 15px;
}

// Colours inspired by https://atom.io/themes/atom-material-syntax
.microlight span[data_microlight_type="not-formatted"] {
    color: #B2CCD6;
}

.microlight span[data_microlight_type="keywords"] {
    color: #F1E655;
}

.microlight span[data_microlight_type="punctuation"] {
    color: #d9f5dd;
}

.microlight span[data_microlight_type="strings-regex"] {
    color: #C3E88D;
}

.microlight span[data_microlight_type="comments"] {
    color: #49656f;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.