btcpayserver/BTCPayServer/wwwroot/main/layout.css
2022-02-18 10:56:05 +09:00

625 lines
14 KiB
CSS

/* Breakpoints:
XS <576px
SM ≥576px
MD ≥768px
LG ≥992px
XL ≥1200px */
:root {
--mobile-header-height: 4rem;
--desktop-header-height: 8rem;
--sidebar-width: 280px;
}
/* Main Menu */
#mainMenu {
--button-width: 40px;
--button-height: 40px;
--button-padding: 7px;
--icon-size: 1.5rem;
height: var(--header-height);
z-index: 1031; /* needs a value between fixed and the offcanvas backdrop, see https://getbootstrap.com/docs/5.1/layout/z-index/ */
}
#mainMenuHead {
display: flex;
align-items: center;
justify-content: space-between;
}
#mainMenuHead .mainMenuButton {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
width: var(--button-width);
height: var(--button-height);
padding: var(--button-padding);
background: transparent;
border: none;
cursor: pointer;
outline: none;
color: var(--btcpay-body-text-muted);
}
#mainNav {
--btcpay-scrollbar-color: var(--btcpay-neutral-400);
height: calc(100vh - var(--mobile-header-height));
overflow-y: auto;
padding-top: var(--btcpay-space-m);
}
#mainNav .nav-item svg.icon {
width: var(--icon-size);
height: var(--icon-size);
margin-right: var(--btcpay-space-xs);
}
#mainNav .accordion-button {
padding: var(--btcpay-space-s) 0;
text-transform: uppercase;
color: var(--btcpay-body-text-muted);
font-weight: var(--btcpay-font-weight-semibold);
}
#mainNav .accordion-item {
border: none !important;
}
#mainNav .navbar-nav > li.nav-item .nav-link {
display: inline-flex;
align-items: center;
font-weight: var(--btcpay-font-weight-semibold);
color: var(--btcpay-header-link);
transition-property: color;
transition-duration: var(--btcpay-transition-duration-fast);
}
#mainNav .navbar-nav > li.nav-item .nav-link .icon {
flex-shrink: 0;
}
#mainNav .navbar-nav > li.nav-item .nav-link span {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#mainNav .navbar-nav > li.nav-item .nav-link:focus,
#mainNav .navbar-nav > li.nav-item .nav-link:hover {
color: var(--btcpay-header-link-accent);
}
#mainNav .navbar-nav > li.nav-item .nav-link.active,
#mainNav .navbar-nav > li.nav-item .nav-link.active:focus,
#mainNav .navbar-nav > li.nav-item .nav-link.active:hover {
color: var(--btcpay-header-link-active);
}
#mainNavSettings {
margin-top: auto;
}
.navbar-brand,
.navbar-brand:hover,
.navbar-brand:focus {
color: inherit;
}
.btcpay-header {
color: var(--btcpay-header-text);
background: var(--btcpay-header-bg);
}
#mainContent {
flex: 1;
display: flex;
flex-direction: column;
}
#mainContent > section {
flex: 1;
padding: var(--content-padding-top) var(--content-padding-horizontal) var(--content-padding-bottom);
}
#StoreSelector {
display: flex;
align-items: center;
z-index: 2000;
}
#StoreSelector hr {
height: 1px;
}
#StoreSelectorDropdown,
#StoreSelectorToggle {
width: 100%;
}
#StoreSelectorToggle {
display: flex;
align-items: center;
overflow: hidden;
text-overflow: ellipsis;
color: var(--btcpay-header-link);
}
#StoreSelectorToggle::after {
content: none;
}
#StoreSelectorToggle .icon {
width: 1.5rem;
height: 1.5rem;
transition: color 0.15s ease-in-out;
}
#StoreSelectorToggle .icon.icon-caret-down {
color: var(--btcpay-body-text-muted);
}
#StoreSelectorToggle span {
margin: 0 auto 0 var(--btcpay-space-s);
}
#StoreSelectorToggle:hover,
#StoreSelectorToggle:focus,
#StoreSelectorToggle:hover .icon,
#StoreSelectorToggle:focus .icon {
color: var(--btcpay-header-link-accent);
}
#StoreSelectorMenu {
min-width: 100%;
}
/* Logo */
@media (max-width: 575px) {
.logo {
width: 1.125rem;
height: 2rem;
}
.logo-large {
display: none;
}
}
@media (min-width: 576px) {
.logo {
width: 4.6rem;
height: 2rem;
}
.logo-small {
display: none;
}
}
/* Theme Switch */
#mainNav .btcpay-theme-switch {
width: 100%;
justify-content: space-between;
}
#mainNav .btcpay-theme-switch svg {
order: 1;
margin: 0 !important;
}
#mainNav .btcpay-theme-switch span {
order: 0;
margin: 0;
}
.btcpay-theme-switch {
display: inline-flex;
align-items: center;
background: none;
cursor: pointer;
border: 0;
}
.btcpay-theme-switch svg {
height: 1rem;
width: 1rem;
}
.btcpay-theme-switch svg ~ span {
margin-left: var(--btcpay-space-xs);
}
.btcpay-theme-switch path {
stroke-width: .5px;
fill: currentColor;
}
.btcpay-theme-switch:hover .btcpay-theme-switch-light,
.btcpay-theme-switch:hover .btcpay-theme-switch-dark {
fill: currentColor;
}
.btcpay-theme-switch-dark {
stroke: currentColor;
}
:root[data-btcpay-theme="dark"] .btcpay-theme-switch-dark {
display: none;
}
@media (prefers-color-scheme: dark) {
:root:not([data-btcpay-theme="dark"]) .btcpay-theme-switch-dark {
display: inline-block;
}
}
.btcpay-theme-switch-light {
display: none;
}
:root[data-btcpay-theme="dark"] .btcpay-theme-switch-light {
display: inline-block;
}
@media (prefers-color-scheme: dark) {
:root:not([data-btcpay-theme="light"]) .btcpay-theme-switch-light {
display: inline-block;
}
}
/* Notifications */
#Notifications {
flex: 0 0 var(--button-width);
}
#NotificationsBadge {
position: absolute;
top: 0;
right: 0;
min-width: 1.75em;
}
#NotificationsHandle svg {
width: 1.25rem;
height: 1.25rem;
color: var(--btcpay-header-link);
}
#NotificationsHandle:hover svg {
color: var(--btcpay-header-link-accent);
}
#NotificationsDropdown {
border: 0;
border-radius: 4px;
background: var(--btcpay-bg-tile);
box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
padding: 0;
z-index: 2000;
top: var(--btcpay-space-xs) !important;
}
/* Section Navigation / Subnav */
#SectionNav {
--border-size: 2px;
margin-bottom: var(--btcpay-space-l);
border-bottom: var(--border-size) solid var(--btcpay-body-border-light);
}
#SectionNav .nav {
margin-bottom: calc(var(--border-size) * -1);
}
#SectionNav .nav-link {
color: var(--btcpay-nav-link);
border-bottom: var(--border-size) solid transparent;
padding: var(--btcpay-space-m) 0;
font-weight: var(--btcpay-font-weight-semibold);
white-space: nowrap;
}
#SectionNav .nav-link:last-child {
margin-right: 0;
}
#SectionNav .nav-link:hover {
color: var(--btcpay-nav-link-accent);
}
#SectionNav .nav-link.active {
color: var(--btcpay-nav-link-active);
border-bottom-color: var(--btcpay-nav-border-active);
background: var(--btcpay-nav-bg-active);
}
/* Sticky Header: The <div class="sticky-header-setup"></div> needs to be included once
before the first sticky-header on the page. The sticky-header has a padding-top so
that it does not scroll underneath the fixed header on mobile. The sticky-header-setup
negates that padding with a negative margin, so that everything fits in the end. */
.sticky-header-setup {
margin-top: calc(var(--content-padding-top) * -1);
}
.sticky-header {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1020;
background: var(--btcpay-body-bg);
padding-top: var(--content-padding-top);
padding-bottom: var(--btcpay-space-l);
}
.sticky-header #SectionNav {
margin-bottom: calc(var(--btcpay-space-l) * -1);
}
/* Footer */
.btcpay-footer {
font-size: var(--btcpay-font-size-s);
overflow: hidden;
padding: .5em 0;
color: var(--btcpay-footer-text);
background: var(--btcpay-footer-bg);
}
.btcpay-footer a {
color: var(--btcpay-footer-link);
text-decoration: none;
}
.btcpay-footer a:focus,
.btcpay-footer a:hover {
color: var(--btcpay-footer-link-accent);
}
@media (max-width: 991px) {
:root {
--header-height: var(--mobile-header-height);
--content-padding-top: calc(var(--header-height) + var(--btcpay-space-m));
--content-padding-bottom: var(--btcpay-space-xl);
--content-padding-horizontal: var(--btcpay-space-m);
/* Prevent anchors from disappearing underneath the fixed header */
scroll-padding: var(--content-padding-top);
}
#mainMenu {
position: fixed;
top: 0;
left: 0;
right: 0;
}
#mainMenuHead {
padding: var(--btcpay-space-s) var(--btcpay-space-m);
}
#mainNav {
position: fixed;
top: var(--mobile-header-height);
bottom: 0;
left: 0;
width: var(--sidebar-width);
z-index: 1045;
color: var(--btcpay-body-text);
visibility: hidden;
background-color: inherit;
background-clip: padding-box;
outline: 0;
transform: translateX(-100%);
transition: transform var(--btcpay-transition-duration-fast) ease-in-out;
}
#mainNav.show {
transform: none;
}
.offcanvas-backdrop {
top: var(--mobile-header-height);
transition-duration: var(--btcpay-transition-duration-fast);
}
.offcanvas-backdrop.show {
opacity: 0.8;
}
#StoreSelector {
margin: 0 auto;
}
#StoreSelectorDropdown {
max-width: 40vw;
}
#Notifications {
margin-left: var(--btcpay-space-s);
}
#mainMenuToggle {
--line-thickness: 2px;
--transition-easing: ease-in-out;
--transition-duration: var(--btcpay-transition-duration-fast);
flex: 0 0 var(--button-width);
margin-right: calc(var(--button-padding) * -1);
margin-left: var(--btcpay-space-s);
}
#mainMenuToggle span {
position: relative;
display: inline-block;
width: calc(var(--button-width) - var(--button-padding) * 2);
height: calc(var(--button-height) - (var(--button-padding) * 2) - (var(--line-thickness) * 4));
border-top: var(--line-thickness) solid;
border-bottom: var(--line-thickness) solid;
color: var(--btcpay-body-text-muted);
font-size: 0;
transition: all var(--transition-duration) var(--transition-easing);
}
#mainMenuToggle span:before,
#mainMenuToggle span:after {
position: absolute;
display: block;
content: '';
width: 100%;
height: var(--line-thickness);
top: 50%;
left: 50%;
background: currentColor;
transform: translate(-50%, -50%);
transition: transform var(--transition-duration) var(--transition-easing);
}
#mainMenuToggle:hover span {
color: var(--btcpay-header-text);
}
#mainMenuToggle[aria-expanded="true"] span {
border-color: transparent;
}
#mainMenuToggle[aria-expanded="true"] span:before {
transform: translate(-50%, -50%) rotate(45deg);
}
#mainMenuToggle[aria-expanded="true"] span:after {
transform: translate(-50%, -50%) rotate(-45deg);
}
#mainContent {
z-index: 0;
}
#SectionNav {
--scroll-indicator-spacing: var(--btcpay-space-m);
position: relative;
}
#SectionNav .nav {
--btcpay-scrollbar-width: none;
--btcpay-scrollbar-color: transparent;
flex-wrap: nowrap;
overflow: auto visible;
-webkit-overflow-scrolling: touch;
margin-left: calc(var(--scroll-indicator-spacing) * -1);
margin-right: calc(var(--scroll-indicator-spacing) * -1);
padding: 0 var(--scroll-indicator-spacing);
}
#SectionNav .nav::-webkit-scrollbar {
display: none;
}
/* Horizontal scroll indicators */
#SectionNav:before,
#SectionNav:after {
content: '';
position: absolute;
top: 0;
bottom: calc(var(--border-size) * -1);
width: var(--btcpay-space-m);
}
#SectionNav:before {
background-image: linear-gradient(to right, var(--btcpay-body-bg), rgba(var(--btcpay-body-bg-rgb), 0));
left: calc(var(--scroll-indicator-spacing) * -1);
}
#SectionNav:after {
background-image: linear-gradient(to left, var(--btcpay-body-bg), rgba(var(--btcpay-body-bg-rgb), 0));
right: calc(var(--scroll-indicator-spacing) * -1);
}
#SectionNav .nav-link {
margin-right: 1.5rem;
border-bottom-color: var(--btcpay-body-border-light);
}
}
@media (min-width: 992px) {
:root {
--header-height: var(--desktop-header-height);
--content-padding-top: 5rem;
--content-padding-bottom: 5rem;
--content-padding-horizontal: var(--btcpay-space-xl);
}
#mainMenu {
position: fixed;
top: 0;
bottom: 0;
left: 0;
width: var(--sidebar-width);
height: 100vh;
border-right: 1px solid var(--btcpay-body-border-light);
}
#mainMenuHead {
flex-wrap: wrap;
padding: var(--btcpay-space-m) 1.5rem;
}
#mainNav {
visibility: visible !important;
}
#Notifications {
order: 1;
margin-left: auto;
}
#StoreSelector {
order: 2;
margin-top: var(--btcpay-space-m);
width: 100%;
}
#mainMenuToggle,
.offcanvas-backdrop {
display: none !important;
}
#NotificationsDropdown {
inset: calc(var(--button-height) * -1 - var(--btcpay-space-s)) auto auto calc(var(--button-width) + var(--btcpay-space-s)) !important;
width: 400px;
}
#mainContent {
margin-left: var(--sidebar-width);
}
#mainContent pre {
max-width: calc(100vw - var(--sidebar-width) - (2 * var(--btcpay-space-xl)) - 1rem); /* 1rem for scrollbar */
}
#mainContent > section,
.btcpay-footer > .container {
margin: 0;
max-width: none;
}
.btcpay-footer {
padding-left: var(--btcpay-space-xl);
padding-right: var(--btcpay-space-xl);
}
#SectionNav .nav {
margin-top: calc(var(--btcpay-space-m) * -1);
}
#SectionNav .nav {
border-bottom: var(--border-size) solid var(--btcpay-body-border-light);
}
#SectionNav .nav-link {
margin-top: var(--btcpay-space-s);
margin-right: var(--btcpay-space-l);
margin-bottom: calc(var(--border-size) * -1);
}
}