mirror of
https://github.com/arsenetar/PrismHighlight.git
synced 2024-11-24 04:39:01 +00:00
16 lines
760 B
JavaScript
16 lines
760 B
JavaScript
|
Prism.languages.css.selector = {
|
||
|
pattern: /[^\{\}\s][^\{\}]*(?=\s*\{)/g,
|
||
|
inside: {
|
||
|
'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/g,
|
||
|
'pseudo-class': /:[-\w]+(?:\(.*\))?/g,
|
||
|
'class': /\.[-:\.\w]+/g,
|
||
|
'id': /#[-:\.\w]+/g
|
||
|
}
|
||
|
};
|
||
|
|
||
|
Prism.languages.insertBefore('css', 'ignore', {
|
||
|
'hexcode': /#[\da-f]{3,6}/gi,
|
||
|
'entity': /\\[\da-f]{1,8}/gi,
|
||
|
'number': /[\d%\.]+/g,
|
||
|
'function': /(attr|calc|cross-fade|cycle|element|hsl|hsla|image|lang|linear-gradient|matrix|matrix3d|perspective|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|rgb|rgba|rotate|rotatex|rotatey|rotatez|rotate3d|scale|scalex|scaley|scalez|scale3d|skew|skewx|skewy|steps|translate|translatex|translatey|translatez|translate3d|url|var)/ig
|
||
|
});
|