@digitallinguistics/design
Version:
The design system for Digital Linguistics (DLx) projects.
132 lines (95 loc) • 2.27 kB
text/less
@import (reference) 'utilities.less';
.notes {
border : var(--border);
border-radius: var(--border-radius);
position : relative;
.label-text {
.visually-hidden;
}
&__notes-container {
inline-size: 100%;
}
&__notes-container:empty {
border : none;
display: none;
}
.notes-toggle {
cursor : pointer;
inset-block-start : 0;
inset-inline-start: 0;
margin : var(--space-xs);
position : absolute;
}
// open
#notes-toggle-checkbox:checked + label .chevron-right {
display: none;
}
// closed
#notes-toggle-checkbox:not(:checked) + label .chevron-down {
display: none;
}
// open
#notes-toggle-checkbox:checked ~ &__notes-container {
background-color : var(--teal-1);
border-block-start: var(--border);
box-shadow : inset var(--box-shadow);
&:empty {
border: none;
}
.note-button {
display: none;
}
.note-item {
margin-block-end: var(--space);
margin-inline : var(--space);
}
.note-item:first-of-type {
margin-block-start: var(--space);
}
}
// closed
#notes-toggle-checkbox:not(:checked) ~ &__notes-container {
flex-flow: row wrap;
position : relative;
.note {
display: none;
}
.note-button {
cursor : pointer;
display : flex;
border-radius: var(--border-radius);
padding : var(--space-xxs);
@media (prefers-color-scheme: dark) {
color : var(--text-color-dark);
}
}
.note-item {
margin: var(--space-xxs);
&:focus-within,
&:hover {
.note {
display : block;
inline-size: 90%;
position : absolute;
}
.note-button {
background-color: var(--teal-1);
outline : black solid var(--focus-width);
@media (prefers-color-scheme: dark) {
color: var(--background-color-dark);
}
}
}
}
}
svg {
--icon-size: 1em;
block-size : var(--icon-size);
inline-size: var(--icon-size);
}
&__title {
font-weight: bold;
padding : var(--text-padding);
text-align : center;
}
}