Remove warnings for function version of the icons
This commit is contained in:
@ -32,7 +32,7 @@ and style it with some classes
|
|||||||
<Heroicons.Solid.cake class="h-6 w-6 text-gray-500" />
|
<Heroicons.Solid.cake class="h-6 w-6 text-gray-500" />
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that if you are not using HEEx/LiveView, there are (deprecated) function versions of each component:
|
There are also function versions of each component:
|
||||||
```eex
|
```eex
|
||||||
<%= Heroicons.Solid.cake() %>
|
<%= Heroicons.Solid.cake() %>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ defmodule Heroicons do
|
|||||||
|
|
||||||
<Heroicons.Solid.arrow_circle_right class="w-6 h-6" />
|
<Heroicons.Solid.arrow_circle_right class="w-6 h-6" />
|
||||||
|
|
||||||
Functions are also provided but deprecated
|
Can also be used as a function
|
||||||
|
|
||||||
<%= Heroicons.Outline.adjustments() %>
|
<%= Heroicons.Outline.adjustments() %>
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ defmodule Heroicons.Generator do
|
|||||||
|
|
||||||
<.#{name} class="h-6 w-6 text-gray-500" />
|
<.#{name} class="h-6 w-6 text-gray-500" />
|
||||||
|
|
||||||
Can also be used as a function (deprecated)
|
or as a function
|
||||||
|
|
||||||
<%= #{name}() %>
|
<%= #{name}() %>
|
||||||
|
|
||||||
@ -60,11 +60,6 @@ defmodule Heroicons.Generator do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unquote(name)(opts) when is_list(opts) do
|
def unquote(name)(opts) when is_list(opts) do
|
||||||
IO.warn(
|
|
||||||
"<%= #{unquote(name)}(class: \"...\" %> is deprecated, " <>
|
|
||||||
"please use <.#{unquote(name)} class=\"...\" /> inside HEEx templates instead"
|
|
||||||
)
|
|
||||||
|
|
||||||
attrs =
|
attrs =
|
||||||
for {k, v} <- opts do
|
for {k, v} <- opts do
|
||||||
safe_k =
|
safe_k =
|
||||||
|
@ -66,7 +66,7 @@ defmodule HeroiconsTest do
|
|||||||
|
|
||||||
<.academic_cap class="h-6 w-6 text-gray-500" />
|
<.academic_cap class="h-6 w-6 text-gray-500" />
|
||||||
|
|
||||||
Can also be used as a function (deprecated)
|
or as a function
|
||||||
|
|
||||||
<%= academic_cap() %>
|
<%= academic_cap() %>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user