PHP Classes

File: resources/scss/_components.scss

Recommend this page to a friend!
  Packages of Boss Ibrahim Mussa   Caelrik   resources/scss/_components.scss   Download  
File: resources/scss/_components.scss
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Caelrik
Build Web user interface from PHP components
Author: By
Last change:
Date: 8 days ago
Size: 108,664 bytes
 

 

Contents

Class file image Download
@use 'variables' as *; // Runtime hooks: a custom theme (Theme::toCss()) overrides these. :root { --caelrik-required-color: #{$caelrik-required-color}; --caelrik-chart-min-height: #{$caelrik-chart-min-height}; --caelrik-grid-header-bg: #{$caelrik-grid-header-bg}; --caelrik-grid-header-color: inherit; --caelrik-grid-header-font-weight: #{$caelrik-grid-header-font-weight}; --caelrik-grid-header-text-transform: none; --caelrik-focus-ring: #{$caelrik-focus-ring}; --caelrik-scheduler-today-bg: #{$caelrik-scheduler-today-bg}; --caelrik-scheduler-title-font-size: #{$caelrik-scheduler-title-font-size}; --caelrik-editor-min-height: #{$caelrik-editor-min-height}; --caelrik-radius: var(--bs-border-radius); --caelrik-surface-shadow: none; // Stars of a rating field: amber with 3:1 and more on light backgrounds (WCAG 1.4.11); // Bootstrap's warning yellow on dark ones. --caelrik-rating-color: #c27c0e; } [data-bs-theme='dark'] { --caelrik-rating-color: #ffc107; } .caelrik-grid { thead th { background-color: var(--caelrik-grid-header-bg); color: var(--caelrik-grid-header-color); font-weight: var(--caelrik-grid-header-font-weight); text-transform: var(--caelrik-grid-header-text-transform); } caption { caption-side: top; } } // Actions (Action::link(), Action::request()). A request action is a form around its // button, laid out like the button. Outline buttons take the text-emphasis colors, which // keep 4.5:1 in light and dark mode (Bootstrap's own outline colors drop to about 3.3:1 on // the dark background); secondary takes the body color and the field border (3:1). .caelrik-action { display: inline-block; } .caelrik-action-button { @each $variant in primary, success, danger, warning, info { &.btn-outline-#{$variant} { --bs-btn-color: var(--bs-#{$variant}-text-emphasis); --bs-btn-border-color: var(--bs-#{$variant}-text-emphasis); } } &.btn-outline-secondary { --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--caelrik-input-border); } } // A grid's selection column (Grid::selectable()): its checkboxes have no visible label, so // each box is itself a 24 x 24 px target (WCAG 2.5.8). .caelrik-grid .caelrik-grid-select { width: 1%; .form-check-input { width: 1.5rem; height: 1.5rem; margin: 0; vertical-align: middle; } } // ListView (Components\ListView): items one per line, or as cards; a pager below. .caelrik-listview-items { margin-bottom: 0; &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 4px; } } .caelrik-listview-list .caelrik-listview-items > li + li { border-top: 1px solid var(--bs-border-color); } .caelrik-listview-item { display: flex; gap: 1rem; align-items: flex-start; padding: 0.875rem 0; } .caelrik-listview-cards .caelrik-listview-item { flex-direction: column; height: 100%; padding: 1rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background-color: var(--bs-body-bg); } .caelrik-listview-image { flex-shrink: 0; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: var(--bs-border-radius); } .caelrik-listview-cards .caelrik-listview-image { width: 100%; height: auto; aspect-ratio: 16 / 9; } .caelrik-listview-body { flex: 1 1 auto; min-width: 0; } .caelrik-listview-title { margin-bottom: 0.25rem; font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; } .caelrik-listview-description { margin-bottom: 0.25rem; } .caelrik-listview-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-bottom: 0; color: var(--bs-secondary-color); font-size: 0.875em; } .caelrik-listview-actions { display: flex; flex-wrap: wrap; gap: 0.375rem; } .caelrik-listview-empty { padding: 1.5rem 1rem; text-align: center; } .caelrik-listview-empty-title { margin-bottom: 0.25rem; font-weight: 600; } .caelrik-listview-empty-description { margin-bottom: 0; color: var(--bs-secondary-color); } .caelrik-listview-empty-action { margin-top: 0.75rem; } .caelrik-listview-footer { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; margin-top: 1rem; } .caelrik-listview-status { margin-bottom: 0; color: var(--bs-secondary-color); } // The pager's buttons are 2.25rem tall: above WCAG 2.5.8's 24px. .caelrik-listview-pager .page-link { min-width: 2.25rem; text-align: center; } .caelrik-listview[aria-busy='true'] .caelrik-listview-items { opacity: 0.6; } @media (prefers-reduced-motion: no-preference) { .caelrik-listview-items { transition: opacity 0.15s ease-in-out; } } // TreeView (Components\TreeView): nested lists, indented, with a chevron for nodes that open. .caelrik-tree-root, .caelrik-tree-group { margin: 0; padding: 0; list-style: none; } .caelrik-tree-group { padding-left: 1.25rem; } .caelrik-tree-row { display: flex; gap: 0.25rem; align-items: center; min-height: 2rem; padding: 0.125rem 0.375rem; border-radius: var(--bs-border-radius); cursor: default; } .caelrik-tree-label { display: inline-flex; gap: 0.5rem; align-items: center; margin: 0; overflow-wrap: anywhere; .form-check-input { flex-shrink: 0; margin-top: 0; } } // Without JavaScript, the nested lists keep their indentation and every control works. .caelrik-tree:not(:has([role='tree'])) .caelrik-tree-group { padding-left: 1.5rem; } .caelrik-tree-toggle, .caelrik-tree-spacer { flex-shrink: 0; width: 1.25rem; height: 1.25rem; } .caelrik-tree-toggle { position: relative; cursor: pointer; &::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translate(-65%, -50%) rotate(-45deg); } } .caelrik-tree-row[aria-expanded='true'] > .caelrik-tree-toggle::before { transform: translate(-50%, -70%) rotate(45deg); } .caelrik-tree-row[aria-busy='true'] > .caelrik-tree-toggle { opacity: 0.5; } // The node's row is the treeitem and takes the focus. .caelrik-tree [role='treeitem']:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 1px; } .caelrik-tree-row:hover { background-color: var(--bs-tertiary-bg); } .caelrik-tree [role='treeitem'][aria-selected='true'] { background-color: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; } .caelrik-tree [role='treeitem'][aria-disabled='true'] { color: var(--bs-secondary-color); cursor: not-allowed; } // The checkbox or radio button is the node's picture of its state: the node takes the // clicks and keys. .caelrik-tree [role='tree'] .caelrik-tree-input { pointer-events: none; } // TreeList (Components\TreeList): the first cell is indented by the row's level (classes, // not inline styles: a strict CSP allows no style attributes). .caelrik-treelist-tree { white-space: nowrap; } @for $level from 2 through 12 { .caelrik-treelist-level-#{$level} { padding-left: calc(0.5rem + #{($level - 1) * 1.25rem}) !important; } } .caelrik-treelist-toggle, .caelrik-treelist-spacer { display: inline-block; position: relative; width: 1.25rem; height: 1rem; margin-right: 0.25rem; vertical-align: -0.125rem; } .caelrik-treelist-toggle { cursor: pointer; &::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translate(-65%, -50%) rotate(-45deg); } } .caelrik-treelist tr[aria-expanded='true'] .caelrik-treelist-toggle::before { transform: translate(-50%, -70%) rotate(45deg); } // Rows and cells take the focus in turn: each shows it with an inset outline. .caelrik-treelist :is(tr, td):focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: -2px; } .caelrik-treelist-actions { width: 1%; white-space: nowrap; } // TaskBoard (Components\TaskBoard): columns side by side that scroll sideways on narrow // screens, each a list of cards. .caelrik-board-columns { display: grid; grid-auto-columns: minmax(16rem, 1fr); grid-auto-flow: column; gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; } .caelrik-board-column { display: flex; flex-direction: column; min-width: 0; padding: 0.75rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background-color: var(--bs-tertiary-bg); } .caelrik-board-column-title { display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; font-size: 1rem; font-weight: 600; } .caelrik-board-cards { display: flex; flex: 1 1 auto; flex-direction: column; gap: 0.5rem; min-height: 3rem; margin: 0; } .caelrik-board-card { padding: 0.75rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); background-color: var(--bs-body-bg); cursor: grab; &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; } &.is-grabbed { outline: 3px dashed var(--bs-primary); outline-offset: 2px; } &.is-ghost { opacity: 0.4; } &[aria-busy='true'] { opacity: 0.7; } } .caelrik-board-card-title { margin-bottom: 0.25rem; font-size: 0.95rem; font-weight: 600; overflow-wrap: anywhere; } .caelrik-board-card-description { margin-bottom: 0.25rem; font-size: 0.875rem; } .caelrik-board-card-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-bottom: 0; color: var(--bs-secondary-color); font-size: 0.8125rem; } .caelrik-board-move { margin-top: 0.5rem; .form-select, .btn { min-height: 1.75rem; } } // AdminLayout (Components\AdminLayout): the app bar on top, the sidebar beside the main // content on large screens (Bootstrap's offcanvas-lg below), the user menu at the end. .caelrik-skip-link:focus { position: absolute; z-index: 1080; top: 0.5rem; left: 0.5rem; padding: 0.5rem 1rem; border-radius: var(--bs-border-radius); background-color: var(--bs-body-bg); box-shadow: 0 0 0 2px var(--bs-primary); } .caelrik-admin { display: flex; flex-direction: column; min-height: 100vh; } .caelrik-appbar { position: sticky; z-index: 1020; top: 0; } .caelrik-appbar-toggle { border: 1px solid var(--bs-border-color); } .caelrik-admin-body { display: flex; flex: 1 1 auto; min-height: 0; } .caelrik-admin-main { flex: 1 1 auto; min-width: 0; padding: 1.25rem; &:focus { outline: none; } > .caelrik-breadcrumb { margin-bottom: 0.5rem; } } .caelrik-admin-title { margin-bottom: 1rem; } @media (min-width: 992px) { .caelrik-admin-sidebar { position: sticky; top: 3.5rem; flex: 0 0 16rem; align-self: flex-start; max-height: calc(100vh - 3.5rem); overflow-y: auto; border-right: 1px solid var(--bs-border-color); } } // Without JavaScript the offcanvas cannot open: the sidebar is shown above the content. @media (max-width: 991.98px) { html:not(.caelrik-js) .caelrik-admin-body { flex-direction: column; } html:not(.caelrik-js) .caelrik-admin-sidebar.offcanvas-lg { position: static; visibility: visible; width: auto; transform: none; border-bottom: 1px solid var(--bs-border-color); } html:not(.caelrik-js) .caelrik-appbar-toggle, html:not(.caelrik-js) .caelrik-admin-sidebar .offcanvas-header { display: none; } } // Navigation (Components\Navigation): links, and groups that open and close (<details>). .caelrik-nav { padding: 0.75rem 0.5rem; } .caelrik-nav-list { display: flex; flex-direction: column; gap: 0.125rem; margin: 0; .caelrik-nav-list { margin: 0.125rem 0 0.25rem 0.75rem; padding-left: 0.5rem; border-left: 1px solid var(--bs-border-color); } } .caelrik-nav-link { display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; min-height: 2.25rem; padding: 0.375rem 0.75rem; border-radius: var(--bs-border-radius); color: var(--bs-body-color); text-decoration: none; &:hover { background-color: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); } &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: -2px; } &[aria-current] { background-color: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; } } summary.caelrik-nav-link { cursor: pointer; list-style: none; &::-webkit-details-marker { display: none; } // A chevron that turns when the group opens. &::after { content: ''; width: 0.45rem; height: 0.45rem; margin-right: 0.25rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); } } .caelrik-nav-group[open] > summary.caelrik-nav-link::after { transform: rotate(45deg); } // UserMenu (Components\UserMenu): a disclosure in the app bar, its panel under it. .caelrik-usermenu { position: relative; > summary { display: inline-flex; gap: 0.5rem; align-items: center; list-style: none; &::-webkit-details-marker { display: none; } } } .caelrik-usermenu-avatar { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; } .caelrik-usermenu-initials { background-color: var(--bs-primary); color: var(--caelrik-on-primary, #fff); font-size: 0.8125rem; font-weight: 600; } @media (max-width: 575.98px) { .caelrik-usermenu-name { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; } } .caelrik-usermenu-panel { position: absolute; z-index: 1030; top: calc(100% + 0.25rem); right: 0; min-width: 14rem; padding: 0.5rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background-color: var(--bs-body-bg); form, .btn { width: 100%; } } .caelrik-usermenu-detail { margin: 0 0 0.5rem; padding: 0 0.5rem 0.5rem; border-bottom: 1px solid var(--bs-border-color); color: var(--bs-secondary-color); font-size: 0.875rem; overflow-wrap: anywhere; } .caelrik-usermenu-item { display: block; padding: 0.375rem 0.5rem; border-radius: var(--bs-border-radius); color: var(--bs-body-color); text-decoration: none; &:hover { background-color: var(--bs-tertiary-bg); } &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: -2px; } } .caelrik-usermenu-divider { margin: 0.375rem 0; border-top: 1px solid var(--bs-border-color); } // Menus (MenuButton, SplitButton, ContextMenu): a list under its button, or at the pointer. // Without JavaScript, the button is hidden and the items are a plain list. .caelrik-menubutton, .caelrik-splitbutton { position: relative; display: inline-flex; vertical-align: middle; } html:not(.caelrik-js) .caelrik-menu-toggle { display: none; } .caelrik-menu-list { z-index: 1035; min-width: 12rem; margin: 0; padding: 0.375rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background-color: var(--bs-body-bg); color: var(--bs-body-color); .caelrik-js :is(.caelrik-menubutton, .caelrik-splitbutton) > & { position: absolute; top: calc(100% + 0.25rem); left: 0; } .caelrik-js .caelrik-menu-end > & { right: 0; left: auto; } &.caelrik-contextmenu-list { position: fixed; } form { margin: 0; } } // Every item looks the same, a link or a request action's button. .caelrik-menu-item, .caelrik-menu-list .caelrik-action button { display: block; width: 100%; padding: 0.375rem 0.75rem; border: 0; border-radius: var(--bs-border-radius); background: none; color: var(--bs-body-color); font-size: 1rem; text-align: start; text-decoration: none; white-space: nowrap; &:hover, &:focus { background-color: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); } &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: -2px; } &[aria-disabled='true'], &[data-disabled] { color: var(--bs-secondary-color); cursor: not-allowed; } } .caelrik-menu-divider { margin: 0.375rem 0; border-top: 1px solid var(--bs-border-color); } // Toolbar (Components\Toolbar): its controls in a row, separators between groups. .caelrik-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; } .caelrik-toolbar-item form { margin: 0; } .caelrik-toolbar-separator { align-self: stretch; width: 1px; background-color: var(--bs-border-color); } // Navigation::horizontal(): a bar of links, its groups dropping down below their names. .caelrik-nav-horizontal { padding: 0; > .caelrik-nav-list { flex-direction: row; flex-wrap: wrap; gap: 0.25rem; } .caelrik-nav-group { position: relative; > .caelrik-nav-list { position: absolute; z-index: 1030; top: calc(100% + 0.25rem); left: 0; min-width: 13rem; margin: 0; padding: 0.375rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background-color: var(--bs-body-bg); } } } // Accordion (Components\Accordion): Bootstrap's look, opened and closed by layout.js. .caelrik-accordion .accordion-button:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: -2px; } // Card (Components\Card): its actions sit above the title's stretched link. .caelrik-card-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.75rem; } .caelrik-card-link:focus-visible { outline: none; &::after { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; border-radius: var(--bs-card-border-radius, var(--bs-border-radius)); } } // Splitter (Components\Splitter): panes and dividers in a row or a column. .caelrik-splitter { display: flex; min-height: 12rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); &.caelrik-splitter-vertical { flex-direction: column; } } .caelrik-splitter-pane { flex: 1 1 0; min-width: 0; min-height: 0; overflow: auto; padding: 0.75rem; } .caelrik-splitter-handle { position: relative; flex: 0 0 0.5rem; background-color: var(--bs-tertiary-bg); touch-action: none; .caelrik-splitter-horizontal > & { cursor: col-resize; border-inline: 1px solid var(--bs-border-color); } .caelrik-splitter-vertical > & { cursor: row-resize; border-block: 1px solid var(--bs-border-color); } // A 24px target (WCAG 2.5.8) around the thin divider. &::before { content: ''; position: absolute; inset: 0 -0.5rem; .caelrik-splitter-vertical > & { inset: -0.5rem 0; } } &:hover, &.is-dragging { background-color: var(--bs-secondary-bg); } &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 0; } } // Without JavaScript the dividers do nothing: they are not shown. html:not(.caelrik-js) .caelrik-splitter-handle { display: none; } // Tile layout (Components\TileLayout): tiles on a grid of columns, spans as classes (no // inline styles). The flow is not dense: what is seen keeps the order of the page. .caelrik-tilelayout { --caelrik-tile-columns: 3; --caelrik-tile-row: 10rem; position: relative; display: grid; grid-template-columns: repeat(var(--caelrik-tile-columns), minmax(0, 1fr)); grid-auto-rows: minmax(var(--caelrik-tile-row), auto); gap: 1rem; } @for $i from 1 through 12 { .caelrik-tilelayout-cols-#{$i} { --caelrik-tile-columns: #{$i}; } .caelrik-tile-cols-#{$i} { grid-column: span $i; } } @for $i from 1 through 6 { .caelrik-tile-rows-#{$i} { grid-row: span $i; } } .caelrik-tile { position: relative; min-width: 0; margin: 0; &.is-dragging, &.is-resizing { box-shadow: var(--bs-box-shadow); outline: 2px dashed var(--bs-primary); outline-offset: 2px; } } .caelrik-tile-header { display: flex; align-items: center; gap: 0.5rem; } .caelrik-tile-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1rem; font-weight: 600; } .caelrik-tile-handle { min-width: 1.5rem; min-height: 1.5rem; cursor: grab; touch-action: none; .is-dragging & { cursor: grabbing; } } .caelrik-tile-tools { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem 1rem; border-bottom: var(--bs-card-border-width) solid var(--bs-card-border-color); &[hidden] { display: none; } [aria-disabled='true'] { opacity: 0.65; cursor: not-allowed; } } .caelrik-tile-body { min-height: 0; overflow: auto; } // The corner grip: a 24px target (WCAG 2.5.8); the tools resize without it. .caelrik-tile-grip { position: absolute; inset-block-end: 0; inset-inline-end: 0; width: 1.5rem; height: 1.5rem; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 55%, var(--bs-secondary-color) 55%, var(--bs-secondary-color) 62%, transparent 62%, transparent 75%, var(--bs-secondary-color) 75%, var(--bs-secondary-color) 82%, transparent 82%); [dir='rtl'] & { cursor: nesw-resize; transform: scaleX(-1); } } // Without JavaScript nothing can be arranged. html:not(.caelrik-js) { .caelrik-tile-handle, .caelrik-tile-grip { display: none; } } // Record view (Components\RecordView): sections of labels and values, in 1 to 4 columns // (one on small screens). .caelrik-recordview { display: grid; gap: 1.5rem; } .caelrik-recordview-title { margin-bottom: 0.25rem; font-size: 1.125rem; font-weight: 600; } .caelrik-recordview-description { margin-bottom: 0.75rem; color: var(--bs-secondary-color); } .caelrik-recordview-entries { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 1.5rem; margin: 0; dt { font-size: 0.875rem; font-weight: 500; color: var(--bs-secondary-color); } dd { margin: 0.125rem 0 0; overflow-wrap: anywhere; } } @media (min-width: 768px) { @for $i from 2 through 4 { .caelrik-recordview-cols-#{$i} { grid-template-columns: repeat($i, minmax(0, 1fr)); } .caelrik-recordview-span-#{$i} { grid-column: span $i; } } } .caelrik-recordview-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0; margin: 0; list-style: none; } .caelrik-recordview-yes .caelrik-recordview-mark { color: var(--bs-success-text-emphasis); } .caelrik-recordview-no .caelrik-recordview-mark { color: var(--bs-danger-text-emphasis); } .caelrik-recordview-image { max-height: 12rem; } // Stat tiles (Components\Stat, Components\Stats): a label, a value, a trend and a sparkline. .caelrik-stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 0; margin: 0 0 1rem; list-style: none; > li { display: flex; min-width: 0; > .caelrik-stat { flex: 1 1 auto; } } } @media (min-width: 576px) { @for $i from 2 through 6 { .caelrik-stats-cols-#{$i} { grid-template-columns: repeat(2, minmax(0, 1fr)); } } } @media (min-width: 992px) { @for $i from 3 through 6 { .caelrik-stats-cols-#{$i} { grid-template-columns: repeat($i, minmax(0, 1fr)); } } } .caelrik-stat { position: relative; height: 100%; .card-body { display: flex; flex-direction: column; gap: 0.25rem; } p { margin: 0; } // The tile's link covers it: its focus ring goes around the tile. .stretched-link:focus-visible { outline: none; &::after { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; border-radius: var(--bs-card-border-radius, var(--bs-border-radius)); } } } // A stat in a tile, a card, or any container: no second border. :is(.caelrik-tile-body, .card-body) > .caelrik-stat { --bs-card-border-width: 0; --bs-card-spacer-x: 0; --bs-card-spacer-y: 0; --bs-card-bg: transparent; } .caelrik-stat-label { font-size: 0.875rem; font-weight: 500; color: var(--bs-secondary-color); a { color: inherit; text-decoration: none; } a:hover { text-decoration: underline; } } .caelrik-stat-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; } .caelrik-stat-trend { font-size: 0.875rem; font-weight: 500; } .caelrik-stat-trend-good { color: var(--bs-success-text-emphasis); } .caelrik-stat-trend-bad { color: var(--bs-danger-text-emphasis); } .caelrik-stat-trend-flat, .caelrik-stat-period, .caelrik-stat-description { color: var(--bs-secondary-color); } .caelrik-stat-period { font-weight: 400; } .caelrik-stat-description { font-size: 0.875rem; } // The sparkline: text-emphasis colors keep 3:1 against the card (WCAG 1.4.11). .caelrik-stat-sparkline { display: block; width: 100%; height: 2.5rem; margin-top: auto; padding-top: 0.5rem; overflow: visible; } .caelrik-stat-line { stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; } .caelrik-stat-area { fill: currentColor; opacity: 0.12; } @each $color in primary, secondary, success, danger, warning, info { .caelrik-stat-#{$color} .caelrik-stat-sparkline { color: var(--bs-#{$color}-text-emphasis); } } @media (forced-colors: active) { .caelrik-stat-sparkline { color: CanvasText !important; } .caelrik-stat-area { display: none; } } // Avatar (Components\Avatar): a picture or initials; a status dot shaped by its status. .caelrik-avatar { --caelrik-avatar-size: 2rem; position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: var(--caelrik-avatar-size); height: var(--caelrik-avatar-size); border-radius: 50%; font-size: calc(var(--caelrik-avatar-size) * 0.4); font-weight: 600; line-height: 1; vertical-align: middle; user-select: none; &.caelrik-avatar-square { border-radius: var(--bs-border-radius); } } .caelrik-avatar-sm { --caelrik-avatar-size: 1.5rem; } .caelrik-avatar-lg { --caelrik-avatar-size: 2.5rem; } .caelrik-avatar-xl { --caelrik-avatar-size: 3.5rem; } .caelrik-avatar-image { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; } // Online: a filled dot; away: half filled; busy: a bar; offline: a ring. .caelrik-avatar-status { position: absolute; inset-block-end: -1px; inset-inline-end: -1px; width: max(0.625rem, calc(var(--caelrik-avatar-size) * 0.32)); height: max(0.625rem, calc(var(--caelrik-avatar-size) * 0.32)); border: 2px solid var(--bs-body-bg); border-radius: 50%; background-color: var(--bs-body-bg); box-shadow: inset 0 0 0 2px var(--caelrik-status); } // Plain colors in light mode, emphasis colors in dark mode: 3:1 against the page either way. .caelrik-avatar-status-online { --caelrik-status: var(--bs-success); background-color: var(--caelrik-status); } .caelrik-avatar-status-away { --caelrik-status: var(--bs-warning-text-emphasis); background-image: linear-gradient(to top, var(--caelrik-status) 50%, transparent 50%); } .caelrik-avatar-status-busy { --caelrik-status: var(--bs-danger); background-color: var(--caelrik-status); &::after { content: ''; position: absolute; inset: 42% 22%; background-color: var(--bs-body-bg); } } .caelrik-avatar-status-offline { --caelrik-status: var(--bs-secondary-color); } [data-bs-theme="dark"] { .caelrik-avatar-status-online { --caelrik-status: var(--bs-success-text-emphasis); } .caelrik-avatar-status-busy { --caelrik-status: var(--bs-danger-text-emphasis); } } // Chip (Components\Chip): plain, removable, or a filter checkbox. .caelrik-chip { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 1.75rem; padding: 0.125rem 0.625rem; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: 50rem; background-color: var(--bs-body-bg); color: var(--bs-body-color); font-size: 0.875rem; line-height: 1.25; vertical-align: middle; .caelrik-avatar { margin-inline-start: -0.375rem; } &:has(.caelrik-chip-remove) { padding-inline-end: 0.125rem; } } // A 24px target (WCAG 2.5.8). .caelrik-chip-remove { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--bs-secondary-color); font-size: 1rem; line-height: 1; &:hover { background-color: var(--bs-tertiary-bg); color: var(--bs-body-color); } &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 1px; } } html:not(.caelrik-js) .caelrik-chip-remove { display: none; } .caelrik-chip-check { display: inline-block; .caelrik-chip { cursor: pointer; user-select: none; } .btn-check:checked + .caelrik-chip { border-color: var(--bs-primary-border-subtle); background-color: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); // Checked is shown by a mark, not only by color. &::before { content: '\2713'; font-weight: 600; } } .btn-check:focus-visible + .caelrik-chip { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; } } // Tooltip (Components\Tooltip): placed by classes from JavaScript. .caelrik-tooltip-wrap { position: relative; display: inline-block; } .caelrik-tooltip-text { text-decoration: underline dotted; text-underline-offset: 0.2em; cursor: help; } .caelrik-tooltip { position: absolute; z-index: 1080; inset-inline-start: 50%; width: max-content; max-width: min(16rem, calc(100vw - 1rem)); padding: 0.25rem 0.5rem; border-radius: var(--bs-border-radius); background-color: var(--bs-emphasis-color); color: var(--bs-body-bg); font-size: 0.875rem; font-weight: 400; line-height: 1.4; text-align: start; white-space: normal; transform: translateX(-50%); &[hidden] { display: none; } &.is-above { bottom: calc(100% + 0.375rem); } &.is-below { top: calc(100% + 0.375rem); } &.is-start { inset-inline-start: 0; transform: none; } &.is-end { inset-inline-start: auto; inset-inline-end: 0; transform: none; } } [dir="rtl"] .caelrik-tooltip:not(.is-start, .is-end) { transform: translateX(50%); } // Popover (Components\Popover): a disclosure whose panel floats under its button. .caelrik-popover { position: relative; display: inline-block; > summary { list-style: none; &::-webkit-details-marker { display: none; } } } .caelrik-popover-panel { position: absolute; z-index: 1070; top: calc(100% + 0.25rem); inset-inline-start: 0; width: max-content; max-width: min(20rem, calc(100vw - 1rem)); padding: 0.75rem; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); background-color: var(--bs-body-bg); font-size: 0.875rem; .caelrik-popover-end > & { inset-inline-start: auto; inset-inline-end: 0; } > :last-child > :last-child { margin-bottom: 0; } } .caelrik-popover-title { margin-bottom: 0.25rem; font-weight: 600; } // Progress (Components\Progress): a native <progress> bar, or an SVG circle. Fill colors keep // 3:1 against the track (WCAG 1.4.11): info and warning use their darker emphasis colors. .caelrik-progress, .caelrik-progress-circle { --caelrik-progress-color: var(--bs-primary); --caelrik-progress-track: var(--bs-secondary-bg); } .caelrik-progress-secondary { --caelrik-progress-color: var(--bs-secondary-color); } .caelrik-progress-success { --caelrik-progress-color: var(--bs-success); } .caelrik-progress-danger { --caelrik-progress-color: var(--bs-danger); } .caelrik-progress-warning { --caelrik-progress-color: var(--bs-warning-text-emphasis); } .caelrik-progress-info { --caelrik-progress-color: var(--bs-info-text-emphasis); } .caelrik-progress-text { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; font-size: 0.875rem; } .caelrik-progress-value { font-variant-numeric: tabular-nums; font-weight: 600; } .caelrik-progress-bar { display: block; width: 100%; height: 0.5rem; border: 0; border-radius: 50rem; overflow: hidden; appearance: none; background-color: var(--caelrik-progress-track); color: var(--caelrik-progress-color); .caelrik-progress-sm & { height: 0.25rem; } .caelrik-progress-lg & { height: 1rem; } &::-webkit-progress-bar { background-color: var(--caelrik-progress-track); } &::-webkit-progress-value { border-radius: 50rem; background-color: var(--caelrik-progress-color); } &::-moz-progress-bar { border-radius: 50rem; background-color: var(--caelrik-progress-color); } // Indeterminate: a segment that slides along the track. &:indeterminate { background-image: linear-gradient(90deg, transparent 0 35%, var(--caelrik-progress-color) 35% 65%, transparent 65%); background-size: 200% 100%; animation: caelrik-progress-slide 1.5s linear infinite; &::-webkit-progress-bar { background-color: transparent; } &::-moz-progress-bar { background-color: transparent; } } } @keyframes caelrik-progress-slide { from { background-position: 100% 0; } to { background-position: -100% 0; } } .caelrik-progress-circle { display: inline-flex; flex-direction: column; align-items: center; gap: 0.25rem; font-size: 0.875rem; vertical-align: middle; } .caelrik-progress-dial { position: relative; width: 3rem; height: 3rem; .caelrik-progress-sm & { width: 2rem; height: 2rem; } .caelrik-progress-lg & { width: 4.5rem; height: 4.5rem; } svg { display: block; width: 100%; height: 100%; } .caelrik-progress-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; } .caelrik-progress-sm & .caelrik-progress-value { font-size: 0.5625rem; } .caelrik-progress-lg & .caelrik-progress-value { font-size: 1rem; } } .caelrik-progress-track { stroke: var(--caelrik-progress-track); stroke-width: 3.5; } .caelrik-progress-arc { stroke: var(--caelrik-progress-color); stroke-width: 3.5; stroke-linecap: round; } .caelrik-progress-circle.is-indeterminate svg { animation: caelrik-progress-spin 1.2s linear infinite; } @keyframes caelrik-progress-spin { to { transform: rotate(360deg); } } // Loader (Components\Loader) and skeleton (Components\Skeleton). .caelrik-loader { display: inline-flex; align-items: center; gap: 0.5rem; } .caelrik-skeleton { display: block; } .caelrik-skeleton-shapes { display: flex; flex-direction: column; gap: 0.5rem; .placeholder { display: block; border-radius: var(--bs-border-radius-sm); } } .caelrik-skeleton-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; } .caelrik-skeleton-avatar { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; &.placeholder { border-radius: 50%; } } .caelrik-skeleton-image { width: 100%; aspect-ratio: 16 / 9; } @media (prefers-reduced-motion: reduce) { .caelrik-progress-bar:indeterminate, .caelrik-progress-circle.is-indeterminate svg, .caelrik-skeleton .placeholder { animation: none; } .caelrik-progress-bar:indeterminate { background-position: 50% 0; } } @media (forced-colors: active) { .caelrik-avatar-status { forced-color-adjust: none; border-color: Canvas; background-color: Canvas; box-shadow: inset 0 0 0 2px CanvasText; } .caelrik-avatar-status-online, .caelrik-avatar-status-busy { background-color: CanvasText; } .caelrik-avatar-status-away { background-image: linear-gradient(to top, CanvasText 50%, transparent 50%); } .caelrik-avatar-status-busy::after { background-color: Canvas; } .caelrik-tooltip, .caelrik-popover-panel, .caelrik-chip { border: 1px solid CanvasText; } .caelrik-progress-arc { stroke: Highlight; } .caelrik-progress-track { stroke: GrayText; } } // Sparkline (Components\Sparkline): the size of a word, 4 wide for 1 high. .caelrik-sparkline { --caelrik-sparkline-color: var(--bs-primary-text-emphasis); display: inline-block; width: 6em; height: 1.5em; overflow: visible; color: var(--caelrik-sparkline-color); vertical-align: middle; } .caelrik-sparkline-sm { width: 4em; height: 1em; } .caelrik-sparkline-lg { width: 10em; height: 2.5em; } // Text-emphasis colors keep 3:1 against the page (WCAG 1.4.11), in both modes. @each $color in primary, secondary, success, danger, warning, info { .caelrik-sparkline-#{$color} { --caelrik-sparkline-color: var(--bs-#{$color}-text-emphasis); } } .caelrik-sparkline-line { stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; } .caelrik-sparkline-area { fill: currentColor; opacity: 0.15; } .caelrik-sparkline-dot, .caelrik-sparkline-bar { fill: currentColor; } // Negative bars are lighter as well as below the line. .caelrik-sparkline-bar.is-negative { fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; } // Gauge (Components\Gauge): a meter drawn as a semicircle or a bar. .caelrik-gauge { --caelrik-gauge-track: var(--bs-secondary-bg); margin-bottom: 1rem; } .caelrik-gauge-label { margin: 0 0 0.25rem; font-weight: 600; } .caelrik-gauge-reading { margin: 0; line-height: 1.2; } .caelrik-gauge-value { font-weight: 600; font-variant-numeric: tabular-nums; } .caelrik-gauge-band { color: var(--bs-secondary-color); font-size: 0.875em; } .caelrik-gauge-scale { display: flex; justify-content: space-between; margin: 0.125rem 0 0; color: var(--bs-secondary-color); font-size: 0.75rem; font-variant-numeric: tabular-nums; } .caelrik-gauge-svg { display: block; width: 100%; overflow: visible; } .caelrik-gauge-track { fill: none; stroke: var(--caelrik-gauge-track); } .caelrik-gauge-range, .caelrik-gauge-fill { fill: none; } .caelrik-gauge-target { stroke: var(--bs-emphasis-color); stroke-width: 2; stroke-linecap: round; } // Colors keep 3:1 against the page and the track (warning and info use darker shades). @each $color, $value in ( 'primary': var(--bs-primary), 'secondary': var(--bs-secondary-color), 'success': var(--bs-success), 'danger': var(--bs-danger), 'warning': var(--bs-warning-text-emphasis), 'info': var(--bs-info-text-emphasis) ) { .caelrik-gauge-#{$color} { stroke: $value; } .caelrik-gauge-linear .caelrik-gauge-#{$color} { fill: $value; stroke: none; } } // The semicircle: the value in its middle, the scale's ends under its ends. .caelrik-gauge-arc { width: 9rem; max-width: 100%; text-align: center; &.caelrik-gauge-sm { width: 6rem; } &.caelrik-gauge-lg { width: 13rem; } .caelrik-gauge-body { position: relative; } .caelrik-gauge-track, .caelrik-gauge-fill { stroke-width: 10; } .caelrik-gauge-range { stroke-width: 3; } .caelrik-gauge-reading { position: absolute; inset-inline: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; } .caelrik-gauge-value { font-size: 1.25rem; } &.caelrik-gauge-sm .caelrik-gauge-value { font-size: 0.875rem; } &.caelrik-gauge-lg .caelrik-gauge-value { font-size: 1.75rem; } // The band's name stays, smaller: it is the sign that is not a color. &.caelrik-gauge-sm .caelrik-gauge-band { font-size: 0.6875rem; } .caelrik-gauge-scale { padding-inline: 0.25rem; } } // The bar: the label and the value on one line above it. .caelrik-gauge-linear { .caelrik-gauge-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 0.75rem; margin-bottom: 0.25rem; } .caelrik-gauge-label { margin: 0; } .caelrik-gauge-svg { height: 0.75rem; } &.caelrik-gauge-sm .caelrik-gauge-svg { height: 0.5rem; } &.caelrik-gauge-lg .caelrik-gauge-svg { height: 1.125rem; } .caelrik-gauge-track { fill: var(--caelrik-gauge-track); stroke: none; } } @media (forced-colors: active) { .caelrik-sparkline { color: CanvasText !important; } .caelrik-sparkline-area { display: none; } .caelrik-gauge-svg { forced-color-adjust: none; } .caelrik-gauge-track { stroke: GrayText; } .caelrik-gauge-linear .caelrik-gauge-track { fill: GrayText; } .caelrik-gauge-fill { stroke: Highlight; } .caelrik-gauge-linear .caelrik-gauge-fill { fill: Highlight; } .caelrik-gauge-range { stroke: CanvasText; } .caelrik-gauge-linear .caelrik-gauge-range { fill: CanvasText; } .caelrik-gauge-target { stroke: CanvasText; } } // Gantt chart (Components\Gantt): a table whose last column is the timeline. It scrolls // sideways; the task names stay in view. .caelrik-gantt { margin-bottom: 1rem; } .caelrik-gantt-scroll { overflow-x: auto; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; } } .caelrik-gantt-canvas { position: relative; width: max-content; min-width: 100%; } .caelrik-gantt-table { border-collapse: separate; border-spacing: 0; font-size: 0.875rem; th, td { height: 2.25rem; padding: 0 0.75rem; border-bottom: var(--bs-border-width) solid var(--bs-border-color); white-space: nowrap; vertical-align: middle; } thead th { height: auto; padding-block: 0.25rem; background-color: var(--bs-tertiary-bg); font-weight: 600; text-align: start; vertical-align: bottom; } tbody tr:last-child > * { border-bottom: 0; } td:nth-child(n + 2):nth-child(-n + 4) { font-variant-numeric: tabular-nums; } } .caelrik-gantt-label { margin: 0 0 0.5rem; font-weight: 600; } // The task names stay at the start while the timeline scrolls. .caelrik-gantt-table th:first-child { position: sticky; inset-inline-start: 0; z-index: 2; max-width: 16rem; overflow: hidden; background-color: var(--bs-body-bg); text-overflow: ellipsis; } .caelrik-gantt-table thead th:first-child { background-color: var(--bs-tertiary-bg); } .caelrik-gantt-name { font-weight: 500; } .caelrik-gantt-table .caelrik-gantt-timeline { padding: 0; border-inline-start: var(--bs-border-width) solid var(--bs-border-color); } .caelrik-gantt-row, .caelrik-gantt-scale { display: block; } .caelrik-gantt-row { margin-block: 0.25rem; } .caelrik-gantt-scale text { fill: var(--bs-secondary-color); font-size: 11px; } .caelrik-gantt-grid { stroke: var(--bs-border-color-translucent); stroke-width: 1; } .caelrik-gantt-weekend { fill: var(--bs-tertiary-bg); } .caelrik-gantt-today { stroke: var(--bs-danger-text-emphasis); stroke-width: 2; } // A bar: a light fill with a border in its color (3:1), the done part filled. @each $color in primary, secondary, success, danger, warning, info { .caelrik-gantt-bar.caelrik-gantt-#{$color} { fill: var(--bs-#{$color}-bg-subtle); stroke: var(--bs-#{$color}-text-emphasis); } .caelrik-gantt-done.caelrik-gantt-#{$color}, .caelrik-gantt-milestone.caelrik-gantt-#{$color} { fill: var(--bs-#{$color}-text-emphasis); } } .caelrik-gantt-bar { stroke-width: 1.5; } .caelrik-gantt-arrows { position: absolute; top: 0; left: 0; z-index: 1; overflow: visible; pointer-events: none; } .caelrik-gantt-link { fill: none; stroke: var(--bs-secondary-color); stroke-width: 1.5; } .caelrik-gantt-arrowhead { fill: var(--bs-secondary-color); } @media (forced-colors: active) { .caelrik-gantt-row, .caelrik-gantt-scale, .caelrik-gantt-arrows { forced-color-adjust: none; } .caelrik-gantt-scale text { fill: CanvasText; } .caelrik-gantt-bar[class] { fill: Canvas; stroke: CanvasText; } .caelrik-gantt-done[class], .caelrik-gantt-milestone[class] { fill: CanvasText; } .caelrik-gantt-weekend { fill: Canvas; } .caelrik-gantt-grid { stroke: GrayText; } .caelrik-gantt-today, .caelrik-gantt-link { stroke: Highlight; } .caelrik-gantt-arrowhead { fill: Highlight; } } // Map (Components\Map, Leaflet): a named region and, under it, the list of its places. .caelrik-map { margin-bottom: 1rem; } .caelrik-map-canvas { position: relative; z-index: 0; height: 22.5rem; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); background-color: var(--bs-tertiary-bg); font: inherit; &.caelrik-map-sm { height: 15rem; } &.caelrik-map-lg { height: 30rem; } &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; } // Leaflet's own colors follow the page: controls, popups and the attribution. &.leaflet-container { background-color: var(--bs-tertiary-bg); color: var(--bs-body-color); font: inherit; } .leaflet-bar a { border-bottom-color: var(--bs-border-color); background-color: var(--bs-body-bg); color: var(--bs-body-color); &:hover, &:focus-visible { background-color: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); } &.leaflet-disabled { background-color: var(--bs-secondary-bg); color: var(--bs-secondary-color); } } .leaflet-bar { border-color: var(--bs-border-color); } // A solid background keeps the attribution readable over any tile (AA). Leaflet's // stylesheet loads after Caelrik's: these rules are one class more specific than its own. &.leaflet-container .leaflet-control-attribution { background-color: var(--bs-body-bg); color: var(--bs-body-color); font-size: 0.75rem; a { color: var(--bs-link-color); } } .leaflet-popup-content-wrapper, .leaflet-popup-tip { background-color: var(--bs-body-bg); color: var(--bs-body-color); box-shadow: var(--bs-box-shadow); } .leaflet-popup-content-wrapper { border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); } .leaflet-popup-content { margin: 0.75rem 2rem 0.75rem 0.875rem; font-size: 0.875rem; line-height: 1.4; } // A 24px target (WCAG 2.5.8). a.leaflet-popup-close-button { width: 1.75rem; height: 1.75rem; color: var(--bs-secondary-color); font: 1.25rem / 1.75rem inherit; &:hover, &:focus-visible { color: var(--bs-emphasis-color); } } :is(.leaflet-bar a, .leaflet-popup-close-button, .leaflet-control-attribution a, .caelrik-map-popup a):focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 1px; } // Links, not Leaflet's links that play buttons (zoom, close). &.leaflet-container a:not([role='button']) { color: var(--bs-link-color); } &.leaflet-container .caelrik-map-popup p { margin: 0 0 0.25rem; } } // Darker tiles in dark mode. [data-bs-theme='dark'] .caelrik-map-canvas .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); } .caelrik-map-noscript { margin: 0; padding: 1rem; color: var(--bs-secondary-color); } .caelrik-map-popup-name { margin: 0 0 0.25rem; font-weight: 600; } .caelrik-map-popup-description { margin: 0 0 0.25rem; } // A pin drawn with CSS: a round head on a point, with a white ring (3:1 on any tile). .caelrik-map-marker { --caelrik-map-pin: var(--bs-primary); border-radius: 50%; background: none; border: 0; &:focus-visible { outline: 3px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; } } .caelrik-map-pin { position: absolute; top: 2px; left: 4px; width: 20px; height: 20px; border: 2px solid #fff; border-radius: 50% 50% 50% 0; background-color: var(--caelrik-map-pin); box-shadow: 0 1px 3px rgb(0 0 0 / 0.5); transform: rotate(-45deg); &::after { content: ''; position: absolute; top: 5px; left: 5px; width: 6px; height: 6px; border-radius: 50%; background-color: #fff; } } @each $color, $value in ( 'primary': var(--bs-primary), 'secondary': var(--bs-secondary), 'success': var(--bs-success), 'danger': var(--bs-danger), 'warning': #b78103, 'info': #087990 ) { .caelrik-map-marker-#{$color}, .caelrik-map-place-#{$color} { --caelrik-map-pin: #{$value}; } } // The list of places: a pin's color beside each name, as on the map. .caelrik-map-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.5rem 1rem; margin: 0.75rem 0 0; padding: 0; list-style: none; } .caelrik-map-place { position: relative; padding: 0.5rem 0.75rem 0.5rem 1.5rem; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); &::before { content: ''; position: absolute; top: 0.85rem; left: 0.6rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background-color: var(--caelrik-map-pin); } } .caelrik-map-place-name { margin: 0; font-weight: 600; } .caelrik-map-place-description { margin: 0; color: var(--bs-secondary-color); font-size: 0.875rem; } .caelrik-map-place-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-top: 0.375rem; font-size: 0.875rem; } html:not(.caelrik-js) .caelrik-map-show { display: none; } @media (forced-colors: active) { .caelrik-map-pin { forced-color-adjust: none; border-color: Canvas; background-color: CanvasText; &::after { background-color: Canvas; } } .caelrik-map-canvas .leaflet-bar a, .caelrik-map-canvas .leaflet-popup-content-wrapper { border: 1px solid CanvasText; } } // Org chart (Components\OrgChart): nested lists drawn as a tree. The connectors are borders // (kept in forced-colors mode); a narrow container shows an indented list instead. .caelrik-orgchart { --caelrik-orgchart-line: var(--bs-secondary-color); --caelrik-orgchart-step: 1.25rem; container-type: inline-size; margin-bottom: 1rem; } .caelrik-orgchart-label { margin: 0 0 0.5rem; font-weight: 600; } .caelrik-orgchart-scroll { overflow-x: auto; padding: 0.25rem 0 0.5rem; &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; } } .caelrik-orgchart-tree, .caelrik-orgchart-team { display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; } .caelrik-orgchart-tree { width: max-content; min-width: 100%; gap: 1.5rem; } .caelrik-orgchart-team { position: relative; padding-top: var(--caelrik-orgchart-step); &[hidden] { display: none; } // From the manager down to the line over their team. &::before { content: ''; position: absolute; top: 0; left: 50%; height: var(--caelrik-orgchart-step); border-left: 2px solid var(--caelrik-orgchart-line); } } .caelrik-orgchart-item { display: flex; flex-direction: column; align-items: center; } // Each member of a team: half of the line over the team on each side, and a line down. .caelrik-orgchart-team > .caelrik-orgchart-item { position: relative; padding: var(--caelrik-orgchart-step) 0.375rem 0; &::before, &::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: var(--caelrik-orgchart-step); border-top: 2px solid var(--caelrik-orgchart-line); } &::after { right: auto; left: 50%; border-left: 2px solid var(--caelrik-orgchart-line); } &:first-child::before, &:last-child::after { border: 0; } &:last-child::before { border-right: 2px solid var(--caelrik-orgchart-line); border-radius: 0 0.375rem 0 0; } &:first-child::after { border-radius: 0.375rem 0 0; } &:only-child { padding-top: 0; &::before, &::after { display: none; } } } // A person: their picture, name and job title, and the button for their team. .caelrik-orgchart-node { position: relative; display: inline-flex; align-items: center; gap: 0.625rem; min-width: 11rem; max-width: 16rem; padding: 0.5rem 0.75rem; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); background-color: var(--bs-body-bg); box-shadow: var(--bs-box-shadow-sm); text-align: start; } .caelrik-orgchart-text { flex: 1 1 auto; min-width: 0; } .caelrik-orgchart-name, .caelrik-orgchart-title { margin: 0; overflow-wrap: anywhere; } .caelrik-orgchart-name { font-weight: 600; line-height: 1.3; } .caelrik-orgchart-title { color: var(--bs-secondary-color); font-size: 0.8125rem; } // A 24px target (WCAG 2.5.8), with the team's size and a chevron that turns. .caelrik-orgchart-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 0.25rem; min-width: 1.5rem; min-height: 1.5rem; padding: 0 0.375rem; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: 50rem; background-color: var(--bs-tertiary-bg); color: var(--bs-body-color); font-size: 0.75rem; font-variant-numeric: tabular-nums; &:hover { background-color: var(--bs-secondary-bg); } &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; } } .caelrik-orgchart-chevron { width: 0.4rem; height: 0.4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-0.1rem) rotate(45deg); [aria-expanded='false'] > & { transform: rotate(-45deg); } } html:not(.caelrik-js) .caelrik-orgchart-toggle { display: none; } // A narrow container: an indented list, each team along a line under its manager. @container (max-width: 36rem) { .caelrik-orgchart-tree, .caelrik-orgchart-team { display: block; } .caelrik-orgchart-tree { width: auto; } .caelrik-orgchart-team { margin-inline-start: 1rem; padding: 0 0 0 0.75rem; border-inline-start: 2px solid var(--caelrik-orgchart-line); &[hidden] { display: none; } &::before { display: none; } } .caelrik-orgchart-item { align-items: stretch; } .caelrik-orgchart-tree > .caelrik-orgchart-item + .caelrik-orgchart-item { margin-top: 0.5rem; } .caelrik-orgchart-team > .caelrik-orgchart-item { padding: 0.5rem 0 0; &::before, &::after { display: none; } } .caelrik-orgchart-node { display: flex; max-width: none; } } @media (forced-colors: active) { .caelrik-orgchart { --caelrik-orgchart-line: CanvasText; } .caelrik-orgchart-toggle { border-color: ButtonText; } } // Diagram (Components\Diagram): a flowchart drawn by PHP, and its steps as text. .caelrik-diagram { margin: 0 0 1rem; } // The drawing shrinks to its container; it never grows past its own size. .caelrik-diagram-svg { display: block; max-width: 100%; height: auto; margin-inline: auto; } .caelrik-diagram-shape { fill: var(--bs-tertiary-bg); stroke: var(--bs-secondary-color); stroke-width: 1.5; } @each $color in primary, secondary, success, danger, warning, info { .caelrik-diagram-#{$color} { fill: var(--bs-#{$color}-bg-subtle); stroke: var(--bs-#{$color}-text-emphasis); } } .caelrik-diagram-text { fill: var(--bs-body-color); font-size: 13px; } .caelrik-diagram-edge { fill: none; stroke: var(--bs-secondary-color); stroke-width: 1.5; &.is-loop { stroke-dasharray: 5 4; } } .caelrik-diagram-arrowhead { fill: var(--bs-secondary-color); } .caelrik-diagram-edge-label { rect { fill: var(--bs-body-bg); stroke: var(--bs-border-color); } text { fill: var(--bs-body-color); font-size: 12px; } } .caelrik-diagram-caption { margin-top: 0.5rem; color: var(--bs-secondary-color); font-size: 0.875rem; text-align: center; } .caelrik-diagram-details { margin-top: 0.5rem; > summary { width: fit-content; color: var(--bs-link-color); cursor: pointer; &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 2px; } } } .caelrik-diagram-steps { margin: 0.5rem 0 0; li { margin-bottom: 0.25rem; &:target { background-color: var(--bs-highlight-bg, var(--bs-warning-bg-subtle)); } } } .caelrik-diagram-step { font-weight: 600; } .caelrik-diagram-tag { color: var(--bs-secondary-color); font-size: 0.875em; } .caelrik-diagram-links { display: block; font-size: 0.875rem; } @media (forced-colors: active) { .caelrik-diagram-svg { forced-color-adjust: none; } .caelrik-diagram-shape[class], .caelrik-diagram-edge-label rect { fill: Canvas; stroke: CanvasText; } .caelrik-diagram-text, .caelrik-diagram-edge-label text, .caelrik-diagram-arrowhead { fill: CanvasText; } .caelrik-diagram-edge { stroke: CanvasText; } } // QR code and barcode (Components\QrCode, Components\Barcode): drawn by PHP, with their value // as text. The code stays dark on a light tile in dark mode and in forced colors: scanners // need that contrast. .caelrik-qrcode, .caelrik-barcode { display: inline-flex; flex-direction: column; align-items: center; gap: 0.5rem; max-width: 100%; margin: 0 0 1rem; vertical-align: top; } .caelrik-qrcode-image, .caelrik-barcode-image { display: block; max-width: 100%; height: auto; forced-color-adjust: none; } .caelrik-qrcode-image { border-radius: var(--bs-border-radius-sm); } .caelrik-qrcode-light, .caelrik-barcode-light { fill: #fff; } .caelrik-qrcode-dark, .caelrik-barcode-dark { fill: #000; } // The caption takes the width of the code, however long the value. .caelrik-qrcode-caption, .caelrik-barcode-caption { inline-size: 0; min-inline-size: 100%; text-align: center; overflow-wrap: anywhere; } .caelrik-qrcode-label, .caelrik-barcode-label { display: block; font-weight: 600; } .caelrik-qrcode-value, .caelrik-barcode-value { display: block; font-family: var(--bs-font-monospace); font-size: 0.875rem; } .caelrik-barcode-value { letter-spacing: 0.1em; } a.caelrik-qrcode-value { padding-block: 0.125rem; line-height: 1.25rem; } // Signature (Field::signature()): a pad like a sheet of paper, light with dark ink in dark // mode and in forced colors too, with a line to sign on. The pad is drawn with the pointer // only (touch-action: none keeps a finger from scrolling the page); the name input is the // way for keyboards and screen readers. .caelrik-signature { max-width: 36rem; } .caelrik-signature-surface { position: relative; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); background: #fff; forced-color-adjust: none; // The line to sign on. &::after { position: absolute; right: 8%; bottom: 22%; left: 8%; border-bottom: 1px solid #6c757d; content: ''; pointer-events: none; } } .caelrik-signature-canvas { display: block; width: 100%; aspect-ratio: 3 / 1; cursor: crosshair; touch-action: none; } .caelrik-signature-clear { min-height: 24px; margin: 0.5rem 0 0.75rem; } @media (forced-colors: active) { .caelrik-signature-surface { border-color: CanvasText; } } // PDF viewer (Components\PdfViewer): a title and a download link, a toolbar, and the pages in // a scrolling area. Pages stay white like paper in dark mode; PDF.js sizes them by the CSSOM. .caelrik-pdf { display: flex; flex-direction: column; margin-bottom: 1rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); overflow: hidden; } .caelrik-pdf-header, .caelrik-pdf-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--bs-border-color); background: var(--bs-body-bg); } .caelrik-pdf-toolbar[hidden] { display: none; } .caelrik-pdf-title { margin: 0; font-weight: 600; overflow-wrap: anywhere; } .caelrik-pdf-tools { display: flex; align-items: center; gap: 0.375rem; } .caelrik-pdf-page-label { margin: 0; } .caelrik-pdf-page-input { width: 4.5rem; } .caelrik-pdf-zoom { width: auto; } .caelrik-pdf-tools .btn { min-width: 2rem; min-height: 2rem; } .caelrik-pdf-viewport { position: relative; height: 40rem; max-height: 85vh; padding: 1rem; overflow: auto; background: var(--bs-secondary-bg); &:focus-visible { outline: 0; box-shadow: inset var(--caelrik-focus-ring); } } .caelrik-pdf-sm .caelrik-pdf-viewport { height: 24rem; } .caelrik-pdf-lg .caelrik-pdf-viewport { height: 60rem; } .caelrik-pdf-page { position: relative; margin: 0 auto 1rem; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); &:last-child { margin-bottom: 0; } } .caelrik-pdf-canvas { display: block; } // Messages (loading, an error, no JavaScript) sit on the page's background, where links keep // their contrast. .caelrik-pdf-message { max-width: 40rem; margin: 0 auto; padding: 0.75rem 1rem; border-radius: var(--bs-border-radius); background: var(--bs-body-bg); } @media (forced-colors: active) { .caelrik-pdf-page { border: 1px solid CanvasText; forced-color-adjust: none; } } // The text layer of PDF.js (pdf_viewer.css, Apache-2.0): transparent text over the canvas, at // the place and size of the drawn text, for selection, search and screen readers. .caelrik-pdf .textLayer { --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); position: absolute; inset: 0; z-index: 0; overflow: clip; line-height: 1; text-align: initial; letter-spacing: normal; word-spacing: normal; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; :is(span, br) { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0% 0%; user-select: text; } > :not(.markedContent), .markedContent span:not(.markedContent) { --font-height: 0; --scale-x: 1; --rotate: 0deg; z-index: 1; font-size: calc(var(--text-scale-factor) * var(--font-height)); transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); } .markedContent { display: contents; } ::selection { background: rgb(0 0 255 / 0.25); color: transparent; } br::selection { background: transparent; } .endOfContent { position: absolute; inset: 100% 0 0; z-index: 0; display: block; cursor: default; user-select: none; } &.selecting .endOfContent { top: 0; } } // Media player (Components\MediaPlayer): Plyr in the theme's colors, its caption and the // transcript. The line being spoken is marked by a bar and bold text, not by color alone. .caelrik-media { --plyr-color-main: var(--bs-primary); --plyr-font-family: var(--bs-body-font-family); --plyr-audio-controls-background: var(--bs-body-bg); --plyr-audio-control-color: var(--bs-body-color); --plyr-menu-background: var(--bs-body-bg); --plyr-menu-color: var(--bs-body-color); margin: 0 0 1rem; } .caelrik-media-frame { overflow: hidden; border-radius: var(--bs-border-radius); background: #000; video { display: block; width: 100%; } } .caelrik-media-audio .caelrik-media-frame { border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); audio { display: block; width: 100%; } } .caelrik-media-caption { margin-top: 0.5rem; font-weight: 600; } .caelrik-media-transcript { margin-top: 0.5rem; > summary { display: inline-flex; align-items: center; min-height: 24px; cursor: pointer; } } .caelrik-media-cues { max-height: 16rem; margin: 0.5rem 0 0; padding: 0; overflow-y: auto; list-style: none; } .caelrik-media-cue { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.125rem 0.5rem; border-left: 3px solid transparent; &[aria-current='true'] { border-left-color: var(--bs-primary-text-emphasis); background: var(--bs-primary-bg-subtle); font-weight: 600; } } .caelrik-media-seek { min-width: 3.5rem; min-height: 24px; padding: 0 0.25rem; font-variant-numeric: tabular-nums; color: var(--bs-link-color); text-align: start; } .caelrik-media-time { font-variant-numeric: tabular-nums; } .caelrik-media-speaker { font-weight: 600; } @media (forced-colors: active) { .caelrik-media-cue[aria-current='true'] { border-left-color: Highlight; } } // Markdown field (Field::markdown()): Write and Preview tabs and a formatting toolbar above // the textarea, in one bordered box. The selected tab is marked by a bar and bold text. .caelrik-markdown { border: var(--bs-border-width) solid var(--caelrik-input-border, var(--bs-border-color)); border-radius: var(--bs-border-radius); background: var(--bs-body-bg); .caelrik-markdown-source { border: 0; border-radius: 0 0 var(--bs-border-radius) var(--bs-border-radius); } &:has(.is-invalid) { border-color: var(--bs-form-invalid-border-color); } } // The server error follows the box, not the textarea (Bootstrap shows it after an invalid // control). .caelrik-markdown:has(.is-invalid) ~ .invalid-feedback { display: block; } .caelrik-markdown-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.25rem; padding: 0.25rem 0.25rem 0; border-bottom: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0; background: var(--bs-tertiary-bg); } .caelrik-markdown-tabs { display: flex; } .caelrik-markdown-tab { min-height: 2rem; padding: 0.25rem 0.75rem; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--bs-body-color); &[aria-selected='true'] { border-bottom-color: var(--bs-primary-text-emphasis); font-weight: 600; } } .caelrik-markdown-toolbar { display: flex; flex-wrap: wrap; gap: 0.125rem; padding-bottom: 0.25rem; &[hidden] { display: none; } } .caelrik-markdown-action { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2rem; padding: 0; color: var(--bs-body-color); &:hover { background: var(--bs-secondary-bg); } svg { fill: none; stroke: currentcolor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; } } .caelrik-markdown-preview { padding: 0.375rem 0.75rem; overflow-wrap: anywhere; > :last-child { margin-bottom: 0; } img { max-width: 100%; } pre { padding: 0.5rem; border-radius: var(--bs-border-radius-sm); background: var(--bs-tertiary-bg); } blockquote { padding-left: 0.75rem; border-left: 3px solid var(--bs-border-color); color: var(--bs-secondary-color); } } .caelrik-markdown-empty { color: var(--bs-secondary-color); } @media (forced-colors: active) { .caelrik-markdown-tab[aria-selected='true'] { border-bottom-color: Highlight; } } // Code field (Field::code(), CodeMirror 6): a bordered box with the field's focus ring and // error border. Syntax colors keep 4.5:1 on the page in light and dark mode, and the theme of // form-code.js uses these variables. .caelrik-code { --caelrik-code-selection: #b6d4fe; --caelrik-code-active-line: rgb(13 110 253 / 0.06); --caelrik-code-match: #fff3cd; --caelrik-code-keyword: #cf222e; --caelrik-code-string: #0a3069; --caelrik-code-comment: #57606a; --caelrik-code-number: #0550ae; --caelrik-code-function: #8250df; --caelrik-code-type: #953800; --caelrik-code-tag: #116329; --caelrik-code-property: #0550ae; --caelrik-code-link: #0969da; overflow: hidden; border: var(--bs-border-width) solid var(--caelrik-input-border, var(--bs-border-color)); border-radius: var(--bs-border-radius); &:focus-within { border-color: var(--bs-primary); box-shadow: var(--caelrik-focus-ring, 0 0 0 0.25rem rgb(13 110 253 / 0.25)); } &.is-invalid { border-color: var(--bs-form-invalid-border-color); } .cm-editor { min-height: 12rem; max-height: 32rem; } .cm-scroller { overflow: auto; } } [data-bs-theme='dark'] .caelrik-code { --caelrik-code-selection: #1f4c8f; --caelrik-code-active-line: rgb(255 255 255 / 0.05); --caelrik-code-match: #5c4813; --caelrik-code-keyword: #ff7b72; --caelrik-code-string: #a5d6ff; --caelrik-code-comment: #8b949e; --caelrik-code-number: #79c0ff; --caelrik-code-function: #d2a8ff; --caelrik-code-type: #ffa657; --caelrik-code-tag: #7ee787; --caelrik-code-property: #79c0ff; --caelrik-code-link: #58a6ff; } .caelrik-code-keyword { color: var(--caelrik-code-keyword); } .caelrik-code-string { color: var(--caelrik-code-string); } .caelrik-code-comment { color: var(--caelrik-code-comment); font-style: italic; } .caelrik-code-number { color: var(--caelrik-code-number); } .caelrik-code-function { color: var(--caelrik-code-function); } .caelrik-code-type { color: var(--caelrik-code-type); } .caelrik-code-tag { color: var(--caelrik-code-tag); } .caelrik-code-property { color: var(--caelrik-code-property); } .caelrik-code-strong { font-weight: 700; } .caelrik-code-emphasis { font-style: italic; } .caelrik-code-link { color: var(--caelrik-code-link); text-decoration: underline; } .caelrik-code-invalid { text-decoration: underline wavy var(--bs-danger); } @media (forced-colors: active) { .caelrik-code { border-color: CanvasText; } } // Image editor (Field::file()->imageEditor()): tools, the picture with its crop area (the // rest darkened), and the crop's numbers. The crop area has dark, light and dark lines inside // its edges, seen on any picture (thicker with focus), and corners of 24px inside it: nothing // is cut by the picture's edges. .caelrik-image-editor { margin-top: 0.75rem; padding: 0.75rem; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); } .caelrik-image-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin-bottom: 0.75rem; .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2rem; } svg { fill: none; stroke: currentcolor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; } } .caelrik-image-ratio-group { display: inline-flex; align-items: center; gap: 0.375rem; &[hidden] { display: none; } } .caelrik-image-ratio { width: auto; } .caelrik-image-stage { position: relative; max-width: 100%; overflow: hidden; background: var(--bs-secondary-bg); touch-action: none; user-select: none; } .caelrik-image-canvas { display: block; width: 100%; height: auto; } .caelrik-image-crop { position: absolute; box-shadow: inset 0 0 0 1px #000, inset 0 0 0 3px #fff, inset 0 0 0 4px #000, 0 0 0 100vmax rgb(0 0 0 / 0.5); cursor: move; &:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #000, inset 0 0 0 5px #fff, inset 0 0 0 7px #000, 0 0 0 100vmax rgb(0 0 0 / 0.5); } } .caelrik-image-handle { position: absolute; width: 24px; height: 24px; border: 2px solid #000; background: #fff; &-nw { top: 0; left: 0; cursor: nwse-resize; } &-ne { top: 0; right: 0; cursor: nesw-resize; } &-sw { bottom: 0; left: 0; cursor: nesw-resize; } &-se { right: 0; bottom: 0; cursor: nwse-resize; } } .caelrik-image-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); gap: 0.5rem; max-width: 32rem; margin: 0; .form-label { margin-bottom: 0.125rem; } } .caelrik-image-result { margin: 0.5rem 0 0; } @media (forced-colors: active) { .caelrik-image-crop { outline: 3px solid Highlight; outline-offset: -3px; } .caelrik-image-handle { border-color: CanvasText; background: Canvas; } } // Timeline (Components\Timeline): an ordered list along a line. Plain HTML. .caelrik-timeline { --caelrik-timeline-rail: 1.75rem; margin: 0 0 1rem; padding: 0; list-style: none; } .caelrik-timeline-event { position: relative; display: grid; grid-template-columns: var(--caelrik-timeline-rail) minmax(0, 1fr); column-gap: 0.75rem; padding-bottom: 1.5rem; // The line, from this marker down to the next one: a border, which forced colors keep. &::before { content: ''; position: absolute; top: 0.75rem; bottom: -0.75rem; inset-inline-start: calc(var(--caelrik-timeline-rail) / 2 - 1px); border-inline-start: 2px solid var(--bs-border-color); } &:last-child { padding-bottom: 0; &::before { display: none; } } } .caelrik-timeline-marker { position: relative; z-index: 1; justify-self: center; width: 0.875rem; height: 0.875rem; margin-top: 0.3125rem; border: 2px solid var(--bs-primary); border-radius: 50%; background-color: var(--bs-body-bg); // A text marker ("?", "3") keeps an AA contrast: a subtle background, an emphasis color. &.has-text { display: inline-flex; align-items: center; justify-content: center; width: var(--caelrik-timeline-rail); height: var(--caelrik-timeline-rail); margin-top: 0; border-color: var(--bs-primary-border-subtle); background-color: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-size: 0.8125rem; font-weight: 600; line-height: 1; } } @each $color in primary, secondary, success, danger, warning, info { .caelrik-timeline-marker-#{$color} { border-color: var(--bs-#{$color}); background-color: var(--bs-#{$color}); &.has-text { border-color: var(--bs-#{$color}-border-subtle); background-color: var(--bs-#{$color}-bg-subtle); color: var(--bs-#{$color}-text-emphasis); } } } // The current step: a ring around its marker (not only a color) and a bold title. .caelrik-timeline-event.is-current { .caelrik-timeline-marker { outline: 2px solid var(--bs-emphasis-color); outline-offset: 2px; } .caelrik-timeline-title { font-weight: 700; } } .caelrik-timeline-body { min-width: 0; } .caelrik-timeline-title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.5; } .caelrik-timeline-time { display: block; margin: 0; color: var(--bs-secondary-color); font-size: 0.875rem; } .caelrik-timeline-content { margin-top: 0.25rem; > :last-child { margin-bottom: 0; } } // Both sides of the line on wide screens; one side on phones. @media (min-width: 768px) { .caelrik-timeline-alternate .caelrik-timeline-event { grid-template-columns: minmax(0, 1fr) var(--caelrik-timeline-rail) minmax(0, 1fr); &::before { inset-inline-start: calc(50% - 1px); } .caelrik-timeline-marker { grid-row: 1; grid-column: 2; } .caelrik-timeline-body { grid-row: 1; grid-column: 3; } &:nth-child(even) .caelrik-timeline-body { grid-column: 1; text-align: end; } } } // Carousel (Components\Carousel): its controls come first (the rotation button is reached // before the slides) and are shown under the slides. .caelrik-carousel { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; } .caelrik-carousel-controls { display: flex; flex-wrap: wrap; order: 1; align-items: center; justify-content: center; gap: 0.5rem; } html:not(.caelrik-js) .caelrik-carousel-controls { display: none; } // Without JavaScript the slides are shown one under the other. With it, they share one // cell: the carousel keeps the height of its tallest slide, and only one is shown. .caelrik-carousel-slides { display: grid; gap: 1rem; min-width: 0; } .caelrik-js .caelrik-carousel-slide { grid-area: 1 / 1; min-width: 0; visibility: hidden; opacity: 0; transition: opacity 0.35s ease, visibility 0s linear 0.35s; &.is-active { visibility: visible; opacity: 1; transition: opacity 0.35s ease; } } .caelrik-carousel-previous, .caelrik-carousel-next, .caelrik-carousel-rotate { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2rem; &[aria-disabled='true'] { opacity: 0.5; cursor: default; } } .caelrik-carousel:not(.is-playing) .caelrik-carousel-icon-pause, .caelrik-carousel.is-playing .caelrik-carousel-icon-play { display: none; } [dir='rtl'] .caelrik-carousel-previous .caelrik-carousel-icon, [dir='rtl'] .caelrik-carousel-next .caelrik-carousel-icon { transform: scaleX(-1); } .caelrik-carousel-picker { display: flex; flex-wrap: wrap; justify-content: center; } // A 24px target (WCAG 2.5.8); the current slide's dot is filled, the others are rings. .caelrik-carousel-dot { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--bs-secondary-color); &::before { content: ''; width: 0.625rem; height: 0.625rem; border: 2px solid currentColor; border-radius: 50%; } &:hover { background-color: var(--bs-tertiary-bg); color: var(--bs-body-color); } &[aria-current='true'] { color: var(--bs-primary-text-emphasis); &::before { width: 0.75rem; height: 0.75rem; background-color: currentColor; } } &:focus-visible { outline: 2px solid var(--bs-focus-ring-color, var(--bs-primary)); outline-offset: 1px; } } .caelrik-carousel-figure { margin: 0; } .caelrik-carousel-image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--bs-border-radius); object-fit: cover; } @each $name, $ratio in ('4x3': 4 / 3, '3x2': 3 / 2, '21x9': 21 / 9, '1x1': 1) { .caelrik-carousel-ratio-#{$name} .caelrik-carousel-image { aspect-ratio: $ratio; } } .caelrik-carousel-caption { margin-top: 0.5rem; color: var(--bs-secondary-color); font-size: 0.875rem; text-align: center; } @media (prefers-reduced-motion: reduce) { .caelrik-js .caelrik-carousel-slide, .caelrik-js .caelrik-carousel-slide.is-active { transition: none; } } @media (forced-colors: active) { .caelrik-timeline-marker { forced-color-adjust: none; border-color: CanvasText; background-color: Canvas; color: CanvasText; } .caelrik-timeline-marker[class*='caelrik-timeline-marker-']:not(.has-text) { background-color: CanvasText; } .caelrik-timeline-event.is-current .caelrik-timeline-marker { outline-color: Highlight; } .caelrik-carousel-dot { forced-color-adjust: none; color: CanvasText; &[aria-current='true'] { color: Highlight; } } } // Small screens: one column, each tile as high as its content. @media (max-width: 767.98px) { .caelrik-tilelayout { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; > .caelrik-tile { grid-column: auto; grid-row: auto; } } .caelrik-tile-grip { display: none; } } // A grid's empty state (Grid::emptyState()) and its "no rows match" state, in the table's // only row. .caelrik-grid .caelrik-grid-empty { padding: 1.5rem 1rem; text-align: center; white-space: normal; } .caelrik-grid-empty-title { margin-bottom: 0.25rem; font-weight: 600; } .caelrik-grid-empty-description { margin-bottom: 0; color: var(--bs-secondary-color); } .caelrik-grid-empty-action { margin-top: 0.75rem; } // Column totals (Column::total()) in the footer and in group headings (Grid::groupBy()). .caelrik-grid tfoot td { border-top: 2px solid var(--bs-border-color); font-weight: 600; } .caelrik-grid-total { white-space: nowrap; } .caelrik-grid-total-label { margin-right: 0.25rem; color: var(--bs-secondary-color); font-size: 0.875em; font-weight: 400; } .caelrik-grid-total-value { font-variant-numeric: tabular-nums; } // A group's heading row: its name, its row count and its totals. .caelrik-grid .caelrik-grid-group > * { background-color: var(--bs-tertiary-bg); --bs-table-bg-type: var(--bs-tertiary-bg); --bs-table-bg-state: var(--bs-tertiary-bg); } .caelrik-grid-group th { font-weight: 600; } .caelrik-grid-group-count { margin-left: 0.25rem; color: var(--bs-secondary-color); font-size: 0.875em; font-weight: 400; } // An action that opens a form (Action::form()) needs JavaScript: hidden without it. html:not(.caelrik-js) form[data-caelrik-form-modal] { display: none; } // Inline editing (Column::editable()): the edit button shows once DataTables runs, as it needs // the grid's JavaScript. It is 24px for WCAG 2.5.8, beside the value. .caelrik-grid:not(.dataTable) .caelrik-grid-edit { display: none; } .caelrik-grid-edit { min-width: 1.5rem; min-height: 1.5rem; margin-left: 0.25rem; padding: 0.125rem 0.25rem; line-height: 1; vertical-align: baseline; color: var(--bs-secondary-color); &:hover, &:focus-visible { color: var(--bs-link-color); } } .caelrik-grid-editor { min-width: 8rem; .invalid-feedback { white-space: normal; } } td[aria-busy='true'] .caelrik-grid-editor { opacity: 0.65; } // A grid's Columns menu (Grid::columnToggle()): a panel of checkboxes under its button. .caelrik-grid-columns { position: relative; display: inline-block; } .caelrik-grid-columns-panel { position: absolute; top: calc(100% + 0.25rem); left: 0; z-index: 1000; min-width: 12rem; max-height: 20rem; padding: 0.75rem 1rem; margin: 0; overflow-y: auto; color: var(--bs-body-color); background-color: var(--bs-body-bg); border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--caelrik-radius); .form-check:last-child { margin-bottom: 0; } } // A grid's actions column: as narrow as its buttons, which stay on one line when they fit. .caelrik-grid .caelrik-grid-actions { width: 1%; white-space: nowrap; } .caelrik-grid-action-list { display: flex; flex-wrap: wrap; gap: 0.25rem; } // The grid's filter bar (Column::filter()). Clear filters: Bootstrap's outline-secondary // text is #6c757d, 3.3:1 on its dark background; the body color and the field border // (3:1) keep it readable in both modes. .caelrik-grid-filters { legend { float: none; } .btn-outline-secondary { --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--caelrik-input-border); } } // Keyboard focus must stay visible on sortable headers (WCAG 2.4.7). .dt-container th.dt-orderable-asc, .dt-container th.dt-orderable-desc { &:focus-visible { outline: 0; box-shadow: var(--caelrik-focus-ring); } } .caelrik-chart { margin: 0 0 1rem; border-radius: var(--caelrik-radius); box-shadow: var(--caelrik-surface-shadow); &__canvas { position: relative; min-height: var(--caelrik-chart-min-height); } // Without a fixed height, the container keeps the chart's shape as its width changes. &__canvas--wide { aspect-ratio: 2 / 1; } &__canvas--square { aspect-ratio: 1; } } // FullCalendar reads its colors from CSS variables: map them to Bootstrap's. .caelrik-scheduler { --fc-border-color: var(--bs-border-color); --fc-page-bg-color: var(--bs-body-bg); --fc-neutral-bg-color: var(--bs-tertiary-bg); --fc-list-event-hover-bg-color: var(--bs-tertiary-bg); --fc-today-bg-color: var(--caelrik-scheduler-today-bg); // FullCalendar's default is a fixed light grey, which shows as pale blocks in dark mode. --fc-non-business-color: rgba(var(--bs-emphasis-color-rgb), 0.05); --fc-highlight-color: rgba(var(--bs-primary-rgb), 0.15); --fc-event-bg-color: var(--bs-primary); --fc-event-border-color: var(--bs-primary); // The toolbar buttons are flat (see _flat.scss). .fc-button:focus-visible { box-shadow: var(--caelrik-focus-ring); } .fc-toolbar-title { font-size: var(--caelrik-scheduler-title-font-size); } // FullCalendar fades days of other months to 30% opacity, far below 4.5:1 (WCAG 1.4.3). // The muted text color still sets them apart. .fc-day-other .fc-daygrid-day-top { opacity: 1; } // Day numbers are links: Bootstrap's link color passes on white (4.5:1) but not on // today's tinted background (4.03:1 in the Bootstrap theme). .fc-daygrid-day-number { color: var(--bs-body-color); } .fc-day-other .fc-daygrid-day-number { color: var(--bs-secondary-color); } // Dot events (timed events in month view) are links: Bootstrap gives them the link // color, which is too light on today's tinted background. .fc-daygrid-dot-event { color: var(--bs-body-color); } } // Event dialog (scheduler-dialog.js): a native <dialog> in the top layer, on Bootstrap colors. // The scheduler's event dialog and an action's confirmation (action.js). .caelrik-scheduler-dialog, .caelrik-action-dialog { width: min(28rem, calc(100vw - 2rem)); padding: 1.5rem; color: var(--bs-body-color); background-color: var(--bs-body-bg); border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--caelrik-radius); box-shadow: var(--bs-box-shadow-lg); &::backdrop { background-color: rgba(0, 0, 0, 0.5); } // Bootstrap's outline-danger text is always #dc3545: below 4.5:1 on every dark // background. The danger text-emphasis color follows the mode. .btn-outline-danger { --bs-btn-color: var(--bs-danger-text-emphasis); --bs-btn-border-color: var(--bs-danger-text-emphasis); } } .caelrik-form { .caelrik-required { color: var(--caelrik-required-color); } // Tab reaches the browser's calendar or clock button inside a date or time input: the // input is then not :focus, only :focus-within, and Bootstrap's focus ring disappears. .form-control:is([type='date'], [type='time'], [type='datetime-local']):focus-within { box-shadow: var(--caelrik-focus-ring); } // Bootstrap compiles the slider thumb's color: follow the theme's primary color. // One rule per vendor pseudo-element: a browser drops a selector list it cannot parse. .form-range { &::-webkit-slider-thumb { background-color: var(--bs-primary); } &::-webkit-slider-thumb:active { background-color: color-mix(in srgb, var(--bs-primary) 70%, var(--bs-body-bg)); } &:focus::-webkit-slider-thumb { box-shadow: var(--caelrik-focus-ring); } &::-moz-range-thumb { background-color: var(--bs-primary); } &::-moz-range-thumb:active { background-color: color-mix(in srgb, var(--bs-primary) 70%, var(--bs-body-bg)); } &:focus::-moz-range-thumb { box-shadow: var(--caelrik-focus-ring); } } // Sections and fieldsets (Section::make(), Section::fieldset()). Their last field's // margin is the bottom padding. .caelrik-form-section > .card-body:not(summary) { padding-bottom: 0; } .caelrik-form-fieldset { padding: 0.25rem 1rem 0; border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--caelrik-radius); } // Bootstrap's legend floats across the full width: put it back on the border. .caelrik-form-legend { float: none; width: auto; padding: 0 0.5rem; margin: 0 0 0.5rem -0.5rem; font-size: 1rem; font-weight: 600; } // A collapsible section's summary is both its heading and its button. .caelrik-form-summary { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0; cursor: pointer; border-radius: inherit; list-style: none; &::-webkit-details-marker { display: none; } // A chevron: right when closed, down when open. &::before { flex-shrink: 0; width: 0.5em; height: 0.5em; content: ''; border-right: 2px solid currentcolor; border-bottom: 2px solid currentcolor; transform: rotate(-45deg); transition: transform 0.2s; } &:focus-visible { outline: 0; box-shadow: var(--caelrik-focus-ring); } @media (prefers-reduced-motion: reduce) { &::before { transition: none; } } } // Repeater (Repeater::make()): a card per row, its name on the left and its buttons on // the right, then its fields. The last field's margin is the bottom padding. .caelrik-repeater-items { display: grid; gap: 0.75rem; padding: 0; margin: 0 0 0.75rem; list-style: none; &:empty { margin: 0; } } .caelrik-repeater-item > .card-body { padding-bottom: 0; } // Remove: Bootstrap's outline-danger text is #dc3545, under 4.5:1 on dark backgrounds // (see .caelrik-scheduler-dialog). .caelrik-repeater-actions .btn-outline-danger { --bs-btn-color: var(--bs-danger-text-emphasis); --bs-btn-border-color: var(--bs-danger-text-emphasis); } // Add: the same for outline-primary, 3.4:1 on Bootstrap's dark background. .caelrik-repeater > fieldset > .btn-outline-primary, .caelrik-key-value .btn-outline-primary { --bs-btn-color: var(--bs-primary-text-emphasis); --bs-btn-border-color: var(--bs-primary-text-emphasis); } .caelrik-repeater-label { float: left; width: auto; margin: 0 0 0.75rem; font-size: 1rem; font-weight: 600; line-height: 2rem; } .caelrik-repeater-actions { display: flex; float: right; // Bootstrap's reboot clears whatever follows a legend. clear: none; gap: 0.25rem; margin-bottom: 0.75rem; + * { clear: both; } } // Wizard (Form::wizard()): the step indicator, numbers joined by a line. The current // step uses the theme's subtle primary pair, which has enough contrast in both modes. .caelrik-wizard-steps { display: flex; gap: 0.5rem; padding: 0; margin: 0 0 1.5rem; list-style: none; > li { display: flex; flex: 1 1 0; gap: 0.5rem; align-items: center; min-width: 0; color: var(--bs-secondary-color); &:last-child { flex-grow: 0; } &:not(:last-child)::after { flex: 1 1 1rem; min-width: 1rem; height: var(--bs-border-width); content: ''; background-color: var(--bs-border-color); } &.is-complete::after { background-color: var(--bs-primary); } } [aria-current='step'] { font-weight: 600; color: var(--bs-body-color); } } .caelrik-wizard-number { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 2px solid var(--bs-border-color); border-radius: 50%; } .caelrik-wizard-steps .is-complete .caelrik-wizard-number { color: var(--bs-primary-text-emphasis); border-color: var(--bs-primary); } .caelrik-wizard-steps [aria-current='step'] .caelrik-wizard-number { color: var(--bs-primary-text-emphasis); background-color: var(--bs-primary-bg-subtle); border-color: var(--bs-primary); } // A step's heading takes focus to be announced; it is not a control, so no focus mark. .caelrik-wizard-step [tabindex='-1']:focus { outline: 0; } .caelrik-wizard-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } // On phones, only the current step is named. @media (width < 576px) { .caelrik-wizard-steps > li:not([aria-current='step']) .caelrik-wizard-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } } .caelrik-wizard-nav { display: flex; gap: 0.5rem; // Next and submit on the right, Back on the left. [data-caelrik-wizard='next'], [type='submit'] { margin-left: auto; } } // Open: as close to its content as a section heading. .caelrik-form-section[open] > .caelrik-form-summary { padding-bottom: 0.25rem; &::before { transform: rotate(45deg); } } // One-time code (Field::otp()). Without JavaScript: a short input as wide as the code. .caelrik-otp-input { width: auto; font-variant-numeric: tabular-nums; letter-spacing: 0.25em; } // With form-otp.js: a box per character, the input transparent on top of them. The // boxes shrink to fit a narrow screen. .caelrik-otp { position: relative; width: 100%; max-width: calc(var(--caelrik-otp-length) * 3.25rem - 0.5rem); } .caelrik-otp-slots { display: flex; gap: 0.5rem; } .caelrik-otp-slot { display: flex; flex: 1 1 0; align-items: center; justify-content: center; min-width: 0; max-width: 2.75rem; height: 3rem; font-size: 1.25rem; font-variant-numeric: tabular-nums; background-color: var(--bs-body-bg); border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; } .caelrik-otp > .caelrik-otp-input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; // Transparent, not hidden: it keeps the focus, the clicks, paste and autofill. opacity: 0; } .caelrik-otp:focus-within .caelrik-otp-slot.is-active { border-color: var(--bs-primary); box-shadow: var(--caelrik-focus-ring); } // The caret, in the empty box being filled. .caelrik-otp:focus-within .caelrik-otp-slot.is-active:empty::after { width: 1px; height: 1.25rem; content: ''; background-color: currentColor; animation: caelrik-otp-caret 1s step-end infinite; } .caelrik-otp:has(.is-invalid) .caelrik-otp-slot { border-color: var(--bs-form-invalid-border-color); } // The server error follows the boxes, not the input (Bootstrap shows it after an // invalid input). .caelrik-otp:has(.is-invalid) ~ .invalid-feedback { display: block; } // Key-value list (Field::keyValue()): a row per pair, key | value | Remove. The column // names line up with the inputs; the Remove button is as tall as an input. .caelrik-key-value-head, .caelrik-key-value-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) calc(1.5em + 0.75rem + var(--bs-border-width) * 2); gap: 0.5rem; align-items: start; } .caelrik-key-value-head { margin-bottom: 0.25rem; font-size: 0.875em; color: var(--bs-secondary-color); } .caelrik-key-value-rows { display: grid; gap: 0.5rem; padding: 0; margin: 0 0 0.5rem; list-style: none; } .caelrik-key-value-row { position: relative; // A key's message (form.js) spans the row, under its inputs. > .invalid-feedback { grid-column: 1 / -1; margin-top: -0.25rem; } } .caelrik-key-value-remove { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: calc(1.5em + 0.75rem + var(--bs-border-width) * 2); padding: 0; } // Rating (Field::rating()): radio buttons, visually hidden, labelled by stars. The stars // up to the checked one are filled, and up to the hovered one while the pointer is on // them. Each star is a 2rem target (WCAG 2.5.8). .caelrik-rating-stars { display: inline-flex; align-items: center; vertical-align: middle; } .caelrik-rating-star { display: inline-flex; width: 2rem; height: 2rem; padding: 0.125rem; color: var(--caelrik-rating-color); cursor: pointer; border-radius: var(--bs-border-radius-sm); svg { width: 100%; height: 100%; fill: transparent; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; } } @for $n from 1 through 10 { .caelrik-rating-stars:has(> .caelrik-rating-input:nth-of-type(#{$n}):checked) > .caelrik-rating-star:nth-of-type(-n + #{$n}) svg { fill: currentColor; } } // Hover previews the rating: empty every star, then fill up to the hovered one. As // specific as the checked rule above, and after it. .caelrik-rating-stars:has(> .caelrik-rating-star:nth-of-type(n):hover) > .caelrik-rating-star:nth-of-type(n) svg { fill: transparent; } @for $n from 1 through 10 { .caelrik-rating-stars:has(> .caelrik-rating-star:nth-of-type(#{$n}):hover) > .caelrik-rating-star:nth-of-type(-n + #{$n}) svg { fill: currentColor; } } .caelrik-rating-input:focus-visible + .caelrik-rating-star { box-shadow: var(--caelrik-focus-ring); } .caelrik-rating-input.is-invalid + .caelrik-rating-star { color: var(--bs-form-invalid-color); } .caelrik-rating-clear { display: inline-block; margin-left: 0.75rem; vertical-align: middle; label { padding: 0.25rem 0; color: var(--bs-secondary-color); text-decoration: underline; cursor: pointer; } } .caelrik-rating-input:checked + label:not(.caelrik-rating-star) { color: var(--bs-body-color); text-decoration: none; } .caelrik-rating-input:focus-visible + label:not(.caelrik-rating-star) { border-radius: var(--bs-border-radius-sm); box-shadow: var(--caelrik-focus-ring); } } // Searchable selects (Tom Select, Bootstrap 5 theme). Its stylesheet loads with its chunk, // after caelrik.css, so these selectors are one class more specific. Its focus ring and // tag separators are fixed Bootstrap colors: follow the theme and the mode. .caelrik-form .ts-wrapper { &.focus .ts-control { border-color: color-mix(in srgb, var(--bs-primary) 50%, var(--bs-body-bg)); box-shadow: var(--caelrik-focus-ring); } // The matched text: Bootstrap's <mark> colors, which follow the mode (Tom Select's // translucent yellow is muddy under light text). .ts-dropdown .highlight { color: var(--bs-highlight-color); background-color: var(--bs-highlight-bg); } // The tag's remove button is a 24 x 24 px target (WCAG 2.5.8). &.plugin-remove_button .item .remove { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; padding: 0; border-left-color: var(--bs-border-color); } } // Rich text editor (Quill, snow theme) in Bootstrap form styling. .caelrik-editor { background-color: var(--bs-body-bg); border-bottom-left-radius: var(--caelrik-radius); border-bottom-right-radius: var(--caelrik-radius); .ql-editor { min-height: var(--caelrik-editor-min-height); font-size: 1rem; } } .ql-toolbar.ql-snow { border-top-left-radius: var(--caelrik-radius); border-top-right-radius: var(--caelrik-radius); } .ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--bs-border-color); } .ql-container.ql-snow:focus-within { box-shadow: var(--caelrik-focus-ring); } // Quill's icons and placeholder use fixed dark greys: follow the theme (dark mode). // Quill's stylesheet loads after caelrik.css, so these are one class more specific. .ql-toolbar.ql-snow { .ql-stroke, .ql-stroke-miter { stroke: var(--bs-body-color); } .ql-fill, .ql-stroke.ql-fill { fill: var(--bs-body-color); } .ql-picker { color: var(--bs-body-color); } .ql-picker-options { background-color: var(--bs-body-bg); } } .caelrik-editor.ql-snow .ql-editor.ql-blank::before { color: var(--bs-secondary-color); } .ql-container.ql-snow.is-invalid { border-color: var(--bs-form-invalid-border-color); } // File uploads (FilePond) on Bootstrap colors. .filepond--root { margin-bottom: 0.25rem; font-family: inherit; } .filepond--panel-root { background-color: var(--bs-tertiary-bg); border: 1px dashed var(--bs-border-color); } .filepond--drop-label { color: var(--bs-body-color); } .filepond--label-action { text-decoration-color: var(--bs-primary); } // Toasts (Notyf) on Bootstrap colors, with text colors that keep a 4.5:1 contrast. .notyf__toast.caelrik-toast { color: #fff; font-family: inherit; border-radius: var(--caelrik-radius); } .notyf__toast.caelrik-toast-warning, .notyf__toast.caelrik-toast-info { color: #000; .notyf__dismiss-btn::before, .notyf__dismiss-btn::after { background: #000; } } .notyf__dismiss-btn:focus-visible { outline: 2px solid currentcolor; outline-offset: 2px; } // Containers a custom theme can elevate or outline (its shadow token). .dt-container, .caelrik-scheduler, .caelrik-filemanager { border-radius: var(--caelrik-radius); box-shadow: var(--caelrik-surface-shadow); } // elFinder shows the selected folder grey on grey (3.2:1) while it does not have focus // (.elfinder-disabled). Its theme.css loads after caelrik.css, so these selectors are // one class more specific than elFinder's. elFinder has no dark mode (its panels stay // light), so the selection stays light too: dark text on a light tint of the primary. .caelrik-filemanager.elfinder { .elfinder-navbar .elfinder-navbar-dir.ui-state-active, .elfinder-navbar .elfinder-navbar-dir.ui-state-hover, .elfinder-cwd .elfinder-cwd-filename.ui-state-hover, .elfinder-cwd table td.ui-state-hover { color: #212529; background: color-mix(in srgb, var(--bs-primary) 18%, #fff); border-color: transparent; } } // elFinder's folder-tree expand arrow is 12 x 14 px: give it a 24 x 24 px hit area without // changing how it looks (WCAG 2.5.8, Target Size). The root folder's arrow is only 6 px // from the tree's edge, so the area also covers the edge of the folder icon next to it. .caelrik-filemanager.elfinder .elfinder-navbar-arrow::after { position: absolute; inset: -5px -6px; z-index: 1; content: ''; } // Theme builder: controls beside the preview on wide screens, stacked on small ones. .caelrik-theme-builder { display: grid; gap: 1.5rem; @media (min-width: 992px) { grid-template-columns: minmax(18rem, 26rem) minmax(0, 1fr); align-items: start; } &__canvas { padding: 1rem; color: var(--bs-body-color); background-color: var(--bs-body-bg); border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--caelrik-radius); } &__color .form-control-color { flex: 0 0 3rem; } &__pair.is-fail { font-weight: 600; } } @keyframes caelrik-otp-caret { 50% { opacity: 0; } } // Less motion when the user asks for it (WCAG 2.3.3). Bootstrap already removes its own // transitions (fades, modal slide). Notyf removes toasts on animationend, so its // animations are shortened rather than removed. Chart.js animation is turned off in JS. @media (prefers-reduced-motion: reduce) { .notyf__toast, .notyf__wrapper, .notyf__ripple, .notyf__message, .notyf__icon { animation-duration: 1ms !important; animation-delay: 0s !important; } .caelrik-otp-slot::after { animation: none !important; } .caelrik-scheduler *, .caelrik-filemanager *, .filepond--root * { transition-duration: 1ms !important; scroll-behavior: auto !important; } } // Forced-colors mode (Windows High Contrast) does not paint box-shadow, which Bootstrap // and the themes use for focus rings, nor author backgrounds. Show focus with an outline // and selection with system colors (WCAG 2.4.7, 1.4.11). @media (forced-colors: active) { // !important: FullCalendar and elFinder remove outlines with more specific selectors. :is(.dt-container, .caelrik-grid-filters, .caelrik-form, .caelrik-scheduler, .caelrik-scheduler-dialog, .caelrik-tabs, .caelrik-filemanager, .caelrik-theme-builder, .caelrik-action-dialog, .caelrik-modal, .caelrik-listview, .caelrik-treelist, .caelrik-board, .caelrik-admin, .caelrik-nav, .caelrik-usermenu, .caelrik-menubutton, .caelrik-splitbutton, .caelrik-toolbar, .caelrik-menu-list, .caelrik-accordion, .caelrik-splitter, .caelrik-tilelayout, .caelrik-chip-check, .caelrik-popover, .caelrik-carousel, .caelrik-gantt, .caelrik-map, .caelrik-orgchart, .caelrik-diagram, .caelrik-qrcode, .caelrik-pdf, .caelrik-media, .caelrik-markdown, .caelrik-code, .caelrik-image-editor, .notyf) :focus-visible, .caelrik-action-button:focus-visible, // A date field's focus is on its day, month and year parts or its calendar button, // inside the field: it matches :focus-within, not always :focus-visible. .caelrik-grid-filters input[type='date']:focus-within, [aria-haspopup='dialog'][data-bs-toggle='modal']:focus-visible { outline: 2px solid Highlight !important; outline-offset: 2px; } .caelrik-tree [role='treeitem']:focus-visible { outline: 2px solid Highlight; outline-offset: 1px; } .caelrik-tree [role='treeitem'][aria-selected='true'] { forced-color-adjust: none; color: HighlightText; background-color: Highlight; } // A picked-up card: a dashed system-colored outline (its dashed primary one is not painted). .caelrik-board-card.is-grabbed { outline: 3px dashed Highlight; } .ql-container.ql-snow:focus-within, .caelrik-modal:focus-visible .modal-content { outline: 2px solid Highlight; } // Date and time inputs: see .caelrik-form above. .caelrik-form :is(input[type='date'], input[type='time'], input[type='datetime-local']):focus-within { outline: 2px solid Highlight; outline-offset: 2px; } // A one-time code: the box being filled shows the focus (the input is transparent). .caelrik-otp:focus-within .caelrik-otp-slot.is-active { outline: 2px solid Highlight; outline-offset: 2px; } // A rating's focused star: its label shows the focus, not the hidden radio. .caelrik-rating-input:focus-visible + label { outline: 2px solid Highlight; outline-offset: 2px; } // A wizard's current and completed steps: their fill and color are not painted. .caelrik-wizard-steps [aria-current='step'] .caelrik-wizard-number { border-width: 3px; border-color: Highlight; } .caelrik-wizard-steps .is-complete::after { background-color: Highlight; } // A searchable select's search box is a small input inside the control: outline the // control, like its focus ring does. .caelrik-form .ts-wrapper.focus .ts-control { outline: 2px solid Highlight; outline-offset: 2px; } .caelrik-tabs .nav-link.active { border-bottom: 3px solid Highlight; } .caelrik-scheduler .fc-day-today { outline: 2px solid Highlight; outline-offset: -2px; } .caelrik-grid .page-item.active .page-link, .dt-container .page-item.active .page-link, .caelrik-listview-pager .page-item.active .page-link { forced-color-adjust: none; color: HighlightText; background-color: Highlight; } .caelrik-filemanager.elfinder .ui-state-active, .caelrik-filemanager.elfinder .ui-selected { forced-color-adjust: none; color: HighlightText; background: Highlight; } .notyf__toast { border: 1px solid CanvasText; } }