Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sorting for modifier classes (focus:, md:...) #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Dec 31, 2021

  1. Add sorting for modifier classes

    This commit adds sorting for Tailwind modifier classes: `md:w-12`,
    `hover:bg-gray-500`...
    
    The sort is as follows:
    - Modifier classes are added after non-modifier classes, but before
      customClasses if those are appended
    - For a given modifier (e.g. `md:`), the sort is the same as `sortOrder`
    - Modifiers are sorted among one another in the order they appear in the
      Tailwind documentation
    
    Example:
    
    ```javascript
    // Input:
    "xl:mx-6 bg-gray-100 lg:mx-4 mt-1 sm:bg-gray-200 hover:bg-blue-100 lg:bg-gray-400 hover:text-blue-100 xl:bg-gray-600 sm:mx-2"
    
    // Output:
    "mt-1 bg-gray-100 hover:text-blue-100 hover:bg-blue-100 sm:mx-2 sm:bg-gray-200 lg:mx-4 lg:bg-gray-400 xl:mx-6 xl:bg-gray-600"
    ```
    phacks committed Dec 31, 2021
    Configuration menu
    Copy the full SHA
    c27b25a View commit details
    Browse the repository at this point in the history