Packages

This package adds a convenient way of using Simpleicons with your Phoenix, Phoenix LiveView and Surface applications.

Current section

3 Versions

Jump to

Compare versions

5 files changed
+12 additions
-6 deletions
  @@ -1,3 +1,7 @@
1 + ## v0.2.0 (2025-05-21)
2 +
3 + - svg stroke width attr
4 +
1 5 ## v0.1.0 (2025-05-20)
2 6
3 7 - Initial release
  @@ -10,7 +10,7 @@ Add `ex_simpleicons` and `simpleicons` to the list of dependencies in `mix.exs`:
10 10 ```elixir
11 11 def deps do
12 12 [
13 - {:ex_simpleicons, "~> 0.1.0"},
13 + {:ex_simpleicons, "~> 0.2.0"},
14 14 {:simpleicons,
15 15 github: "simple-icons/simple-icons",
16 16 tag: "14.14.0",
  @@ -1,7 +1,7 @@
1 1 {<<"links">>,
2 2 [{<<"GitHub">>,<<"https://github.com/lorantkurthy/ex_simpleicons">>}]}.
3 3 {<<"name">>,<<"ex_simpleicons">>}.
4 - {<<"version">>,<<"0.1.0">>}.
4 + {<<"version">>,<<"0.2.0">>}.
5 5 {<<"description">>,
6 6 <<"This package adds a convenient way of using Simpleicons with your Phoenix, Phoenix LiveView and Surface applications.">>}.
7 7 {<<"elixir">>,<<"~> 1.14">>}.
  @@ -8,7 +8,7 @@ defmodule Simpleicons do
8 8
9 9 def deps do
10 10 [
11 - {:ex_simpleicons, "~> 1.0.0"},
11 + {:ex_simpleicons, "~> 0.2.0"},
12 12 {:simpleicons,
13 13 github: "simple-icons/simple-icons",
14 14 tag: "14.14.0",
  @@ -81,6 +81,7 @@ defmodule Simpleicons do
81 81
82 82 attr :name, :string, values: @names, required: true, doc: "the name of the icon"
83 83 attr :class, :string, default: nil, doc: "the css classes to add to the svg container"
84 + attr :stroke_width, :string, default: "1.0", doc: "svg stroke-width"
84 85 attr :rest, :global, doc: "the arbitrary HTML attributes to add to the svg container"
85 86
86 87 def icon(assigns) do
  @@ -93,13 +94,14 @@ defmodule Simpleicons do
93 94
94 95 ~H"""
95 96 <!-- simpleicons-<%= @name %> -->
96 - <.svg_container class={@class} viewbox={svg_viewbox(@name)} {@rest}>
97 + <.svg_container class={@class} viewbox={svg_viewbox(@name)} stroke_width={@stroke_width} {@rest}>
97 98 <%= {:safe, svg_body(@name)} %>
98 99 </.svg_container>
99 100 """
100 101 end
101 102
102 103 attr :class, :string, default: nil, doc: "the css classes to add to the svg container"
104 + attr :stroke_width, :string, default: "1.0", doc: "svg stroke-width"
103 105 attr :rest, :global, doc: "the arbitrary HTML attributes to add to the svg container"
104 106 attr :viewbox, :string, default: "0 0 24 24", doc: "the viewbox for the svg container"
105 107
  @@ -111,7 +113,7 @@ defmodule Simpleicons do
111 113 xmlns="http://www.w3.org/2000/svg"
112 114 fill="none"
113 115 viewBox={@viewbox}
114 - stroke-width="1.5"
116 + stroke-width={@stroke_width}
115 117 stroke="currentColor"
116 118 aria-hidden="true"
117 119 data-slot="icon"
  @@ -1,7 +1,7 @@
1 1 defmodule Simpleicons.MixProject do
2 2 use Mix.Project
3 3
4 - @version "0.1.0"
4 + @version "0.2.0"
5 5
6 6 def project do
7 7 [