-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update notification dropdown styling #2167
Changes from 9 commits
00ae1c7
a3c482f
22ab33e
ad90103
acbd800
2e5b1b4
53fa520
090c9fc
e6a3f1e
749efd2
ebdd42e
4d143d3
5b04ccc
bcce5e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@model BTCPayServer.Components.Icon.IconViewModel | ||
|
||
<svg role="img" class="icon icon-@Model.Symbol"> | ||
<use href="/img/icon-sprite.svg#@Model.Symbol"></use> | ||
</svg> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace BTCPayServer.Components.Icon | ||
{ | ||
public class Icon : ViewComponent | ||
{ | ||
public IViewComponentResult Invoke(string symbol) | ||
{ | ||
var vm = new IconViewModel | ||
{ | ||
Symbol = symbol | ||
}; | ||
return View(vm); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace BTCPayServer.Components.Icon | ||
{ | ||
public class IconViewModel | ||
{ | ||
public string Symbol { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6685,6 +6685,9 @@ button.bg-dark:focus { | |
.font-weight-normal { | ||
font-weight: 400 !important; } | ||
|
||
.font-weight-semibold { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this here because the mock-up specified semibold weights but we didn't have a utility class for it like we have for other font weights. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted as a thing to add/update with our Bootstrap 5 migration (#1866). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, thanks! |
||
font-weight: 600 !important; } | ||
|
||
.font-weight-bold { | ||
font-weight: 700 !important; } | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to add the inline styles for width and height to make sure the icon appears in the right size since the sprite itself has height and width of zero. I wonder if there should be a built-in way to allow specifying the width and height and fill color? Something like
<vc:icon symbol="note" width="16px" height="16px" color="#8D8D8F" />
. Or is this not desirable?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some icon default styles.
Can we get around using a fixed color here? Because it'll most likely interfere with the different themes. If that color isn't present in the current set of variables, let's use the closest one for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dennisreimann ok, thanks for pointing out the default styles. I will add those in. I initially had the color fixed but changed it to not be fixed as other icons in your PR didn't have them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dennisreimann alright, added default styles here which solves the issue nicely. I did notice something weird though. When I updated the color in the
icon-sprite.svg
my app was refusing to show the new color even after I restarted BTCPay. I had to rundotnet clean
and then build from fresh for the change to be reflected. Looked like the SVG was cached and was not updating.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the color we should stick to using currentColor in the SVG as this allows to set it via CSS. We will need this to work with the different themes.
I also came across caching issues, which I brought up in this comment. I'll try to find a workaround, because this will likely take some time to get fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dennisreimann alright, updated here: ebdd42e.
I noticed that the cache seems to be cleared if you modify the
Default.cshtml
underComponents/Icon
.