5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 01: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,23 +561,27 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1);
// details styles // details styles
.details { .details {
summary { & > summary {
list-style: none; list-style: none;
cursor: default; cursor: pointer;
position: relative;
.hide-when-open {
display: inline;
} }
summary::after {
content: ''; .show-when-open {
font-size: 1.8rem; display: none;
position: absolute;
left: 97%;
bottom: 3%;
transform: rotate(180deg);
} }
}
&[open] { &[open] {
& > summary { & > summary {
&::after { .hide-when-open {
transform: rotate(90deg); 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 @param :id [String] El ID opcional sirve para mantener el historial de
cuál estaba abierto y recuperarlo al cargar la página cuál estaba abierto y recuperarlo al cargar la página
@param :summary [String] El resumen @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' } } %details.details.py-2{ id: local_assigns[:id], data: { controller: 'details', action: 'toggle->details#store' } }
%summary %summary.d-flex.flex-row.align-items-center.justify-content-between{ class: local_assigns[:summary_class] }
%h3.py-2.pr-2= summary %span= summary
%span.hide-when-open ▶
%span.show-when-open ▼
= yield = yield