Files
dnsmasq-webui/src/DnsmasqWebUI/Components/Dnsmasq/EffectiveConfig/EffectiveConfigSection.razor.css
T
alex f8754d8d6e Shared StatusBadge, OK/Cancel/Revert, fixes, badge styling
- Add Components/Shared/StatusBadge + StatusBadgeKind; centralize badge
  styles and map Kind to Bootstrap classes. Refactor OptionStateBadge to
  compose StatusBadge; add OK/Cancel/Revert when active with
  OnConfirm/OnCancel/OnRevert callbacks and exit-action flag in
  EffectiveConfigFieldDisplay.
- Fix _valueAtActivation to use Descriptor.GetValue() (persisted value)
  so save modal shows correct before/after and no phantom pending on
  revert-to-original.
- OptionHelpController: add CancelCloseFromLabelEnter() and call when
  opening/switching help so pending 300ms close does not dismiss new help.
- Migrate Dnsmasq.razor and HostsFileSection to StatusBadge; save modal
  option chip uses NeutralPill. Centralize badge CSS in StatusBadge.
- Badge styling: font-size/weight/padding, hover lift+shadow, active
  press with visible release animation.
2026-02-28 21:34:12 +10:00

253 lines
6.2 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* Effective config sections – mobile-first, touch-friendly.
Use ::deep so styles apply to EffectiveConfigSectionPanel (child component) markup. */
/* Wrapper: border and grouping around all sections. Margin-top separates from config files list above. */
.ec-container {
margin-top: 0.75rem;
border: 1px solid var(--bs-border-color, #dee2e6);
border-radius: 0.5rem;
padding: 1rem;
background-color: var(--bs-secondary-bg, #f8f9fa);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
min-width: 0;
overflow: visible;
}
/* Toolbar: single row, search left and actions right. Use ::deep so styles apply to EffectiveConfigToolbar (child) markup. */
::deep .ec-toolbar {
display: flex;
flex-wrap: nowrap;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.75rem;
min-width: 0;
}
::deep .ec-toolbar-search {
flex: 1 1 auto;
min-width: 0;
max-width: 24rem;
}
::deep .ec-toolbar-actions {
display: flex;
flex-wrap: nowrap;
flex-shrink: 0;
align-items: center;
gap: 0.5rem;
margin-left: auto;
}
.ec-sections {
display: flex;
flex-direction: column;
gap: 0;
min-width: 0;
}
::deep .ec-section {
border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}
::deep .ec-section:last-child {
border-bottom: none;
}
/* Section header: clear separation from background, touch-friendly (min 44px), distinct so search jumps are obvious */
::deep .ec-section-header {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
min-height: 2.75rem;
padding: 0.625rem 1rem;
margin: 0;
border: none;
border-left: 3px solid var(--bs-border-color, #dee2e6);
border-radius: 0.25rem;
background-color: var(--bs-body-bg, #fff);
color: inherit;
text-align: left;
cursor: pointer;
font-size: inherit;
line-height: 1.3;
-webkit-tap-highlight-color: transparent;
transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
::deep .ec-section-header:hover {
color: var(--bs-primary, #0d6efd);
background-color: var(--bs-secondary-bg, rgba(0, 0, 0, 0.04));
border-left-color: var(--bs-primary, #0d6efd);
}
::deep .ec-section-header:focus-visible {
outline: 2px solid var(--bs-primary, #0d6efd);
outline-offset: 2px;
}
/* Open state: header reads as "active", left border accent */
::deep .ec-section-open .ec-section-header {
background-color: var(--bs-body-bg, #fff);
color: var(--bs-emphasis-color, inherit);
font-weight: 600;
border-left-color: var(--bs-primary, #0d6efd);
box-shadow: 0 1px 0 var(--bs-border-color, #dee2e6);
}
::deep .ec-section-open .ec-section-header:hover {
background-color: var(--bs-secondary-bg, rgba(0, 0, 0, 0.04));
color: var(--bs-primary, #0d6efd);
}
::deep .ec-section-title {
flex: 1;
min-width: 0;
}
::deep .ec-section-chevron {
flex-shrink: 0;
font-size: 0.8rem;
opacity: 0.8;
margin-left: 0.35rem;
transition: opacity 0.2s ease;
}
::deep .ec-section-open .ec-section-chevron {
opacity: 1;
}
::deep .ec-section-body {
padding: 0.25rem 1rem 0.5rem 1rem;
padding-left: 1rem;
border-left: 2px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.075));
margin-left: 0;
min-width: 0;
overflow: visible;
overflow-wrap: break-word;
word-break: break-word;
}
/* Long paths/values wrap on small screens; badges stay inline */
::deep .ec-section-body ul {
overflow-wrap: break-word;
word-break: break-word;
}
::deep .ec-section-body li {
overflow-wrap: break-word;
word-break: break-word;
}
/* Field row: label + value + optional badge. Same structure for custom and default displays. */
::deep .ec-field {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 0.25rem 0.5rem;
margin-bottom: 0.35rem;
}
::deep .ec-field:last-child {
margin-bottom: 0;
}
::deep .ec-field-label {
flex-shrink: 0;
min-width: 0;
}
/* Clickable label: open full option help on click (hover tooltip unchanged) */
::deep .ec-field-label-help {
cursor: pointer;
text-decoration: underline;
text-decoration-style: dotted;
text-underline-offset: 2px;
}
::deep .ec-field-label-help:hover {
color: var(--bs-primary, #0d6efd);
}
::deep .ec-field-value {
display: flex;
flex-wrap: wrap;
align-items: center;
flex: 1 1 auto;
min-width: 0;
overflow-wrap: break-word;
word-break: break-word;
gap: 0.25rem;
}
/* Edit wrapper (checkbox/input) shrinks to content so the editable badge stays on the same line */
::deep .ec-field-edit-wrapper {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
}
/* Input/select in value area can shrink so the editable badge stays on the same line */
::deep .ec-field-value > .form-control,
::deep .ec-field-value > .form-select {
flex: 1 1 auto;
min-width: 0;
}
/* Multi-value: full width below label, indented ordered list. min-width: 0 so flex doesn't prevent wrapping. */
::deep .ec-field-value-multi {
flex-basis: 100%;
min-width: 0;
padding-left: 1.25rem;
margin-top: 0.15rem;
overflow-wrap: break-word;
word-break: break-word;
}
::deep .ec-field-value-list {
margin: 0;
padding-left: 1.25rem;
list-style-type: decimal;
min-width: 0;
}
::deep .ec-field-value-list li {
margin-bottom: 0.2rem;
min-width: 0;
overflow-wrap: break-word;
word-break: break-word;
}
::deep .ec-field-value-list li:last-child {
margin-bottom: 0;
}
/* Long paths/URLs wrap; allow break anywhere so nothing is clipped */
::deep .ec-field-value-item {
display: inline;
overflow-wrap: break-word;
word-break: break-word;
}
::deep .ec-field-value-sep {
margin-right: 0.25rem;
}
/* StatusBadge inside field rows: alignment; spacing comes from StatusBadge .status-badge-inline */
::deep .ec-field .status-badge,
::deep .ec-field-value-item .status-badge {
display: inline-flex;
align-items: center;
line-height: 1;
}
@media (max-width: 767.98px) {
::deep .ec-section-header {
padding-left: 0.75rem;
padding-right: 0.75rem;
}
::deep .ec-section-body {
padding-left: 0.75rem;
padding-right: 0.75rem;
}
}