diff --git a/assets/css/app.scss b/assets/css/app.scss index 9d3145e..3287440 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -1,6 +1,34 @@ /* Bootstrap v5 */ @import "~bootstrap/scss/bootstrap"; +/* SVG icon style helper */ +// [class*=" icon"], +// [class^="icon"] { +// width: 1em; +// height: 1em; +// stroke: currentColor; +// fill: currentColor; +// } + +/*SVG ICON SYSTEM*/ +.icon { + display: inline-flex; + align-self: center; +} + +.icon svg, +.icon img { + height: 1em; + width: 1em; + fill: currentColor; +} + +.icon.baseline svg, +.icon img { + top: 0.125em; + position: relative; +} + /* LiveView specific classes for your customizations */ .phx-no-feedback.invalid-feedback, .phx-no-feedback .invalid-feedback { diff --git a/lib/bones73k/util/list.ex b/lib/bones73k/util/list.ex new file mode 100644 index 0000000..311c044 --- /dev/null +++ b/lib/bones73k/util/list.ex @@ -0,0 +1,4 @@ +defmodule Bones73k.Util.List do + def prepend_if(list, condition, item), do: (!!condition && [item | list]) || list + def append_if(list, condition, item), do: (!!condition && list ++ [item]) || list +end diff --git a/lib/bones73k_web.ex b/lib/bones73k_web.ex index bb72582..6a6c372 100644 --- a/lib/bones73k_web.ex +++ b/lib/bones73k_web.ex @@ -102,6 +102,9 @@ defmodule Bones73kWeb do # Import basic rendering functionality (render, render_layout, etc) import Phoenix.View + # Import SVG Icon helper + import Bones73kWeb.IconHelper + import Bones73kWeb.ErrorHelpers import Bones73kWeb.Gettext alias Bones73kWeb.Router.Helpers, as: Routes diff --git a/lib/bones73k_web/templates/layout/_navbar.html.eex b/lib/bones73k_web/templates/layout/_navbar.html.eex index 1b00be2..5d02c53 100644 --- a/lib/bones73k_web/templates/layout/_navbar.html.eex +++ b/lib/bones73k_web/templates/layout/_navbar.html.eex @@ -1,7 +1,10 @@