ui.link hover style like the one found in ui.expansion #3131
-
QuestionHello, I would like to know how can I replicate the hover style of the "ui.expansion" for a "ui.link".
One problem is that every time I click on any of my def side_panel():
link_classes = "hover:bg-gray-400 w-full transition ease-in duration-300"
item_label_classes = "text-xs"
replace_text = 'text-gray-300'
with ui.left_drawer(top_corner=True, bottom_corner=True).style('background-color: #262626').props('width=250'):
ui.label('Menú de Navegación').tailwind(replace_text)
with ui.expansion('Empleados', icon='people').classes('w-full !no-underline').style('color: rgb(209 213 219);').tailwind(item_label_classes).element:
with ui.link(target='#').classes(link_classes, replace=replace_text):
with ui.item():
with ui.item_section().props('avatar'):
ui.icon('person_add')
with ui.item_section():
ui.label('Registro de Empleados').tailwind(item_label_classes)
with ui.link(target='#').classes(link_classes, replace=replace_text):
with ui.item():
with ui.item_section().props('avatar'):
ui.icon('groups')
with ui.item_section():
ui.label('Gestión de Asistencia').tailwind(item_label_classes) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @miccs0, I wonder if you really need the Or you stick with |
Beta Was this translation helpful? Give feedback.
Hi @miccs0,
I wonder if you really need the
ui.link
. As an alternative you could simply use aui.expansion
element with.props('hide-expand-icon')
and an.on('click', ...)
handler. This way you can simply use the same styling for all elements.Or you stick with
ui.link
and set.props(remove='href')
to prevent the page from reloading (see #3129).