CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
scss.js940 linesDownload Raw Back to languages
1const MODES = (hljs) => {2  return {3    IMPORTANT: {4      scope: 'meta',5      begin: '!important'6    },7    BLOCK_COMMENT: hljs.C_BLOCK_COMMENT_MODE,8    HEXCOLOR: {9      scope: 'number',10      begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/11    },12    FUNCTION_DISPATCH: {13      className: "built_in",14      begin: /[\w-]+(?=\()/15    },16    ATTRIBUTE_SELECTOR_MODE: {17      scope: 'selector-attr',18      begin: /\[/,19      end: /\]/,20      illegal: '$',21      contains: [22        hljs.APOS_STRING_MODE,23        hljs.QUOTE_STRING_MODE24      ]25    },26    CSS_NUMBER_MODE: {27      scope: 'number',28      begin: hljs.NUMBER_RE + '(' +29        '%|em|ex|ch|rem' +30        '|vw|vh|vmin|vmax' +31        '|cm|mm|in|pt|pc|px' +32        '|deg|grad|rad|turn' +33        '|s|ms' +34        '|Hz|kHz' +35        '|dpi|dpcm|dppx' +36        ')?',37      relevance: 038    },39    CSS_VARIABLE: {40      className: "attr",41      begin: /--[A-Za-z_][A-Za-z0-9_-]*/42    }43  };44};45 46const HTML_TAGS = [47  'a',48  'abbr',49  'address',50  'article',51  'aside',52  'audio',53  'b',54  'blockquote',55  'body',56  'button',57  'canvas',58  'caption',59  'cite',60  'code',61  'dd',62  'del',63  'details',64  'dfn',65  'div',66  'dl',67  'dt',68  'em',69  'fieldset',70  'figcaption',71  'figure',72  'footer',73  'form',74  'h1',75  'h2',76  'h3',77  'h4',78  'h5',79  'h6',80  'header',81  'hgroup',82  'html',83  'i',84  'iframe',85  'img',86  'input',87  'ins',88  'kbd',89  'label',90  'legend',91  'li',92  'main',93  'mark',94  'menu',95  'nav',96  'object',97  'ol',98  'optgroup',99  'option',100  'p',101  'picture',102  'q',103  'quote',104  'samp',105  'section',106  'select',107  'source',108  'span',109  'strong',110  'summary',111  'sup',112  'table',113  'tbody',114  'td',115  'textarea',116  'tfoot',117  'th',118  'thead',119  'time',120  'tr',121  'ul',122  'var',123  'video'124];125 126const SVG_TAGS = [127  'defs',128  'g',129  'marker',130  'mask',131  'pattern',132  'svg',133  'switch',134  'symbol',135  'feBlend',136  'feColorMatrix',137  'feComponentTransfer',138  'feComposite',139  'feConvolveMatrix',140  'feDiffuseLighting',141  'feDisplacementMap',142  'feFlood',143  'feGaussianBlur',144  'feImage',145  'feMerge',146  'feMorphology',147  'feOffset',148  'feSpecularLighting',149  'feTile',150  'feTurbulence',151  'linearGradient',152  'radialGradient',153  'stop',154  'circle',155  'ellipse',156  'image',157  'line',158  'path',159  'polygon',160  'polyline',161  'rect',162  'text',163  'use',164  'textPath',165  'tspan',166  'foreignObject',167  'clipPath'168];169 170const TAGS = [171  ...HTML_TAGS,172  ...SVG_TAGS,173];174 175// Sorting, then reversing makes sure longer attributes/elements like176// `font-weight` are matched fully instead of getting false positives on say `font`177 178const MEDIA_FEATURES = [179  'any-hover',180  'any-pointer',181  'aspect-ratio',182  'color',183  'color-gamut',184  'color-index',185  'device-aspect-ratio',186  'device-height',187  'device-width',188  'display-mode',189  'forced-colors',190  'grid',191  'height',192  'hover',193  'inverted-colors',194  'monochrome',195  'orientation',196  'overflow-block',197  'overflow-inline',198  'pointer',199  'prefers-color-scheme',200  'prefers-contrast',201  'prefers-reduced-motion',202  'prefers-reduced-transparency',203  'resolution',204  'scan',205  'scripting',206  'update',207  'width',208  // TODO: find a better solution?209  'min-width',210  'max-width',211  'min-height',212  'max-height'213].sort().reverse();214 215// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes216const PSEUDO_CLASSES = [217  'active',218  'any-link',219  'blank',220  'checked',221  'current',222  'default',223  'defined',224  'dir', // dir()225  'disabled',226  'drop',227  'empty',228  'enabled',229  'first',230  'first-child',231  'first-of-type',232  'fullscreen',233  'future',234  'focus',235  'focus-visible',236  'focus-within',237  'has', // has()238  'host', // host or host()239  'host-context', // host-context()240  'hover',241  'indeterminate',242  'in-range',243  'invalid',244  'is', // is()245  'lang', // lang()246  'last-child',247  'last-of-type',248  'left',249  'link',250  'local-link',251  'not', // not()252  'nth-child', // nth-child()253  'nth-col', // nth-col()254  'nth-last-child', // nth-last-child()255  'nth-last-col', // nth-last-col()256  'nth-last-of-type', //nth-last-of-type()257  'nth-of-type', //nth-of-type()258  'only-child',259  'only-of-type',260  'optional',261  'out-of-range',262  'past',263  'placeholder-shown',264  'read-only',265  'read-write',266  'required',267  'right',268  'root',269  'scope',270  'target',271  'target-within',272  'user-invalid',273  'valid',274  'visited',275  'where' // where()276].sort().reverse();277 278// https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements279const PSEUDO_ELEMENTS = [280  'after',281  'backdrop',282  'before',283  'cue',284  'cue-region',285  'first-letter',286  'first-line',287  'grammar-error',288  'marker',289  'part',290  'placeholder',291  'selection',292  'slotted',293  'spelling-error'294].sort().reverse();295 296const ATTRIBUTES = [297  'accent-color',298  'align-content',299  'align-items',300  'align-self',301  'alignment-baseline',302  'all',303  'anchor-name',304  'animation',305  'animation-composition',306  'animation-delay',307  'animation-direction',308  'animation-duration',309  'animation-fill-mode',310  'animation-iteration-count',311  'animation-name',312  'animation-play-state',313  'animation-range',314  'animation-range-end',315  'animation-range-start',316  'animation-timeline',317  'animation-timing-function',318  'appearance',319  'aspect-ratio',320  'backdrop-filter',321  'backface-visibility',322  'background',323  'background-attachment',324  'background-blend-mode',325  'background-clip',326  'background-color',327  'background-image',328  'background-origin',329  'background-position',330  'background-position-x',331  'background-position-y',332  'background-repeat',333  'background-size',334  'baseline-shift',335  'block-size',336  'border',337  'border-block',338  'border-block-color',339  'border-block-end',340  'border-block-end-color',341  'border-block-end-style',342  'border-block-end-width',343  'border-block-start',344  'border-block-start-color',345  'border-block-start-style',346  'border-block-start-width',347  'border-block-style',348  'border-block-width',349  'border-bottom',350  'border-bottom-color',351  'border-bottom-left-radius',352  'border-bottom-right-radius',353  'border-bottom-style',354  'border-bottom-width',355  'border-collapse',356  'border-color',357  'border-end-end-radius',358  'border-end-start-radius',359  'border-image',360  'border-image-outset',361  'border-image-repeat',362  'border-image-slice',363  'border-image-source',364  'border-image-width',365  'border-inline',366  'border-inline-color',367  'border-inline-end',368  'border-inline-end-color',369  'border-inline-end-style',370  'border-inline-end-width',371  'border-inline-start',372  'border-inline-start-color',373  'border-inline-start-style',374  'border-inline-start-width',375  'border-inline-style',376  'border-inline-width',377  'border-left',378  'border-left-color',379  'border-left-style',380  'border-left-width',381  'border-radius',382  'border-right',383  'border-right-color',384  'border-right-style',385  'border-right-width',386  'border-spacing',387  'border-start-end-radius',388  'border-start-start-radius',389  'border-style',390  'border-top',391  'border-top-color',392  'border-top-left-radius',393  'border-top-right-radius',394  'border-top-style',395  'border-top-width',396  'border-width',397  'bottom',398  'box-align',399  'box-decoration-break',400  'box-direction',401  'box-flex',402  'box-flex-group',403  'box-lines',404  'box-ordinal-group',405  'box-orient',406  'box-pack',407  'box-shadow',408  'box-sizing',409  'break-after',410  'break-before',411  'break-inside',412  'caption-side',413  'caret-color',414  'clear',415  'clip',416  'clip-path',417  'clip-rule',418  'color',419  'color-interpolation',420  'color-interpolation-filters',421  'color-profile',422  'color-rendering',423  'color-scheme',424  'column-count',425  'column-fill',426  'column-gap',427  'column-rule',428  'column-rule-color',429  'column-rule-style',430  'column-rule-width',431  'column-span',432  'column-width',433  'columns',434  'contain',435  'contain-intrinsic-block-size',436  'contain-intrinsic-height',437  'contain-intrinsic-inline-size',438  'contain-intrinsic-size',439  'contain-intrinsic-width',440  'container',441  'container-name',442  'container-type',443  'content',444  'content-visibility',445  'counter-increment',446  'counter-reset',447  'counter-set',448  'cue',449  'cue-after',450  'cue-before',451  'cursor',452  'cx',453  'cy',454  'direction',455  'display',456  'dominant-baseline',457  'empty-cells',458  'enable-background',459  'field-sizing',460  'fill',461  'fill-opacity',462  'fill-rule',463  'filter',464  'flex',465  'flex-basis',466  'flex-direction',467  'flex-flow',468  'flex-grow',469  'flex-shrink',470  'flex-wrap',471  'float',472  'flood-color',473  'flood-opacity',474  'flow',475  'font',476  'font-display',477  'font-family',478  'font-feature-settings',479  'font-kerning',480  'font-language-override',481  'font-optical-sizing',482  'font-palette',483  'font-size',484  'font-size-adjust',485  'font-smooth',486  'font-smoothing',487  'font-stretch',488  'font-style',489  'font-synthesis',490  'font-synthesis-position',491  'font-synthesis-small-caps',492  'font-synthesis-style',493  'font-synthesis-weight',494  'font-variant',495  'font-variant-alternates',496  'font-variant-caps',497  'font-variant-east-asian',498  'font-variant-emoji',499  'font-variant-ligatures',500  'font-variant-numeric',501  'font-variant-position',502  'font-variation-settings',503  'font-weight',504  'forced-color-adjust',505  'gap',506  'glyph-orientation-horizontal',507  'glyph-orientation-vertical',508  'grid',509  'grid-area',510  'grid-auto-columns',511  'grid-auto-flow',512  'grid-auto-rows',513  'grid-column',514  'grid-column-end',515  'grid-column-start',516  'grid-gap',517  'grid-row',518  'grid-row-end',519  'grid-row-start',520  'grid-template',521  'grid-template-areas',522  'grid-template-columns',523  'grid-template-rows',524  'hanging-punctuation',525  'height',526  'hyphenate-character',527  'hyphenate-limit-chars',528  'hyphens',529  'icon',530  'image-orientation',531  'image-rendering',532  'image-resolution',533  'ime-mode',534  'initial-letter',535  'initial-letter-align',536  'inline-size',537  'inset',538  'inset-area',539  'inset-block',540  'inset-block-end',541  'inset-block-start',542  'inset-inline',543  'inset-inline-end',544  'inset-inline-start',545  'isolation',546  'justify-content',547  'justify-items',548  'justify-self',549  'kerning',550  'left',551  'letter-spacing',552  'lighting-color',553  'line-break',554  'line-height',555  'line-height-step',556  'list-style',557  'list-style-image',558  'list-style-position',559  'list-style-type',560  'margin',561  'margin-block',562  'margin-block-end',563  'margin-block-start',564  'margin-bottom',565  'margin-inline',566  'margin-inline-end',567  'margin-inline-start',568  'margin-left',569  'margin-right',570  'margin-top',571  'margin-trim',572  'marker',573  'marker-end',574  'marker-mid',575  'marker-start',576  'marks',577  'mask',578  'mask-border',579  'mask-border-mode',580  'mask-border-outset',581  'mask-border-repeat',582  'mask-border-slice',583  'mask-border-source',584  'mask-border-width',585  'mask-clip',586  'mask-composite',587  'mask-image',588  'mask-mode',589  'mask-origin',590  'mask-position',591  'mask-repeat',592  'mask-size',593  'mask-type',594  'masonry-auto-flow',595  'math-depth',596  'math-shift',597  'math-style',598  'max-block-size',599  'max-height',600  'max-inline-size',601  'max-width',602  'min-block-size',603  'min-height',604  'min-inline-size',605  'min-width',606  'mix-blend-mode',607  'nav-down',608  'nav-index',609  'nav-left',610  'nav-right',611  'nav-up',612  'none',613  'normal',614  'object-fit',615  'object-position',616  'offset',617  'offset-anchor',618  'offset-distance',619  'offset-path',620  'offset-position',621  'offset-rotate',622  'opacity',623  'order',624  'orphans',625  'outline',626  'outline-color',627  'outline-offset',628  'outline-style',629  'outline-width',630  'overflow',631  'overflow-anchor',632  'overflow-block',633  'overflow-clip-margin',634  'overflow-inline',635  'overflow-wrap',636  'overflow-x',637  'overflow-y',638  'overlay',639  'overscroll-behavior',640  'overscroll-behavior-block',641  'overscroll-behavior-inline',642  'overscroll-behavior-x',643  'overscroll-behavior-y',644  'padding',645  'padding-block',646  'padding-block-end',647  'padding-block-start',648  'padding-bottom',649  'padding-inline',650  'padding-inline-end',651  'padding-inline-start',652  'padding-left',653  'padding-right',654  'padding-top',655  'page',656  'page-break-after',657  'page-break-before',658  'page-break-inside',659  'paint-order',660  'pause',661  'pause-after',662  'pause-before',663  'perspective',664  'perspective-origin',665  'place-content',666  'place-items',667  'place-self',668  'pointer-events',669  'position',670  'position-anchor',671  'position-visibility',672  'print-color-adjust',673  'quotes',674  'r',675  'resize',676  'rest',677  'rest-after',678  'rest-before',679  'right',680  'rotate',681  'row-gap',682  'ruby-align',683  'ruby-position',684  'scale',685  'scroll-behavior',686  'scroll-margin',687  'scroll-margin-block',688  'scroll-margin-block-end',689  'scroll-margin-block-start',690  'scroll-margin-bottom',691  'scroll-margin-inline',692  'scroll-margin-inline-end',693  'scroll-margin-inline-start',694  'scroll-margin-left',695  'scroll-margin-right',696  'scroll-margin-top',697  'scroll-padding',698  'scroll-padding-block',699  'scroll-padding-block-end',700  'scroll-padding-block-start',701  'scroll-padding-bottom',702  'scroll-padding-inline',703  'scroll-padding-inline-end',704  'scroll-padding-inline-start',705  'scroll-padding-left',706  'scroll-padding-right',707  'scroll-padding-top',708  'scroll-snap-align',709  'scroll-snap-stop',710  'scroll-snap-type',711  'scroll-timeline',712  'scroll-timeline-axis',713  'scroll-timeline-name',714  'scrollbar-color',715  'scrollbar-gutter',716  'scrollbar-width',717  'shape-image-threshold',718  'shape-margin',719  'shape-outside',720  'shape-rendering',721  'speak',722  'speak-as',723  'src', // @font-face724  'stop-color',725  'stop-opacity',726  'stroke',727  'stroke-dasharray',728  'stroke-dashoffset',729  'stroke-linecap',730  'stroke-linejoin',731  'stroke-miterlimit',732  'stroke-opacity',733  'stroke-width',734  'tab-size',735  'table-layout',736  'text-align',737  'text-align-all',738  'text-align-last',739  'text-anchor',740  'text-combine-upright',741  'text-decoration',742  'text-decoration-color',743  'text-decoration-line',744  'text-decoration-skip',745  'text-decoration-skip-ink',746  'text-decoration-style',747  'text-decoration-thickness',748  'text-emphasis',749  'text-emphasis-color',750  'text-emphasis-position',751  'text-emphasis-style',752  'text-indent',753  'text-justify',754  'text-orientation',755  'text-overflow',756  'text-rendering',757  'text-shadow',758  'text-size-adjust',759  'text-transform',760  'text-underline-offset',761  'text-underline-position',762  'text-wrap',763  'text-wrap-mode',764  'text-wrap-style',765  'timeline-scope',766  'top',767  'touch-action',768  'transform',769  'transform-box',770  'transform-origin',771  'transform-style',772  'transition',773  'transition-behavior',774  'transition-delay',775  'transition-duration',776  'transition-property',777  'transition-timing-function',778  'translate',779  'unicode-bidi',780  'user-modify',781  'user-select',782  'vector-effect',783  'vertical-align',784  'view-timeline',785  'view-timeline-axis',786  'view-timeline-inset',787  'view-timeline-name',788  'view-transition-name',789  'visibility',790  'voice-balance',791  'voice-duration',792  'voice-family',793  'voice-pitch',794  'voice-range',795  'voice-rate',796  'voice-stress',797  'voice-volume',798  'white-space',799  'white-space-collapse',800  'widows',801  'width',802  'will-change',803  'word-break',804  'word-spacing',805  'word-wrap',806  'writing-mode',807  'x',808  'y',809  'z-index',810  'zoom'811].sort().reverse();812 813/*814Language: SCSS815Description: Scss is an extension of the syntax of CSS.816Author: Kurt Emch <kurt@kurtemch.com>817Website: https://sass-lang.com818Category: common, css, web819*/820 821 822/** @type LanguageFn */823function scss(hljs) {824  const modes = MODES(hljs);825  const PSEUDO_ELEMENTS$1 = PSEUDO_ELEMENTS;826  const PSEUDO_CLASSES$1 = PSEUDO_CLASSES;827 828  const AT_IDENTIFIER = '@[a-z-]+'; // @font-face829  const AT_MODIFIERS = "and or not only";830  const IDENT_RE = '[a-zA-Z-][a-zA-Z0-9_-]*';831  const VARIABLE = {832    className: 'variable',833    begin: '(\\$' + IDENT_RE + ')\\b',834    relevance: 0835  };836 837  return {838    name: 'SCSS',839    case_insensitive: true,840    illegal: '[=/|\']',841    contains: [842      hljs.C_LINE_COMMENT_MODE,843      hljs.C_BLOCK_COMMENT_MODE,844      // to recognize keyframe 40% etc which are outside the scope of our845      // attribute value mode846      modes.CSS_NUMBER_MODE,847      {848        className: 'selector-id',849        begin: '#[A-Za-z0-9_-]+',850        relevance: 0851      },852      {853        className: 'selector-class',854        begin: '\\.[A-Za-z0-9_-]+',855        relevance: 0856      },857      modes.ATTRIBUTE_SELECTOR_MODE,858      {859        className: 'selector-tag',860        begin: '\\b(' + TAGS.join('|') + ')\\b',861        // was there, before, but why?862        relevance: 0863      },864      {865        className: 'selector-pseudo',866        begin: ':(' + PSEUDO_CLASSES$1.join('|') + ')'867      },868      {869        className: 'selector-pseudo',870        begin: ':(:)?(' + PSEUDO_ELEMENTS$1.join('|') + ')'871      },872      VARIABLE,873      { // pseudo-selector params874        begin: /\(/,875        end: /\)/,876        contains: [ modes.CSS_NUMBER_MODE ]877      },878      modes.CSS_VARIABLE,879      {880        className: 'attribute',881        begin: '\\b(' + ATTRIBUTES.join('|') + ')\\b'882      },883      { begin: '\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b' },884      {885        begin: /:/,886        end: /[;}{]/,887        relevance: 0,888        contains: [889          modes.BLOCK_COMMENT,890          VARIABLE,891          modes.HEXCOLOR,892          modes.CSS_NUMBER_MODE,893          hljs.QUOTE_STRING_MODE,894          hljs.APOS_STRING_MODE,895          modes.IMPORTANT,896          modes.FUNCTION_DISPATCH897        ]898      },899      // matching these here allows us to treat them more like regular CSS900      // rules so everything between the {} gets regular rule highlighting,901      // which is what we want for page and font-face902      {903        begin: '@(page|font-face)',904        keywords: {905          $pattern: AT_IDENTIFIER,906          keyword: '@page @font-face'907        }908      },909      {910        begin: '@',911        end: '[{;]',912        returnBegin: true,913        keywords: {914          $pattern: /[a-z-]+/,915          keyword: AT_MODIFIERS,916          attribute: MEDIA_FEATURES.join(" ")917        },918        contains: [919          {920            begin: AT_IDENTIFIER,921            className: "keyword"922          },923          {924            begin: /[a-z-]+(?=:)/,925            className: "attribute"926          },927          VARIABLE,928          hljs.QUOTE_STRING_MODE,929          hljs.APOS_STRING_MODE,930          modes.HEXCOLOR,931          modes.CSS_NUMBER_MODE932        ]933      },934      modes.FUNCTION_DISPATCH935    ]936  };937}938 939export { scss as default };940 
basant307/AI_Governance_Project · CoolFace