@@ -340,17 +340,26 @@ repository:
340
340
# Matches attribute keyvalues. (and boolean attributes as well)
341
341
# e.g. `class="my-class"`
342
342
attributes-keyvalue :
343
- begin : ([_$[:alpha:]][_\-$[:alnum:]]*)
344
- beginCaptures : { 1: { name: entity.other.attribute-name.svelte } }
343
+ begin : ((?:--)?[_$[:alpha:]][_\-$[:alnum:]]*)
344
+ beginCaptures :
345
+ 0 :
346
+ patterns :
347
+ # Matches if the key is a `--css-variable` attribute.
348
+ - match : --.*
349
+ name : support.type.property-name.svelte
350
+ # Matches everything else.
351
+ - match : .*
352
+ name : entity.other.attribute-name.svelte
345
353
end : (?=\s*+[^=\s])
346
354
name : ' meta.attribute.$1.svelte'
347
- patterns : [ include: '#attributes-value' ]
355
+ patterns :
356
+ - begin : ' ='
357
+ beginCaptures : { 0: { name: punctuation.separator.key-value.svelte } }
358
+ end : (?<=[^\s=])(?!\s*=)|(?=/?>)
359
+ patterns : [include: '#attributes-value']
348
360
349
- # The value part of attribute keyvalues. e.g. `= "my-class"` in `class="my-class"`
361
+ # The value part of attribute keyvalues. e.g. `"my-class"` in `class="my-class"`
350
362
attributes-value :
351
- begin : ' ='
352
- beginCaptures : { 0: { name: punctuation.separator.key-value.svelte } }
353
- end : (?<=[^\s=])(?!\s*=)|(?=/?>)
354
363
patterns :
355
364
# No quotes - just an interpolation expression.
356
365
- include : ' #interpolation'
@@ -366,7 +375,7 @@ repository:
366
375
- begin : (['"])
367
376
end : \1
368
377
beginCaptures : { 0: { name: punctuation.definition.string.begin.svelte } }
369
- endCaptures : { 0: { name: punctuation.definition.string.end.svelte } }
378
+ endCaptures : { 0: { name: punctuation.definition.string.end.svelte } }
370
379
name : string.quoted.svelte
371
380
patterns : [ include: '#interpolation' ]
372
381
@@ -420,7 +429,10 @@ repository:
420
429
end : (?=\s*+[^=\s])
421
430
name : meta.directive.$1.svelte
422
431
patterns :
423
- - include : ' #attributes-value'
432
+ - begin : ' ='
433
+ beginCaptures : { 0: { name: punctuation.separator.key-value.svelte } }
434
+ end : (?<=[^\s=])(?!\s*=)|(?=/?>)
435
+ patterns : [include: '#attributes-value']
424
436
425
437
# ------
426
438
# TAGS
0 commit comments