tab-stash/styles/modal.less

204 lines
4.3 KiB
Plaintext

// The modal backdrop used for dialogs
.modal-backdrop {
background-color: var(--modal-bg);
& > * {
max-width: 100%;
max-height: 100%;
// Needed so padding is taken into account when sizing child elements
box-sizing: border-box;
}
}
.dialog-enter-active {
transition: all var(--modal-fade-time) ease-out;
}
.dialog-leave-active {
transition: all var(--modal-fade-time) ease-in;
}
.dialog-enter-from,
.dialog-leave-to {
opacity: 0;
}
// Dialogs themselves
.dialog {
background-color: var(--group-bg);
// border: var(--group-border);
border-radius: var(--group-border-radius);
box-shadow: var(--shadow);
overflow: hidden;
display: flex;
flex-direction: column;
& > .dialog-title {
flex: none;
padding: var(--dialog-ph) var(--dialog-pw);
border-bottom: var(--group-border);
display: grid;
grid-template-columns: 1fr 0fr;
align-items: center;
font-weight: var(--group-header-font-weight);
font-size: var(--group-header-font-size);
& > .dialog-close {
grid-row: 1;
grid-column: 2;
.action();
background-image: var(--icon-cancel);
}
}
& > .dialog-content {
flex: 1 1 auto;
padding: var(--dialog-ph) var(--dialog-pw);
display: grid;
overflow: auto;
& > section {
margin: var(--ctrl-mh) 0;
}
}
& > .dialog-buttons {
flex: none;
padding: var(--dialog-ph) var(--dialog-pw);
border-top: var(--group-border);
display: flex;
flex-direction: row;
justify-content: end;
& > * {
flex: 1 1;
}
}
* {
row-gap: var(--ctrl-mh);
column-gap: var(--ctrl-mw);
}
}
// Pop-up menus (which may or may not use the modal backdrop)
details.menu {
// The button to open the menu (the details's <summary>)
& > summary {
list-style: none; // no triangle on Firefox
&::-webkit-details-marker {
display: none;
} // no triangle on Chrome
}
&[open] > summary.action {
// They should also be colorized to show the menu is open.
background-color: var(--button-hover-bg);
}
}
// The bounding box holding the menu. We add padding here so the menu never
// outgrows the viewport. (The padding on some dimensions will be overridden by
// the Vue menu component to position the menu properly.)
.menu-modal {
padding: var(--menu-mh) var(--menu-mw);
}
// The pop-up menu itself, showing a list of items
nav.menu {
padding: var(--menu-mh) 0;
background-color: var(--group-bg);
box-shadow: var(--shadow);
border: var(--group-border);
border-radius: var(--ctrl-border-radius);
display: flex;
flex-direction: column;
overflow: auto;
& > input,
& > .search-input {
margin: var(--ctrl-mh) var(--ctrl-mw);
}
& :not(.search-input) > input,
& .search-input {
border: var(--ctrl-border);
}
& a,
& button,
& .menu-item {
cursor: default;
// The 16px is for scroll bars, should they appear...
padding: 0 max(var(--menu-mw), 16px) 0 var(--menu-mw);
display: flex;
align-items: center;
gap: var(--ctrl-mw);
min-height: var(--item-h);
border: none;
border-radius: 0;
text-decoration: none;
background: inherit;
& .menu-icon {
flex: 0 0 auto;
// Override padding from .item-icon
padding-left: 0;
padding-right: 0;
width: var(--icon-size);
}
& span:not(.menu-icon) {
flex: 1 1 auto;
text-align: left;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
// Needed because the above background change overrides the global
// .selected rules.
&.selected {
background-color: var(--selected-bg);
}
&:not(.disabled) {
color: var(--page-fg);
&:hover,
&:focus-within {
background-color: var(--item-hover-bg);
box-shadow: none;
}
&:active {
background-color: var(--item-active-bg);
}
}
}
& > hr {
margin: var(--menu-mh) 0;
padding: 0;
border: none;
border-top: var(--divider-border);
}
& ul {
padding-left: var(--menu-mw);
}
& li {
list-style: none;
display: flex;
flex-direction: column;
}
& .menu-scrollable-list {
overflow-x: hidden;
overflow-y: auto;
display: flex;
flex-direction: column;
padding-left: 0;
padding-right: 0;
margin: 0;
}
}