Stillat / blade-parser-typescript

A Laravel Blade parser, compiler, and static analyzer written in TypeScript.
https://stillat.com
MIT License
90 stars 3 forks source link

[Formatting bug]: Missing space after Tailwind keywords #97

Closed daniel-zahariev closed 7 months ago

daniel-zahariev commented 7 months ago

Problem

Following the tutorial in this article i have formatted a Blade template which looks roughly like:

<!DOCTYPE html>
<html>
    <head>
        <script src="https://cdn.tailwindcss.com"></script>
        <style type="text/tailwindcss">
            @layer components {
                .btn {
                    @apply rounded-full leading-4;
                    color: white;
                }
            }
        </style>
    </head>
    <body>
        Hello
    </body>
</html>

and the spaces after @layer and @apply were stripped and the file looks as follows post-formatting:

<!DOCTYPE html>
<html>
    <head>
        <script src="https://cdn.tailwindcss.com"></script>
        <style type="text/tailwindcss">
            @layercomponents {
                .btn {
                    @applyrounded-full leading-4;
                    color: white;
                }
            }
        </style>
    </head>
    <body>
        Hello
    </body>
</html>

This completely breaks the Tailwind styling.

Expectation

Expected behaviour would be that those spaces are not stripped.

Software Versions

Laravel: 11 prettier: 3.2.5 prettier-plugin-blade: 2.1.11 prettier-plugin-tailwindcss: 0.5.13

JohnathonKoster commented 7 months ago

Thanks for the detailed information! This has been corrected, and the fix is available in version 2.1.12