mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-30 04:09:20 +09:00
* Add optional always-visible graph action icons * Close visible graph submenus with Escape after Safari mouse clicks * Document graph action display preference (#8744) * Fix refreshed graph action labels and submenu stacking * Refresh realtime action names and repair browser test setup
180 lines
5.1 KiB
CSS
180 lines
5.1 KiB
CSS
/*
|
|
+-------------------------------------------------------------------------+
|
|
| Copyright (C) 2004-2026 The Cacti Group |
|
|
| |
|
|
| This program is free software; you can redistribute it and/or |
|
|
| modify it under the terms of the GNU General Public License |
|
|
| as published by the Free Software Foundation; either version 2 |
|
|
| of the License, or (at your option) any later version. |
|
|
+-------------------------------------------------------------------------+
|
|
*/
|
|
|
|
/*
|
|
* Common, theme-agnostic drilldown behaviour: the action icons are hidden
|
|
* behind a hamburger glyph overlaid on the top-right of the graph. Clicking
|
|
* the glyph opens the icon strip; it closes on a second click, on leaving the
|
|
* graph, or on an outside click (see initGraphDrilldown() in layout.js).
|
|
* Loaded after each theme's main.css so these rules win.
|
|
*/
|
|
|
|
.graphWrapperOuter > div:first-child {
|
|
position: relative;
|
|
width: -moz-fit-content;
|
|
width: fit-content;
|
|
max-width: 100%;
|
|
/* centre the fit-content graph within its (often full-width, single-column) wrapper */
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
|
|
.graphDrillDownToggle {
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-end;
|
|
width: auto;
|
|
height: auto;
|
|
padding: 0;
|
|
margin: 0;
|
|
z-index: 6;
|
|
}
|
|
|
|
/* While a strip is open, lift its graph above neighbours so the icons that
|
|
overflow a short (thumbnail) graph stay on top and clickable, and hovering them
|
|
does not fall through to the graph beneath. */
|
|
.graphWrapperOuter.graphDrillActive {
|
|
position: relative;
|
|
z-index: 10;
|
|
}
|
|
|
|
.graphDrillDownToggle .graphDrillDownMenu {
|
|
display: inline-block;
|
|
opacity: 0;
|
|
cursor: pointer;
|
|
margin: 3px;
|
|
padding: 2px 6px;
|
|
border-radius: 3px;
|
|
line-height: 1;
|
|
font-size: 13px;
|
|
color: var(--cacti-dd-fg, #ffffff);
|
|
background: var(--cacti-dd-menu-bg, rgba(0, 0, 0, 0.55));
|
|
box-shadow: 0 0 0 1px var(--cacti-dd-border, transparent);
|
|
transition: opacity 0.12s ease-in-out;
|
|
}
|
|
|
|
/* Keep the toggle focusable (never display:none) and reveal it on hover,
|
|
keyboard focus, the open state, and on devices that cannot hover. Use
|
|
:focus-visible so a mouse click does not latch the reveal via :focus -
|
|
that is what previously forced a focus-destroying blur() on pointer exit. */
|
|
.graphDrillDownToggle.reveal .graphDrillDownMenu,
|
|
.graphDrillDownToggle .graphDrillDownMenu:focus-visible,
|
|
.graphDrillDownToggle.open .graphDrillDownMenu {
|
|
opacity: 1;
|
|
}
|
|
|
|
@media (hover: none) {
|
|
.graphDrillDownToggle .graphDrillDownMenu {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
.graphDrillDownToggle.open .graphDrillDownMenu {
|
|
background: var(--cacti-dd-menu-bg-open, rgba(0, 0, 0, 0.82));
|
|
}
|
|
|
|
.graphDrillDownToggle .iconWrapper {
|
|
display: none;
|
|
}
|
|
|
|
.graphDrillDownToggle.open .iconWrapper {
|
|
display: table;
|
|
border-collapse: collapse;
|
|
margin: 0 3px 3px 3px;
|
|
padding: 4px;
|
|
border-radius: 4px;
|
|
background: var(--cacti-dd-panel-bg, rgba(0, 0, 0, 0.85));
|
|
box-shadow: 0 0 0 1px var(--cacti-dd-border, transparent), 0 3px 10px rgba(0, 0, 0, 0.4);
|
|
color: var(--cacti-dd-fg, #ffffff);
|
|
}
|
|
|
|
.graphDrillDownToggle.open .iconWrapper .iconLink {
|
|
display: table-row;
|
|
color: var(--cacti-dd-fg, #ffffff);
|
|
text-decoration: none;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Theme-appropriate row highlight: a wash of the theme's drilldown accent (the
|
|
hamburger/panel hue), falling back to the current text colour. */
|
|
.graphDrillDownToggle.open .iconWrapper .iconLink:hover,
|
|
.graphDrillDownToggle.open .iconWrapper .iconLink:focus-visible {
|
|
background: color-mix(in srgb, var(--cacti-dd-accent, currentColor) 22%, transparent);
|
|
outline: none;
|
|
}
|
|
|
|
/* Label on the left; the vertical cell padding keeps a few pixels between rows. */
|
|
.graphDrillDownToggle.open .iconWrapper .iconLabel {
|
|
display: table-cell;
|
|
padding: 2px 8px;
|
|
font-size: 12px;
|
|
text-align: left;
|
|
vertical-align: middle;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Glyphs stacked above one another in a fixed-width column, centred so each
|
|
icon sits in the middle of its cell; targets any glyph <i> so plugin icons
|
|
without the drillDown class align too. */
|
|
.graphDrillDownToggle.open .iconWrapper .iconLink > i {
|
|
display: table-cell;
|
|
width: 16px;
|
|
padding: 2px 8px 2px 2px;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
/* Reserve space beside the graph for users who prefer direct actions. */
|
|
.graphWrapperOuter > div:first-child:has(> .graphDrillDownAlways) {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.graphWrapperOuter > div:first-child:has(> .graphDrillDownAlways) > .graphWrapper {
|
|
min-width: 0;
|
|
}
|
|
|
|
.graphDrillDownAlways {
|
|
position: static;
|
|
z-index: auto;
|
|
display: block;
|
|
flex: 0 0 24px;
|
|
width: 24px;
|
|
min-width: 24px;
|
|
height: auto;
|
|
padding: 10px 3px;
|
|
}
|
|
|
|
.graphDrillDownAlways .graphDrillDownMenu {
|
|
display: none;
|
|
}
|
|
|
|
.graphDrillDownAlways .iconWrapper {
|
|
display: block;
|
|
visibility: visible;
|
|
opacity: 1;
|
|
}
|
|
|
|
.graphDrillDownAlways .iconLink {
|
|
display: inline-block;
|
|
width: 24px;
|
|
line-height: 24px;
|
|
text-align: center;
|
|
}
|
|
|
|
.graphDrillDownAlways .iconLink:focus-visible {
|
|
outline: 2px solid currentColor;
|
|
outline-offset: 1px;
|
|
}
|