Professional Documents
Culture Documents
css:
css:
css:
css:
css:
css:
css:
css:
css:
this.regexList = [
{ regex: dp.sh.RegexLib.MultiLineCComments,
'comment' },
// multiline comments
{ regex: dp.sh.RegexLib.DoubleQuotedString,
'string' },
// double quoted strings
{ regex: dp.sh.RegexLib.SingleQuotedString,
'string' },
// single quoted strings
{ regex: new RegExp('\\#[a-zA-Z0-9]{3,6}', 'g'),
'value' },
// html colors
{ regex: new RegExp('(-?\\d+)(\.\\d+)?(px|em|pt|\:|\%|)', 'g'),
'value' },
// sizes
{ regex: new RegExp('!important', 'g'),
'important' },
// !important
{ regex: new RegExp(this.GetKeywordsCSS(keywords), 'gm'),
'keyword' },
// keywords
{ regex: new RegExp(this.GetValuesCSS(values), 'g'),
'value' },
// values
{ regex: new RegExp(this.GetValuesCSS(fonts), 'g'),
'value' }
// fonts
];
this.CssClass = 'dp-css';
this.Style =
};
dp.sh.Highlighter.prototype.GetKeywordsCSS = function(str)
{
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)'
) + '(?=:)\\b';
};
dp.sh.Highlighter.prototype.GetValuesCSS = function(str)
{
return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
};
dp.sh.Brushes.CSS.prototype
dp.sh.Brushes.CSS.Aliases
= new dp.sh.Highlighter();
= ['css'];