custom style JSON format
{
"backgroundColor": "#7b68ee", //optional, value in valid color name, hex, rgb, rgba
"color": "white", //optional, value in valid color name, hex, rgb, rgba
"highlightBgColor": "white", //optional, value in valid color name, hex, rgb, rgba
"highlightColor": "black", //optional, value in valid color name, hex, rgb, rgba
"border": "5px solid blue", //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
"borderTop": "5px solid blue", //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
"borderRight": "4px dashed #aaa", //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
"borderBottom": "5px solid blue", //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
"borderLeft": "4px dashed #aaa", //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
"lineNumbersBorder": "5px solid #fff", //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
"fontSize": "24px" //optional, value in valid font size unit like: 20px
}
Using the following classes:
.dyCodeHighlighter
.line-numbers
Using the following attributes:
data-dyCodeHighlighter-highlight="11,20,22"
data-dyCodeHighlighter-custom-style='{"backgroundColor": "#7b68ee", "color": "white", "highlightBgColor": "white", "highlightColor": "black", "border": "5px solid #f4a460", "fontSize": "24px", "lineNumbersBorder": "2px solid #fff"}'
/**
* This is a sample program to print the following pattern.
*
* H
* Ha
* Hap
* Happ
* Happy
*/
var
str = "Happy",
len = str.length,
r,
c,
pattern;
for (r = 0; r < len; r++) {
pattern = '';
for (c = 0; c <= r; c++) {
pattern += str[c];
}
console.log(pattern);
}
Using the following classes:
.dyCodeHighlighter
.line-numbers
Using the following attributes:
data-dyCodeHighlighter-highlight="11,20,22"
data-dyCodeHighlighter-custom-style='{"backgroundColor": "#666", "color": "white", "highlightBgColor": "white", "highlightColor": "black", "borderLeft": "5px solid #f4a460", "fontSize": "24px", "lineNumbersBorder": "none"}'
/**
* This is a sample program to print the following pattern.
*
* H
* Ha
* Hap
* Happ
* Happy
*/
var
str = "Happy",
len = str.length,
r,
c,
pattern;
for (r = 0; r < len; r++) {
pattern = '';
for (c = 0; c <= r; c++) {
pattern += str[c];
}
console.log(pattern);
}