mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-10 07:55:21 +02:00
Fix shadows and borders in dark mode
This commit is contained in:
parent
101950172f
commit
ffbd697543
6 changed files with 23 additions and 27 deletions
|
@ -250,11 +250,11 @@
|
||||||
--color-destructive: var(--color-red-400);
|
--color-destructive: var(--color-red-400);
|
||||||
--color-shadow: --alpha(#000000 / 8%);
|
--color-shadow: --alpha(#000000 / 8%);
|
||||||
|
|
||||||
--shadow-xs: 0px 1px 2px 0px --alpha(var(--color-white) / 6%);
|
--shadow-xs: 0px 1px 2px 0px --alpha(var(--color-white) / 8%);
|
||||||
--shadow-sm: 0px 1px 6px 0px --alpha(var(--color-white) / 6%);
|
--shadow-sm: 0px 1px 6px 0px --alpha(var(--color-white) / 8%);
|
||||||
--shadow-md: 0px 4px 8px -2px --alpha(var(--color-white) / 6%);
|
--shadow-md: 0px 4px 8px -2px --alpha(var(--color-white) / 8%);
|
||||||
--shadow-lg: 0px 12px 16px -4px --alpha(var(--color-white) / 6%);
|
--shadow-lg: 0px 12px 16px -4px --alpha(var(--color-white) / 8%);
|
||||||
--shadow-xl: 0px 20px 24px -4px --alpha(var(--color-white) / 6%);
|
--shadow-xl: 0px 20px 24px -4px --alpha(var(--color-white) / 8%);
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
@apply bg-gray-100;
|
@apply bg-gray-100;
|
||||||
|
|
||||||
@variant theme-dark {
|
@variant theme-dark {
|
||||||
@apply bg-gray-800;
|
@apply bg-gray-900;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class FilledIconComponent < ViewComponent::Base
|
class FilledIconComponent < ViewComponent::Base
|
||||||
attr_reader :icon, :text, :hex_color, :size, :rounded, :variant
|
attr_reader :icon, :text, :hex_color, :size, :rounded, :variant
|
||||||
|
|
||||||
VARIANTS = %i[default text surface].freeze
|
VARIANTS = %i[default text surface container].freeze
|
||||||
|
|
||||||
SIZES = {
|
SIZES = {
|
||||||
sm: {
|
sm: {
|
||||||
|
@ -38,7 +38,7 @@ class FilledIconComponent < ViewComponent::Base
|
||||||
"flex justify-center items-center",
|
"flex justify-center items-center",
|
||||||
size_classes,
|
size_classes,
|
||||||
radius_classes,
|
radius_classes,
|
||||||
variant == :surface ? "bg-surface-inset fg-gray" : "border"
|
transparent? ? "border" : solid_bg_class
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -62,6 +62,19 @@ class FilledIconComponent < ViewComponent::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
def solid_bg_class
|
||||||
|
case variant
|
||||||
|
when :surface
|
||||||
|
"bg-surface-inset"
|
||||||
|
when :container
|
||||||
|
"bg-container-inset"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def transparent?
|
||||||
|
variant.in?(%i[default text])
|
||||||
|
end
|
||||||
|
|
||||||
def size_classes
|
def size_classes
|
||||||
SIZES[size][:container_size]
|
SIZES[size][:container_size]
|
||||||
end
|
end
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="py-10 flex flex-col items-center">
|
<div class="py-10 flex flex-col items-center">
|
||||||
<%= render FilledIconComponent.new(
|
<%= render FilledIconComponent.new(
|
||||||
variant: :surface,
|
variant: :container,
|
||||||
icon: classification_group.icon,
|
icon: classification_group.icon,
|
||||||
) %>
|
) %>
|
||||||
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
<div class="flex justify-center items-center h-[800px]">
|
|
||||||
<div class="text-center flex flex-col gap-4 items-center max-w-[300px]">
|
|
||||||
<%= icon "layers", size: "lg" %>
|
|
||||||
|
|
||||||
<div class="space-y-1 text-sm">
|
|
||||||
<p class="text-primary font-medium"><%= t(".no_account_title") %></p>
|
|
||||||
<p class="text-secondary"><%= t(".no_account_subtitle") %></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= render LinkComponent.new(
|
|
||||||
text: t(".new_account"),
|
|
||||||
href: new_account_path,
|
|
||||||
icon: "plus",
|
|
||||||
frame: :modal
|
|
||||||
) %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="h-[300px] lg:h-[340px] bg-container shadow-border-xs rounded-xl py-4 flex flex-col items-center justify-center">
|
<div class="h-[300px] lg:h-[340px] bg-container shadow-border-xs rounded-xl py-4 flex flex-col items-center justify-center">
|
||||||
<div class="space-y-3 text-center flex flex-col items-center">
|
<div class="space-y-3 text-center flex flex-col items-center">
|
||||||
<%= render FilledIconComponent.new(
|
<%= render FilledIconComponent.new(
|
||||||
variant: :surface,
|
variant: :container,
|
||||||
icon: "layers",
|
icon: "layers",
|
||||||
) %>
|
) %>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue