Skip to content

Commit e2cfa8e

Browse files
committed
remove some icons and improve the scheme switcher
1 parent 5f24251 commit e2cfa8e

File tree

13 files changed

+117
-48
lines changed

13 files changed

+117
-48
lines changed

app/assets/stylesheets/css/components/color_scheme_switcher.css

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
/* Inactive by default, active when theme-slate variant is present */
2222
@apply bg-transparent text-neutral-600 dark:text-neutral-400 shadow-none;
2323
@apply theme-slate:bg-white theme-slate:dark:bg-neutral-700 theme-slate:text-primary-600 theme-slate:dark:text-primary-400 theme-slate:shadow-sm;
24+
@apply gap-1.5;
2425
}
2526

2627
.color-scheme-switcher__button[data-theme="stone"] {
2728
/* Inactive by default, active when theme-stone variant is present */
2829
@apply bg-transparent text-neutral-600 dark:text-neutral-400 shadow-none;
2930
@apply theme-stone:bg-white theme-stone:dark:bg-neutral-700 theme-stone:text-primary-600 theme-stone:dark:text-primary-400 theme-stone:shadow-sm;
31+
@apply gap-1.5;
3032
}
3133

3234
/* Scheme buttons - active states using scheme selection classes */
@@ -102,3 +104,89 @@
102104
@apply bg-neutral-400 dark:bg-neutral-500;
103105
background-image: linear-gradient(135deg, transparent 45%, white 45%, white 55%, transparent 55%);
104106
}
107+
108+
/* Accent button with badge */
109+
.color-scheme-switcher__button--accent {
110+
@apply relative;
111+
}
112+
113+
.color-scheme-switcher__accent-badge {
114+
@apply absolute top-0 end-0;
115+
@apply translate-x-1/2 -translate-y-1/2;
116+
@apply hidden;
117+
}
118+
119+
.color-scheme-switcher__accent-badge-preview {
120+
@apply size-2 rounded-full border border-white dark:border-neutral-800 shadow-sm;
121+
@apply hidden;
122+
}
123+
124+
.color-scheme-switcher__accent-badge-preview--neutral {
125+
@apply bg-neutral-400 dark:bg-neutral-500;
126+
background-image: linear-gradient(135deg, transparent 45%, white 45%, white 55%, transparent 55%);
127+
}
128+
129+
/* Show accent badge based on body accent class */
130+
.accent-orange .color-scheme-switcher__accent-badge {
131+
@apply inline-block;
132+
}
133+
134+
.accent-orange .color-scheme-switcher__accent-badge-preview--orange {
135+
@apply inline-block;
136+
}
137+
138+
.accent-yellow .color-scheme-switcher__accent-badge {
139+
@apply inline-block;
140+
}
141+
142+
.accent-yellow .color-scheme-switcher__accent-badge-preview--yellow {
143+
@apply inline-block;
144+
}
145+
146+
.accent-green .color-scheme-switcher__accent-badge {
147+
@apply inline-block;
148+
}
149+
150+
.accent-green .color-scheme-switcher__accent-badge-preview--green {
151+
@apply inline-block;
152+
}
153+
154+
.accent-blue .color-scheme-switcher__accent-badge {
155+
@apply inline-block;
156+
}
157+
158+
.accent-blue .color-scheme-switcher__accent-badge-preview--blue {
159+
@apply inline-block;
160+
}
161+
162+
.accent-purple .color-scheme-switcher__accent-badge {
163+
@apply inline-block;
164+
}
165+
166+
.accent-purple .color-scheme-switcher__accent-badge-preview--purple {
167+
@apply inline-block;
168+
}
169+
170+
.accent-pink .color-scheme-switcher__accent-badge {
171+
@apply inline-block;
172+
}
173+
174+
.accent-pink .color-scheme-switcher__accent-badge-preview--pink {
175+
@apply inline-block;
176+
}
177+
178+
.accent-red .color-scheme-switcher__accent-badge {
179+
@apply inline-block;
180+
}
181+
182+
.accent-red .color-scheme-switcher__accent-badge-preview--red {
183+
@apply inline-block;
184+
}
185+
186+
.accent-teal .color-scheme-switcher__accent-badge {
187+
@apply inline-block;
188+
}
189+
190+
.accent-teal .color-scheme-switcher__accent-badge-preview--teal {
191+
@apply inline-block;
192+
}

app/assets/svgs/avo/detach.svg

Lines changed: 0 additions & 8 deletions
This file was deleted.

app/assets/svgs/avo/edit.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/assets/svgs/avo/eye.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/assets/svgs/avo/trash-sm.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

app/assets/svgs/avo/trash.svg

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/components/avo/fields/common/files/controls_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div>
1414
<% if can_delete_file? %>
1515
<%= a_link destroy_path,
16-
icon: "avo/trash",
16+
icon: "tabler/outline/trash",
1717
color: :red,
1818
size: :sm,
1919
class: 'text-center',

app/components/avo/fields/password_field/edit_component.html.erb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313

1414
<% if @field.revealable %>
1515
<button data-action="password-visibility#toggle" type="button" class="text-gray-500 absolute inset-y-0 end-0 pe-3 flex items-center cursor-pointer">
16-
<!-- Heroicon name: outline/eye -->
17-
<%= helpers.svg('heroicons/outline/eye', class: "size-6", data: { 'password-visibility-target': 'icon' }) %>
18-
19-
<!-- Heroicon name: outline/eye-off -->
20-
<%= helpers.svg('heroicons/outline/eye-off', class: "size-6 hidden", data: { 'password-visibility-target': 'icon' }) %>
16+
<%= helpers.svg('tabler/outline/eye', class: "size-6", data: { 'password-visibility-target': 'icon' }) %>
17+
<%= helpers.svg('tabler/outline/eye-off', class: "size-6 hidden", data: { 'password-visibility-target': 'icon' }) %>
2118
</button>
2219
<% end %>
2320
</div>

app/components/avo/fields/tiptap_field/edit_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<%= helpers.svg("heroicons/outline/check-circle") %>
5959
<% end %>
6060
<%= button_tag type: "button", class: "tiptap__button tiptap__link-button--unset", data: { action: "click->tiptap-field#unsetLink" } do %>
61-
<%= helpers.svg("avo/trash") %>
61+
<%= helpers.svg("tabler/outline/trash") %>
6262
<% end %>
6363
<% end %>
6464
<% end %>

app/components/avo/index/resource_controls_component.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ def referrer_path
7474
def render_edit_button(control)
7575
return unless can_edit?
7676

77-
link_to helpers.svg("avo/edit", class: svg_classes),
77+
link_to helpers.svg("tabler/outline/edit", class: svg_classes),
7878
edit_path,
79+
style: :text,
7980
class: "flex items-center",
8081
title: control.title,
8182
aria: {label: control.title},
@@ -90,8 +91,9 @@ def render_edit_button(control)
9091
def render_show_button(control)
9192
return unless can_view?
9293

93-
link_to helpers.svg("avo/eye", class: svg_classes),
94+
link_to helpers.svg("tabler/outline/eye", class: svg_classes),
9495
show_path,
96+
style: :text,
9597
class: "flex items-center",
9698
title: control.title,
9799
aria: {label: control.title},
@@ -110,10 +112,8 @@ def render_delete_button(control)
110112
policy_method = is_a_related_resource? ? :can_delete? : :can_see_the_destroy_button?
111113
return unless send policy_method
112114

113-
a_button url: helpers.resource_path(record: @resource.record, resource: @resource),
114-
style: :icon,
115-
color: :gray,
116-
icon: "avo/trash",
115+
button_to helpers.resource_path(record: @resource.record, resource: @resource),
116+
style: :text,
117117
form_class: "flex flex-col sm:flex-row sm:inline-flex",
118118
title: control.title,
119119
aria: {label: control.title},
@@ -127,16 +127,16 @@ def render_delete_button(control)
127127
control: :destroy,
128128
tippy: control.title ? :tooltip : nil,
129129
"resource-id": @resource.record_param,
130-
}
130+
} do
131+
svg "tabler/outline/trash", class: svg_classes
132+
end
131133
end
132134

133135
def render_detach_button(control)
134136
return unless can_detach?
135137

136-
a_button url: helpers.resource_detach_path(params[:resource_name], params[:id], params[:related_name], @resource.record_param),
137-
style: :icon,
138-
color: :gray,
139-
icon: "avo/detach",
138+
button_to helpers.resource_detach_path(params[:resource_name], params[:id], params[:related_name], @resource.record_param),
139+
style: :text,
140140
form_class: "flex items-center",
141141
title: control.title,
142142
aria: {label: control.title},
@@ -149,7 +149,9 @@ def render_detach_button(control)
149149
control: :detach,
150150
"resource-id": @resource.record_param,
151151
tippy: :tooltip,
152-
}
152+
} do
153+
svg "tabler/outline/unlink", class: svg_classes
154+
end
153155
end
154156

155157
def render_order_controls(control)

0 commit comments

Comments
 (0)