@@ -390,7 +390,7 @@ repository:
390
390
- { match: on|use|bind, name: keyword.control.svelte }
391
391
- { match: transition|in|out|animate, name: keyword.other.animation.svelte }
392
392
- { match: let, name: storage.type.svelte }
393
- - { match: class, name: entity.other.attribute-name.svelte }
393
+ - { match: class|style, name: entity.other.attribute-name.svelte }
394
394
395
395
# For Svelte element directives. Scopes the 'click' part in `on:click`.
396
396
# The scope of the variable should represent what data type it generally is.
@@ -400,7 +400,7 @@ repository:
400
400
- { match: '(?<=(on):).*$', name: entity.name.type.svelte }
401
401
- { match: '(?<=(bind):).*$', name: variable.parameter.svelte }
402
402
- { match: '(?<=(use|transition|in|out|animate):).*$', name: variable.function.svelte }
403
- - { match: '(?<=(let|class):).*$', name: variable.parameter.svelte }
403
+ - { match: '(?<=(let|class|style ):).*$', name: variable.parameter.svelte }
404
404
405
405
# For directives that may be better suited using different scopes if assigned to something.
406
406
# e.g. `class:var={var}` is different to `class:var`.
@@ -411,15 +411,16 @@ repository:
411
411
# Makes 'bind:this' display like `this` would in JS.
412
412
- { match: '(?<=(bind):)this$', name: variable.language.svelte }
413
413
# If other keywords are patched in in the future, they can easily be added here.
414
- - { match: '(?<=(bind):).*$', name: entity.name.type.svelte }
415
- - { match: '(?<=(class):).*$', name: entity.other.attribute-name.class.svelte }
414
+ - { match: '(?<=(bind):).*$', name: entity.name.type.svelte }
415
+ - { match: '(?<=(class):).*$', name: entity.other.attribute-name.class.svelte }
416
+ - { match: '(?<=(style):).*$', name: support.type.property-name.svelte }
416
417
# Defaults to the non-assignment version for everything else.
417
418
- include : ' #attributes-directives-types'
418
419
419
420
# Matches Svelte element directives, e.g. `on:click|preventDefault={var}`
420
421
attributes-directives :
421
422
# If something is added to attributes-directives-keywords, it must be added to the begin-regex, too.
422
- begin : (?<!<)(on|use|bind|transition|in|out|animate|let|class)(:)(?:([_$[:alpha:]][_\-$[:alnum:]]*(?=\s*=))|([_$[:alpha:]][_\-$[:alnum:]]*))((\|\w+)*)
423
+ begin : (?<!<)(on|use|bind|transition|in|out|animate|let|class|style )(:)(?:((?:--)? [_$[:alpha:]][_\-$[:alnum:]]*(?=\s*=))|((?:--)? [_$[:alpha:]][_\-$[:alnum:]]*))((\|\w+)*)
423
424
beginCaptures :
424
425
1 : { patterns: [ include: '#attributes-directives-keywords' ] }
425
426
2 : { name: punctuation.definition.keyword.svelte }
0 commit comments