5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 15:16:21 +00:00

feat: poder cambiar el nivel de summary

This commit is contained in:
f 2024-03-04 13:12:22 -03:00
parent 01c042b512
commit 6110172324
No known key found for this signature in database
2 changed files with 26 additions and 17 deletions

View file

@ -561,24 +561,28 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1);
// details styles
.details {
summary {
& > summary {
list-style: none;
cursor: default;
position: relative;
cursor: pointer;
.hide-when-open {
display: inline;
}
.show-when-open {
display: none;
}
}
summary::after {
content: '';
font-size: 1.8rem;
position: absolute;
left: 97%;
bottom: 3%;
transform: rotate(180deg);
}
&[open] {
& > summary {
&::after {
transform: rotate(90deg);
}
.hide-when-open {
display: none;
}
.show-when-open {
display: inline;
}
}
}
}
}

View file

@ -4,8 +4,13 @@
@param :id [String] El ID opcional sirve para mantener el historial de
cuál estaba abierto y recuperarlo al cargar la página
@param :summary [String] El resumen
@param :summary_class [String] Clases para el summary
- local_assigns[:summary_class] ||= 'h3'
%details.details.py-2{ id: local_assigns[:id], data: { controller: 'details', action: 'toggle->details#store' } }
%summary
%h3.py-2.pr-2= summary
%summary.d-flex.flex-row.align-items-center.justify-content-between{ class: local_assigns[:summary_class] }
%span= summary
%span.hide-when-open ▶
%span.show-when-open ▼
= yield