Skip to content

Commit

Permalink
helper module
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Nov 1, 2024
1 parent 4069e6d commit bd52821
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,23 @@ end
<%= link_to :Avo, "https://avohq.io", class: button_classes.render(color: :red, size: :xl) %>
```

## Helper module

If you're developing something more complex you might want to use composition more. You might want to use the helper module for that.

```ruby
class MyClass
include ClassVariants::Helper

class_variants {
base: {},
variants: {}
}
end

MyClass.new.class_variants(:container, color: :red, class: "shadow")
```

## `tailwind_merge`

By default, the classes are merged using `concat`, but you can use the awesome [TailwindMerge](https://github.com/gjtorikian/tailwind_merge) gem.
Expand Down

0 comments on commit bd52821

Please sign in to comment.