Giter VIP home page Giter VIP logo

tailwind-reorder's People

Contributors

54nd10 avatar cwsuba avatar rg3915 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tailwind-reorder's Issues

Problems with PHP tags and Alpine.js dynamic classes

Hi!

I'd be super interested in getting this to work for me since I'm not much of a VSCode fan, but right now, your regex isn't picking up classes correctly and most of the time mangles the code I'm working on. See this simple example with some alpine.js code sprinkled into it:

<button type="button" :class="{ 'active': open  }" @click="toggleOpenClose" class="group p-3 bg-white text-black hover:bg-black hover:text-white header-toggle">
    <span class="sr-only"><?=__('Toggle navigation', 'lang'); ?></span>
    <?php echo wp_svg('menu', 'w-12 h-auto fill-current'); ?>
</button>

Becomes this:

<button type="button" :class="bg-white text-black p-3 'active': @click="toggleOpenClose" class="group header-toggle hover:bg-black hover:text-white open { }"">
    <span class="sr-only "><?=__('Toggle navigation', 'lang'); ?></span>
    <?php echo wp_svg('menu', 'w-12 h-auto fill-current'); ?>
</button>

Might I suggest you sniff into Headwind's code and regexes? I could even create a pull request to add more proper regexes and parametrize them to allow customization in the settings ๐Ÿ‘€

Remove last space with strip

Remove last space of sorted_class with strip.

Example:

class="bg-gray-50 " to class="bg-gray-50"

if only one class exists.

Doesn't work on sublime 4 and tailwind 3

Hi! Thank you for this plugin. But in my case it isn't working properly.

This is what i get after applying plugin to my code

<div class="p-5 rounded-xl bg-opacity-20 bg-slate-700 text-center lg:p-10 md:p-8">
                    <svg xmlns="http://www.w3.org/2000/svg" class="mb-5" mx-auto text-fuchsia-400 h-10 w-10 0 24 24" fill="none" stroke="currentColor viewBox="0">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" />
                    </svg>
                    <h3 class="mb-3 font-bold ">Less noise from the news</h3>
                    <p class="opacity-60 ">Only 1 email with all new materials from your favourite websites</p>
                </div>

Original code

<div class="p-5 md:p-8 lg:p-10 rounded-xl bg-slate-700 bg-opacity-20 text-center">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10 text-fuchsia-400 mx-auto mb-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" />
                    </svg>
                    <h3 class="mb-3 font-bold">Less noise from the news</h3>
                    <p class="opacity-60">Only 1 email with all new materials from your favourite websites</p>
                </div>

What's wrong

  • the classes from the svg have moved outside the class property
  • all classes have a space after the last attribute

Mac OS 12.1 (21C52)
Sublime 4126
Tailwind 3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.