In html

Define the code

Put your code inside template tag with colorcode attribute:

<template colorcode = "html js css result" js="true" css="true" result="true">
    code..
</template>
            

Parameters of colorcode:

Then you set colorcode="parameters" it define which tab to show. if parameters not set, only code shows.

Active tabs

By default, only first tab is active. If you want to set active other tabs too, define it with separate attribute.

js="true" css="true" result="true" - if specified the folowing will be active (shows the code)

In javaScript

  1. Bind script at end of document - <script src="colorcode.js"></script>
  2. dom - may be dom id, template it self or empty (document)

  3. Run colorCode - <script>new colorCode(dom = document,colorsObj) </script>
You can customize style of colorcodes elements by - [colorcode] {..}

Customize colors

Second parameter in colorCode is colorsObj that allows to customize colors of code.
By default the colors are:
    {
        inner:'white',
        tag:'#FD2671',
        prop:'#A2D529',
        text:'#F2E679',
        comment:'#6F7463',
        fn:'#A2D529',
        let:'#69E6E3',
        false:'#B282F2',
        this:'#FF971F'
    }