Skip to content

Commit

Permalink
Added support for slots to tagged components
Browse files Browse the repository at this point in the history
  • Loading branch information
shnhrrsn committed Nov 11, 2017
1 parent afe6f35 commit 9b8e60c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions grind-stone.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ contexts:
pop: true
- include: tagged_component

- match: '(</?)(slot):([a-zA-Z0-9_]+)'
captures:
1: punctuation.definition.tag.begin.html
2: entity.name.tag.other.html
3: entity.other.attribute-name.html
push:
- meta_scope: meta.tag.other.html
- match: '(?: ?/)?>'
scope: punctuation.definition.tag.end.html
pop: true

directive_args:
- meta_scope: custom.compiler.stone.js
- meta_content_scope: source.js.stone
Expand Down
4 changes: 4 additions & 0 deletions test.stone
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Hello, {!! name || '<i>Default</i>' !!}.
<grind date={Date.now()} required data="testing"></grind>
<grind date={Date.now()} data="testing" { ...({ grind: 'framework', bool: true }) } />

<grind>
<slot:title><h1>Grind</h1></slot:title>
</grind>

@include('header')

@include('footer')
Expand Down

0 comments on commit 9b8e60c

Please sign in to comment.