mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 20:36:21 +00:00
feat: poder cambiar el nivel de summary
This commit is contained in:
parent
01c042b512
commit
6110172324
2 changed files with 26 additions and 17 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue