portails/assets/scss/components/_details.scss

78 lines
1.3 KiB
SCSS
Raw Normal View History

2022-02-09 20:05:13 +01:00
details {
display: block;
2022-02-10 14:12:24 +01:00
border: 1px solid $gray-200;
border-radius: 0.25rem;
2022-02-10 10:14:36 +01:00
padding: 0.5rem 1rem 0;
2022-02-09 20:05:13 +01:00
margin: 0.5rem 0;
}
2022-02-10 10:14:36 +01:00
/*
details summary {
2022-02-09 20:05:13 +01:00
&::marker {
content: "";
}
}
2022-02-10 10:14:36 +01:00
*/
2022-02-09 20:05:13 +01:00
2022-02-10 10:14:36 +01:00
summary {
list-style: none;
2022-04-01 08:59:05 +02:00
display: inline-block;
2022-02-10 10:14:36 +01:00
width: calc(100% + 2rem);
margin: -0.5rem -1rem 0;
padding: 0.5rem 0.75rem;
2022-02-09 20:05:13 +01:00
}
2022-02-10 10:14:36 +01:00
summary::-webkit-details-marker {
display: none;
2022-02-09 20:05:13 +01:00
}
2022-02-10 10:14:36 +01:00
summary:hover {
background: $gray-100;
2022-02-09 20:05:13 +01:00
}
details summary::before {
display: inline-block;
content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%2829, 45, 53, 0.75%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
transition: transform 0.35s ease;
transform-origin: center center;
2022-02-10 10:14:36 +01:00
margin-right: 0.375rem;
2022-02-09 20:05:13 +01:00
}
details[open] > summary::before {
transform: rotate(90deg);
}
2022-02-10 10:14:36 +01:00
/*
2022-02-09 20:05:13 +01:00
details summary > * {
2022-02-10 10:14:36 +01:00
display: inline-block;
2022-02-09 20:05:13 +01:00
}
2022-02-10 10:14:36 +01:00
*/
2022-02-09 20:05:13 +01:00
details[open] {
2022-02-10 10:14:36 +01:00
padding: 0.5rem 1rem;
2022-02-09 20:05:13 +01:00
}
details[open] > summary {
border-bottom: 1px solid $gray-300;
margin-bottom: 0.5rem;
}
details h2,
details h3,
details h4 {
2022-02-10 10:14:36 +01:00
margin: 1rem 0 0.5rem;
2022-02-09 20:05:13 +01:00
}
details p:last-child {
margin-bottom: 0;
}
details ul,
details ol {
margin-bottom: 0;
}
details pre {
margin: 0 0 1rem;
}