tailwind_merge 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/tailwind_merge/config.rb +2 -2
- data/lib/tailwind_merge/validators.rb +1 -1
- data/lib/tailwind_merge/version.rb +1 -1
- data/lib/tailwind_merge.rb +1 -7
- data/script/{changelog_generator → generate_changelog} +0 -0
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c49468c0bdbf4ddb68d243dccfa35e4625ea4f703629a4e544e61776a38eeb2b
         | 
| 4 | 
            +
              data.tar.gz: 1679630fbd3af2a407cdc64d73ea2fedbf0bcafa7b299fbfd7a2c673d643ae21
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 69f000a1202366ebe7b98845248db99266a639ff286eb944be5eb6443bc7d40500a328946dd44ad03a82ca049f6ceb12daec62fc7f143ca0bac80f42b38cb466
         | 
| 7 | 
            +
              data.tar.gz: 99e3566837682b68b64096730b1443ff8ccde5a19cb483a15defc344c6a5a7a6d24fc20838fe80a9834e4c6ecbee86ca5916c6bea5862ee54ca0e8da9cc0c442
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,13 @@ | |
| 1 1 | 
             
            # Changelog
         | 
| 2 2 |  | 
| 3 | 
            +
            ## [v0.1.3](https://github.com/gjtorikian/tailwind_merge/tree/v0.1.3) (2022-10-11)
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            [Full Changelog](https://github.com/gjtorikian/tailwind_merge/compare/v0.1.2...v0.1.3)
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            ## [v0.1.2](https://github.com/gjtorikian/tailwind_merge/tree/v0.1.2) (2022-10-11)
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            [Full Changelog](https://github.com/gjtorikian/tailwind_merge/compare/v0.1.1...v0.1.2)
         | 
| 10 | 
            +
             | 
| 3 11 | 
             
            ## [v0.1.1](https://github.com/gjtorikian/tailwind_merge/tree/v0.1.1) (2022-10-11)
         | 
| 4 12 |  | 
| 5 13 | 
             
            [Full Changelog](https://github.com/gjtorikian/tailwind_merge/compare/v0.1.0...v0.1.1)
         | 
    
        data/README.md
    CHANGED
    
    | @@ -291,7 +291,7 @@ Here's a brief summary for each validator: | |
| 291 291 | 
             
            -   `IS_ARBITRARY_SIZE` checks whether class part is an arbitrary value which starts with `size:` (`[size:200px_100px]`) which is necessary for background-size classNames.
         | 
| 292 292 | 
             
            -   `IS_ARBITRARY_POSITION` checks whether class part is an arbitrary value which starts with `position:` (`[position:200px_100px]`) which is necessary for background-position classNames.
         | 
| 293 293 | 
             
            -   `IS_ARBITRARY_URL` checks whether class part is an arbitrary value which starts with `url:` or `url(` (`[url('/path-to-image.png')]`, `url:var(--maybe-a-url-at-runtime)]`) which is necessary for background-image classNames.
         | 
| 294 | 
            -
            -   ` | 
| 294 | 
            +
            -   `IS_ARBITRARY_NUMBER` checks whether class part is an arbitrary value which starts with `number:` or is a number (`[number:var(--value)]`, `[450]`) which is necessary for font-weight classNames.
         | 
| 295 295 | 
             
            -   `IS_ARBITRARY_SHADOW` checks whether class part is an arbitrary value which starts with the same pattern as a shadow value (`[0_35px_60px_-15px_rgba(0,0,0,0.3)]`), namely with two lengths separated by a underscore.
         | 
| 296 296 | 
             
            -   `IS_ANY` always returns true. Be careful with this validator as it might match unwanted classes. I use it primarily to match colors or when it's certain there are no other class groups in a namespace.
         | 
| 297 297 |  | 
| @@ -626,7 +626,7 @@ module TailwindMerge | |
| 626 626 | 
             
                          "bold",
         | 
| 627 627 | 
             
                          "extrabold",
         | 
| 628 628 | 
             
                          "black",
         | 
| 629 | 
            -
                           | 
| 629 | 
            +
                          IS_ARBITRARY_NUMBER,
         | 
| 630 630 | 
             
                        ],
         | 
| 631 631 | 
             
                      },
         | 
| 632 632 | 
             
                    ],
         | 
| @@ -1545,7 +1545,7 @@ module TailwindMerge | |
| 1545 1545 | 
             
                    # Stroke Width
         | 
| 1546 1546 | 
             
                    # @see https://tailwindcss.com/docs/stroke-width
         | 
| 1547 1547 | 
             
                    ##
         | 
| 1548 | 
            -
                    "stroke-w" => [{ "stroke" => [IS_LENGTH] }],
         | 
| 1548 | 
            +
                    "stroke-w" => [{ "stroke" => [IS_LENGTH, IS_ARBITRARY_NUMBER] }],
         | 
| 1549 1549 | 
             
                    ##
         | 
| 1550 1550 | 
             
                    # Stroke
         | 
| 1551 1551 | 
             
                    # @see https://tailwindcss.com/docs/stroke
         | 
    
        data/lib/tailwind_merge.rb
    CHANGED
    
    | @@ -34,17 +34,11 @@ module TailwindMerge | |
| 34 34 | 
             
                end
         | 
| 35 35 |  | 
| 36 36 | 
             
                def merge(classes)
         | 
| 37 | 
            -
                  return merge_class_list(classes) unless has_cache?
         | 
| 38 | 
            -
             | 
| 39 37 | 
             
                  @cache.getset(classes) do
         | 
| 40 38 | 
             
                    merge_class_list(classes)
         | 
| 41 39 | 
             
                  end
         | 
| 42 40 | 
             
                end
         | 
| 43 41 |  | 
| 44 | 
            -
                def has_cache?
         | 
| 45 | 
            -
                  @cache.nil?
         | 
| 46 | 
            -
                end
         | 
| 47 | 
            -
             | 
| 48 42 | 
             
                private def merge_class_list(classes)
         | 
| 49 43 | 
             
                  # Set of class_group_ids in following format:
         | 
| 50 44 | 
             
                  # `{importantModifier}{variantModifiers}{classGroupId}`
         | 
| @@ -53,7 +47,7 @@ module TailwindMerge | |
| 53 47 | 
             
                  # @example 'md:!pr'
         | 
| 54 48 | 
             
                  class_groups_in_conflict = Set.new
         | 
| 55 49 |  | 
| 56 | 
            -
                  classes.strip.split(SPLIT_CLASSES_REGEX). | 
| 50 | 
            +
                  classes.strip.split(SPLIT_CLASSES_REGEX).map do |original_class_name|
         | 
| 57 51 | 
             
                    modifiers, has_important_modifier, base_class_name = split_modifiers(original_class_name)
         | 
| 58 52 |  | 
| 59 53 | 
             
                    class_group_id = @class_utils.class_group_id(base_class_name)
         | 
| 
            File without changes
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: tailwind_merge
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Garen J. Torikian
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022-10- | 
| 11 | 
            +
            date: 2022-10-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: lru_redux
         | 
| @@ -140,7 +140,7 @@ files: | |
| 140 140 | 
             
            - lib/tailwind_merge/config.rb
         | 
| 141 141 | 
             
            - lib/tailwind_merge/validators.rb
         | 
| 142 142 | 
             
            - lib/tailwind_merge/version.rb
         | 
| 143 | 
            -
            - script/ | 
| 143 | 
            +
            - script/generate_changelog
         | 
| 144 144 | 
             
            - tailwind_merge.gemspec
         | 
| 145 145 | 
             
            homepage: https://www.github.com/gjtorikian/tailwind_merge
         | 
| 146 146 | 
             
            licenses:
         |