[frontend/components] Add danger style to menu element
This commit is contained in:
parent
dcc6fd3a19
commit
100908c1ee
3 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
@using Iceshrimp.Assets.PhosphorIcons
|
@using Iceshrimp.Assets.PhosphorIcons
|
||||||
<div @onclick="OnClick" class="menu-element">
|
<div @onclick="OnClick" class="menu-element @(Danger ? "danger" : "")">
|
||||||
@if (Icon != null)
|
@if (Icon != null)
|
||||||
{
|
{
|
||||||
<Icon Name="Icon"></Icon>
|
<Icon Name="Icon"></Icon>
|
||||||
|
@ -11,6 +11,7 @@
|
||||||
[Parameter] public IconName? Icon { get; set; }
|
[Parameter] public IconName? Icon { get; set; }
|
||||||
[Parameter] [EditorRequired] public required RenderFragment Text { get; set; }
|
[Parameter] [EditorRequired] public required RenderFragment Text { get; set; }
|
||||||
[Parameter] [EditorRequired] public required EventCallback OnSelect { get; set; }
|
[Parameter] [EditorRequired] public required EventCallback OnSelect { get; set; }
|
||||||
|
[Parameter] public bool Danger { get; set; }
|
||||||
|
|
||||||
private async Task OnClick()
|
private async Task OnClick()
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,15 @@
|
||||||
background-color: var(--hover-color);
|
background-color: var(--hover-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu-element.danger {
|
||||||
|
color: var(--danger-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-element.danger:hover {
|
||||||
|
background-color: var(--danger-color);
|
||||||
|
color: var(--foreground-color);
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 1000px) {
|
@media (max-width: 1000px) {
|
||||||
.menu-element + .menu-element {
|
.menu-element + .menu-element {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
--accent-color: linear-gradient(to right, var(--accent-primary-color), var(--accent-secondary-color));
|
--accent-color: linear-gradient(to right, var(--accent-primary-color), var(--accent-secondary-color));
|
||||||
--notice-color: #92c1ff;
|
--notice-color: #92c1ff;
|
||||||
--warning-color: #ffdf91;
|
--warning-color: #ffdf91;
|
||||||
|
--danger-color: #ff9191;
|
||||||
--font-color: #e7edff;
|
--font-color: #e7edff;
|
||||||
--link: #9E9EFF;
|
--link: #9E9EFF;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue