Skip to content

Commit

Permalink
Add a right margin to link icons
Browse files Browse the repository at this point in the history
  • Loading branch information
choptastic committed Dec 30, 2023
1 parent f833585 commit d637490
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions priv/www/nitrogen.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,8 @@ a.upload_delete_file:hover {
background: rgba(0, 255, 0, 0.1);
}

.button_icon,
.link_icon {
margin-right: 0.2em;
}

6 changes: 3 additions & 3 deletions src/elements/html/element_link.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ render_element(Record = #link{}) ->
Icon = icon(Record#link.icon),
HasIcon = not(?WF_BLANK(Image)) orelse not(?WF_BLANK(Icon)),
Body = [
?WF_IF(HasIcon, [Image, Icon, " "]),
?WF_IF(HasIcon, [Image, Icon]),
wf:html_encode(Record#link.text, Record#link.html_encode),
Record#link.body
],
Expand Down Expand Up @@ -71,11 +71,11 @@ image(X) when ?WF_BLANK(X) ->
image(X) when is_tuple(X) ->
X;
image(X) ->
#image{image=X}.
#image{image=X, class=link_icon}.

icon(X) when ?WF_BLANK(X) ->
"";
icon(X) when is_tuple(X) ->
X;
icon(X) ->
#icon{icon=X}.
#icon{icon=X, class=link_icon}.

0 comments on commit d637490

Please sign in to comment.