Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
justalever committed Jul 15, 2024
1 parent 4f2f04c commit 4c2b487
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,22 @@ If you set default classes in your configuration you can disable those explicitl

**Pass a custom icon path**

Additional icons can be sourced from `app/assets/images`. Pass a custom path to render those. It's assumed the icon will be the `.svg` format.
Additional icons can be sourced from `app/assets/images`. Pass a custom path to render those. It's assumed the icon will be the `.svg` format. The path should be relative with a leading slash.

- An icon name or nil value for the name is still required.
- The file suffix is required in this scenario.

```erb
<!-- Resolves from app/assets/images/logo.svg -->
<%= icon "logo", custom_path: "logo.svg" %>
<%= icon "logo", custom_path: "/logo.svg" %>
```

**The kitchen sink**

```erb
<%= icon "star", variant: :micro, class: "size-3 fill-current text-pink-500", custom_path: "my_icons/star.svg", disable_default_class: true %>
<%= icon "star", variant: :micro, class: "size-3 fill-current text-pink-500", custom_path: "/my_icons/star.svg", disable_default_class: true %>
```

## Bugs
Expand Down
Binary file added gemfiles/railsui_icon-1.0.1.gem
Binary file not shown.
Binary file added gemfiles/railsui_icon-1.0.2.gem
Binary file not shown.
1 change: 0 additions & 1 deletion lib/railsui_icon/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def icon(name, options = {})
def resolve_custom_path(path)
return unless path

# Check if the custom path is relative and convert it to an absolute asset path
if Rails.application.config.assets.paths.any? { |p| path.start_with?(p) }
path
else
Expand Down
2 changes: 1 addition & 1 deletion lib/railsui_icon/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RailsuiIcon
VERSION = "1.0.0"
VERSION = "1.0.2"
end

0 comments on commit 4c2b487

Please sign in to comment.