stivoat / tailwind-fold

Visual Studio Code extension that improves code readability by folding long class attributes
https://marketplace.visualstudio.com/items?itemName=stivo.tailwind-fold
MIT License
112 stars 20 forks source link

Support .blade.php files on Laravel #51

Open EncryptEx opened 1 month ago

EncryptEx commented 1 month ago

On native html files it works for me but I'm experiencing issues while trying to fold TW classes on .blade.php files while using Laravel Framework, e.g (this code does not being folded):

<x-app-layout>
    <x-slot name="header">
        <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
            {{ __('Dashboard') }}
        </h2>
    </x-slot>

    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
                <div class="p-6 text-gray-900 dark:text-gray-100">
                    {{ __("You're logged in!") }}
                </div>
            </div>
        </div>
    </div>
</x-app-layout>

I don't know much if the issue regards the file extension or code structure, bc Blade template files sometimes use custom tags like x-app-layout

Thanks 4 ur time

EncryptEx commented 1 month ago

nvm I found #28

gregmsanderson commented 1 month ago

Further to this, while #28 does indeed work, any classes used within a Blade @class are not folded.

For example if you were to do something like this (which would always apply the first line of classes, and then only apply the second if the condition was true) ...

@class([
   'flex px-3 py-2 accent-primary w-full',
   'border-red-500' => $errors->has('name'),
])

... classes within that block are seemingly not folded. It would be nice if it could also look for those within @class([ ... ]).