// A small set of utility classes, modeled after TailwindCSS and Bootstrap. // // https://tailwindcss.com/docs // https://getbootstrap.com/docs/5.0/utilities/spacing/ $spacer: 0.25rem; /* 4px */ .invisible { visibility: hidden; } .visible { visibility: visible; } .font-arial { font-family: var(--arial-font); } .font-monospace { font: var(--monospace-font); } .font-header { font-family: var(--header-font); } .font-bold { font-weight: bold; } .cursor-pointer { cursor: pointer; } .cursor-zoom-in { cursor: zoom-in; } .cursor-zoom-out { cursor: zoom-out; } .cursor-wait { cursor: wait; } .hidden { display: none !important; } .inline-block { display: inline-block; } .block { display: block; } .flex { display: flex; } .grid { display: grid; } .text-left { text-align: left; } .text-center { text-align: center; } .text-right { text-align: right; } .text-muted { color: var(--muted-text-color); } .text-xxs { font-size: var(--text-xxs); } .text-xs { font-size: var(--text-xs); } .text-sm { font-size: var(--text-sm); } .text-lg { font-size: var(--text-lg); } .text-xl { font-size: var(--text-xl); } .text-xxl { font-size: var(--text-xxl); } .underline { text-decoration-line: underline; } .decoration-dotted { text-decoration-style: dotted; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .overflow-auto { overflow: auto; } .break-all { word-break: break-all; } .whitespace-nowrap { white-space: nowrap; } .pointer-events-none { pointer-events: none; } .select-none { user-select: none; } .opacity-50 { opacity: 0.5; } .leading-none { line-height: 1; } .leading-normal { line-height: 1.5; } .absolute { position: absolute; } .relative { position: relative; } .sticky { position: sticky; } .top-0\.5 { top: 0.5 * $spacer; } .bottom-0\.5 { bottom: 0.5 * $spacer; } .left-0\.5 { left: 0.5 * $spacer; } .right-0\.5 { right: 0.5 * $spacer; } .inset-0 { top: 0; right: 0; bottom: 0; left: 0 } .border, %border { border-width: 1px; } .border-b { border-bottom-width: 1px; } .border-b-2 { border-bottom-width: 0.5 * $spacer; } .border-current { border-color: currentColor; } .rounded-sm, %rounded-sm { border-radius: 0.5 * $spacer; } .rounded, %rounded { border-radius: 1 * $spacer; } .rounded-lg, %rounded-lg { border-radius: 2 * $spacer; } .rounded-t-sm, %rounded-t-sm { border-top-left-radius: 0.5 * $spacer; border-top-right-radius: 0.5 * $spacer; } .rounded-t, %rounded-t { border-top-left-radius: 1 * $spacer; border-top-right-radius: 1 * $spacer; } .rounded-t-lg, %rounded-t-lg { border-top-left-radius: 2 * $spacer; border-top-right-radius: 2 * $spacer; } .shadow-md, %shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); } .shadow-lg, %shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); } .object-contain { object-fit: contain; } .m-auto { margin: auto; } .m-0 { margin: 0; } .m-px { margin: 1px; } .m-0\.5 { margin: 0.5 * $spacer; } .mx-auto { margin-left: auto; margin-right: auto; } .mx-0\.5 { margin-left: 0.5 * $spacer; margin-right: 0.5 * $spacer; } .mx-2 { margin-left: 2 * $spacer; margin-right: 2 * $spacer; } .mt-1 { margin-top: 1 * $spacer; } .mt-2 { margin-top: 2 * $spacer; } .mt-4 { margin-top: 4 * $spacer; } .mt-8 { margin-top: 8 * $spacer; } .mb-2 { margin-bottom: 2 * $spacer; } .mb-4 { margin-bottom: 4 * $spacer; } .mb-8 { margin-bottom: 8 * $spacer; } .-mb-px { margin-bottom: -1px; } .ml-4 { margin-left: 4 * $spacer; } .p-0 { padding: 0; } .p-px { padding: 1px; } .p-0\.5 { padding: 0.5 * $spacer; } .p-1 { padding: 1 * $spacer; } .p-4 { padding: 4 * $spacer; } .px-1 { padding-left: 1 * $spacer; padding-right: 1 * $spacer; } .px-2 { padding-left: 2 * $spacer; padding-right: 2 * $spacer; } .px-4 { padding-left: 4 * $spacer; padding-right: 4 * $spacer; } .px-8 { padding-left: 8 * $spacer; padding-right: 8 * $spacer; } .py-1 { padding-top: 1 * $spacer; padding-bottom: 1 * $spacer; } .py-2 { padding-top: 2 * $spacer; padding-bottom: 2 * $spacer; } .py-4 { padding-top: 4 * $spacer; padding-bottom: 4 * $spacer; } .py-8 { padding-top: 8 * $spacer; padding-bottom: 8 * $spacer; } .pt-4 { padding-top: 4 * $spacer; } .pt-8 { padding-top: 8 * $spacer; } .pb-2 { padding-bottom: 2 * $spacer; } .pr-2 { padding-right: 2 * $spacer; } .pr-4 { padding-right: 4 * $spacer; } .w-auto { width: auto; } .w-min { width: min-content; } .w-max { width: max-content; } .w-sm { width: 24rem; } .w-md { width: 28rem; } .w-1\/4 { width: 25%; } .w-1\/2 { width: 50%; } .w-full { width: 100%; } .w-48px { width: 48px; } .w-150px { width: 150px; } .w-180px { width: 180px; } .w-225px { width: 225px; } .w-270px { width: 270px; } .w-360px { width: 360px; } .max-w-full { max-width: 100%; } .max-h-full { max-height: 100%; } .h-auto { height: auto; } .h-inherit { height: inherit; } .h-1 { height: 1 * $spacer; } .h-3 { height: 3 * $spacer; } .h-4 { height: 4 * $spacer; } .h-8 { height: 8 * $spacer; } .h-10 { height: 10 * $spacer; } .h-12 { height: 12 * $spacer; } .h-16 { height: 16 * $spacer; } .h-full { height: 100%; } .h-150px { height: 150px; } .h-180px { height: 180px; } .h-225px { height: 225px; } .h-270px { height: 270px; } .h-360px { height: 360px; } .max-h-150px { max-height: 150px; } .max-h-180px { max-height: 180px; } .max-h-225px { max-height: 225px; } .max-h-270px { max-height: 270px; } .max-h-360px { max-height: 360px; } .max-h-720px { max-height: 720px; } .max-h-screen { max-height: 100vh; } .space-x-1 > * + * { margin-left: 1 * $spacer; } .space-x-2 > * + * { margin-left: 2 * $spacer; } .space-x-4 > * + * { margin-left: 4 * $spacer; } .space-y-4 > * + * { margin-top: 4 * $spacer; } .gap-1 { gap: 1 * $spacer; } .gap-2 { gap: 2 * $spacer; } .gap-3 { gap: 3 * $spacer; } .gap-4 { gap: 4 * $spacer; } .divide-y-1 > * + * { border-top: 1px solid var(--divider-border-color); } .align-top { vertical-align: top; } .align-middle { vertical-align: middle; } .flex-1 { flex: 1 1 0%; } .flex-auto { flex: 1 1 auto; } .flex-initial { flex: 0 1 auto; } .flex-grow-1 { flex-grow: 1; } .flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .items-start { align-items: flex-start; } .items-center { align-items: center; } .items-end { align-items: flex-end; } .items-stretch { align-items: stretch; } .justify-items-center { justify-items: center; } .justify-center { justify-content: center; } .justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .self-start { align-self: flex-start; } .self-center { align-self: center; } .self-stretch { align-self: stretch; } .float-right { float: right; } .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); } .grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); } .link-color { color: var(--link-color); } .card { @extend %border; @extend %rounded-lg; @extend %shadow-md; } .thin-scrollbar { overflow-x: hidden; overflow-y: auto; padding-right: 2 * $spacer; overscroll-behavior: contain; // https://caniuse.com/css-overscroll-behavior // Firefox only // https://caniuse.com/?search=scrollbar-width // https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-width scrollbar-width: thin; &::-webkit-scrollbar { width: 5px; height: 5px; } &::-webkit-scrollbar-button { width: 0; height: 0; } &::-webkit-scrollbar-thumb { background: var(--post-tooltip-scrollbar-background); border: none; border-radius: 0; } &::-webkit-scrollbar-thumb:hover { background: var(--post-tooltip-scrollbar-thumb-color); } &::-webkit-scrollbar-thumb:active { background: var(--post-tooltip-scrollbar-thumb-color); } &::-webkit-scrollbar-track { background: var(--post-tooltip-scrollbar-track-background); border: none; border-radius: 0; } &::-webkit-scrollbar-track:hover { background: var(--post-tooltip-scrollbar-track-background); } &::-webkit-scrollbar-track:active { background: var(--post-tooltip-scrollbar-track-background); } &::-webkit-scrollbar-corner { background: transparent; } } .animate-spin { animation: animate-spin 1s linear infinite; } @keyframes animate-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @media screen and (min-width: 660px) { .md\:inline-block { display: inline-block; } .md\:block { display: block; } .md\:flex { display: flex; } .md\:grid { display: grid; } .md\:space-x-4 > * + * { margin-left: 4 * $spacer; } .md\:space-x-8 > * + * { margin-left: 8 * $spacer; } .md\:space-y-0 > * + * { margin-top: 0; } }