Convert class and style builder into a method of Template class

This commit is contained in:
Kijin Sung 2023-10-17 22:44:27 +09:00
parent 82b9107ca0
commit 55cafc5c33
6 changed files with 61 additions and 24 deletions

View file

@ -47,8 +47,17 @@
@enddesktop
<div class="barContainer" data-bar="{$bar|json}">
<span @class(['a-1', 'font-normal' => $foo, 'text-blue' => false, 'bg-white' => true])></span>
<span @style(['border-radius: 0.25rem', 'margin: 1rem' => Context::get('bar'), 'padding: 2rem' => false])></span>
<span @class([
'a-1',
'font-normal' => $foo,
'text-blue' => false,
'bg-gray-200' => true
])></span>
<span @style([
'border-radius: 0.25rem',
'margin: 1rem' => Context::get('bar'),
'padding: 2rem' => false,
])></span>
</div>
<script type="text/javascript">