hledger-web-2.0: static/hledger.css
/* hledger web ui styles
*
* Conventions and the reasoning behind them: ../STYLE.md
* Short version: no build step, nothing from a third party, style lives here
* rather than in style= attributes, colors come from the palette in section
* 1, and amounts get tabular figures.
*/
/*------------------------------------------------------------------------------------------*/
/* 0. revert some things */
/* don't let bootstrap add link URLs when printing */
@media print {
a[href]:after { content: none !important; }
}
/*------------------------------------------------------------------------------------------*/
/* 1. colors */
/* The pages are light or dark, following the setting of the OS or browser.
Every color this file sets is defined here once, light first and dark in
the media query below, and the rules use these properties rather than
literal colors; only shadows, black in both, are written out. color-scheme
lets the browser draw its own widgets (datalist suggestions, date picker,
scrollbars) to match. */
:root {
color-scheme: light dark;
--bg: #fff;
--surface: #fff; /* tooltips, dialogs, form fields, buttons */
--border: #ccc; /* around fields and buttons */
--muted: #687385; /* column headers, and the rule above totals */
--header-rule: #e6e8eb; /* under column headers */
--row-hover: #f6f8fa;
--row-target: #fcf8e3; /* the entry the url points to */
--negative: #a94442; /* negative amounts, and errors */
--gain: #008300; /* holdings' gains and losses, as charts colour them */
--loss: #e34948; /* (revenue and expense, in Hledger.Write.Chart.Palette) */
--code: black;
--dialog-border: rgba(0, 0, 0, .2);
/* the account sidebar */
--account: #2f2f2f;
--account-current: #11427d; /* the account shown, and the one under the pointer */
--account-current-bg: #f9f9f9;
--sidebar-rule: #ebebeb;
}
/* Printing is always light. Bootstrap prints every background as
transparent, and in the dark scheme the browser's own dark page would
show through. */
@media print {
:root {
color-scheme: light;
}
}
/* On screen only, so that printing keeps the light colors too. */
@media screen and (prefers-color-scheme: dark) {
:root {
/* In the light scheme bootstrap supplies these; section 9 applies
them in the dark. */
--text: #d3d7dd;
--rule: #30353d; /* between table rows */
--link: #6fb1f7;
--link-hover: #9ccaff;
--surface-hover: #2c3139; /* a button under the pointer or pressed, and code */
--border-hover: #5a626e;
--info: #9cc9f5;
--info-bg: #172a3d;
--info-border: #24476b;
--danger-bg: #3a1f22;
--danger-border: #6b3034;
--bg: #1b1e23;
--surface: #23272e;
--border: #434a54;
--muted: #8e98a5;
--header-rule: var(--rule);
--row-hover: #22262c;
--row-target: #3a3420;
--negative: #f28b82;
--gain: #008300;
--loss: #e66767;
--code: #eef0f3;
--dialog-border: var(--border);
--account: var(--text);
--account-current: #8ec3ff;
--account-current-bg: #262b33;
--sidebar-rule: var(--rule);
}
}
/* green */
::placeholder {
font-style:italic;
}
/*------------------------------------------------------------------------------------------*/
/* 2. fonts */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
/*------------------------------------------------------------------------------------------*/
/* 3. tabular data: amounts, dates, column headers */
/* Amounts read as a column of figures: tabular (fixed width) digits, aligned
right so the decimal points line up. Both the cell and the amount spans
inside it carry .amount, so this reaches either. */
.amount {
font-feature-settings: "tnum";
font-variant: tabular-nums;
text-align: right;
}
/* A date is one token; don't break it across lines. */
td.date {
white-space: nowrap;
}
/* So is an amount, its quantity and commodity symbol. (The sidebar's
amounts are laid out by its own rules, below.) */
#main-content span.amount {
white-space: nowrap;
}
/* One row, one line: descriptions arrive elided, so the width is bounded. */
@media (min-width: 992px) { /* under md: no room */
td.description {
white-space: nowrap;
}
}
/* A row lights up under the pointer, which helps when reading a wide row
across to its amount. The :target rule further down overrides this. */
.table > tbody > tr:hover > td {
background-color: var(--row-hover);
}
/* Column headers label the data, they are not part of it: small, spaced and
muted. Left alignment comes from bootstrap's th rule; .amount above
overrides it for the figure columns. */
.table > thead > tr > th,
.table > thead > th {
font-size: 12px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--muted);
border-bottom: 1px solid var(--header-rule);
white-space: normal;
}
/* A balance report can be wider than the page at any window size, and
bootstrap's .table-responsive only scrolls below 768px. Without this the
whole main pane scrolls instead, dragging the account column, the heading
and the search box out of view. */
.report-table {
overflow-x: auto;
}
/* A note below a report's table, eg about what its totals leave out. */
.report-note {
color: var(--muted);
}
/* The balance report's table comes from hledger-lib's HTML writer, which
marks heading and total cells with border classes (border-bottom-double,
border-top-double) for its standalone output. Here the rules above apply
instead: one hairline between rows, none vertical, no double lines. The
totals, in tfoot, are bold (the writer's <b>) under a hairline in the
header color, so the eye finds them without a heavier rule. */
.table > tfoot > tr > td {
border-top: 1px solid var(--muted);
}
/* A statement's sections: each section's title row, spaced from the
section above, and its subtotal rows under a hairline like the
footer's. Bootstrap separates the sections' tbodies with a rule of
its own. */
.balancereport > tbody > tr.section > th {
padding-top: 1em;
}
.balancereport > tbody > tr.subtotal > td {
border-top: 1px solid var(--muted);
}
/* A row of links above a report or under a page heading: to the other
reports, to the intervals, and on the balance report to its modes; the
years a search matches; the pages. The current one is set in bold, like
the sidebar's current account, and is not a link on the pages row. Each
link wraps as a unit, so a narrow screen breaks the row between links,
not inside one. */
.report-links a,
.report-links .current {
margin-left: 0.5em;
white-space: nowrap;
}
/* The state being shown reads as state, not as another link: bold, in
the text color. */
.report-links .current {
font-weight: 600;
color: inherit;
}
/* A faint rule between the links, so that a row of several-word labels
("Income statement", "Cashflow statement") does not read as one sentence.
Not on the paging rows, whose numbers and arrows read fine as they are. */
.report-links:not(.paging):not(.paging-nav) > :is(a, .current) + :is(a, .current) {
border-left: 1px solid var(--border);
padding-left: 0.5em;
}
/* The row of links to the reports, at the top of every page, has no
label, so its first link lines up with the search form below. */
.report-links.reports > :first-child {
margin-left: 0;
}
/* In a row of links in groups (linksRowGroups), each group after the
first starts a little apart. */
.report-links .group-start {
margin-left: 2em;
}
/* The rows' labels share a width, so the links start in one column
(the collapsed commodity line's label too). */
.report-links > .row-label,
div.commodities summary > .row-label {
display: inline-block;
min-width: 8.5em;
}
/* The rows of report controls sit behind this disclosure, closed by
default; opening it is remembered per browser (default-layout.hamlet).
Bootstrap removes summary's native marker, so it gets its own caret,
like the account trees'. */
details.report-controls {
margin: 10px 0;
}
/* Open, the controls sit unboxed like the page's other panels, so the
heading stays put and only the rows below it appear. */
details.report-controls[open] {
margin-bottom: 16px;
}
/* The heading is small and muted like the Chart and Data buttons
(.part-toggle), taking the link color on hover. */
details.report-controls > summary {
cursor: pointer;
width: max-content;
max-width: 100%;
font-size: 12px;
color: var(--muted);
}
details.report-controls > summary:hover {
color: var(--link, #337ab7);
}
/* Closed, the options in effect follow, muted (Widget.Common.optionsSummary);
open, the rows show them. */
details.report-controls > summary .options-summary {
margin-left: 1em;
color: var(--muted);
}
details.report-controls[open] > summary .options-summary {
display: none;
}
details.report-controls > summary::before {
content: "▸";
display: inline-block;
width: 1.1em;
font-size: 1.25em;
line-height: 1;
color: var(--link, #337ab7);
}
details.report-controls[open] > summary::before {
content: "▾";
}
details.report-controls[open] > summary {
margin-bottom: 8px;
}
/* Controls that take effect on other pages (Widget.Common.inertControls)
mute only their labels: the links work, setting state for the report
pages, and the wrapper's tooltip says so. Not by dimming the links:
they sit near the AA contrast floor (see the dark-scheme browser
test), and they are not disabled. */
.controls-inert .row-label {
color: var(--muted);
}
/* Flat-mode account cells marked acct-split (reportTable) show the parent
path dimmed and, when long, shortened from its left, keeping the segments
nearest the leaf; direction: rtl puts the ellipsis on the left, and the
isolated span inside keeps the name's characters in order. The full name
stays in the link's tooltip and register link. */
.report-table td.account .acct-path {
color: var(--muted);
display: inline-block;
max-width: 14em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
direction: rtl;
vertical-align: bottom;
}
.report-table td.account .acct-path > span {
direction: ltr;
unicode-bidi: isolate;
}
/* The path is width-capped above, so keeping the cell on one line cannot
widen the column much, and the leaf stays glued to its path. */
.report-table td.account.acct-split { white-space: nowrap; }
/* The commodity row lists every commodity in the journal; past a few
lines it scrolls instead of growing, and many commodities collapse
to one line showing the selection (Widget.Common.commodityLinks). */
div.commodities .report-links {
max-height: 7.5em;
overflow-y: auto;
}
div.commodities summary {
cursor: pointer;
width: max-content;
}
/* The summary's selection reads like the other rows' current choice,
and sits in their column; the trailing caret, link-colored like the
other carets, is what offers the full list. */
div.commodities summary .sel {
font-weight: 600;
margin-left: 0.5em;
}
div.commodities summary .sel::after {
content: " ▸";
color: var(--link, #337ab7);
font-weight: normal;
}
div.commodities details[open] summary .sel::after {
content: " ▾";
}
/* A short usage hint below a row of controls, eg the years row's
shift-click range selection, indented to the links column. */
.controls-hint {
color: var(--muted);
font-size: 0.85em;
margin: -8px 0 10px 10.6em;
}
/* The closed commodity list keeps a row's bottom margin, so the hint
below sits as far from it as from any other row. */
div.commodities > details {
margin-bottom: 10px;
}
/* The pages row keeps its shape from page to page: the newer and older
links hold their places when absent, and each page number has a cell
of its own, so the numbers do not shift when a link or a digit
appears. */
.paging-nav a,
.paging-nav .current,
.paging-nav .placeholder {
display: inline-block;
margin-left: 0;
text-align: center;
}
.paging-nav a:not(.newer):not(.older),
.paging-nav .current {
min-width: 2.2em;
}
.paging-nav .newer {
margin-right: 0.5em;
}
.paging-nav .older {
margin-left: 0.5em;
}
.paging-nav .placeholder {
visibility: hidden;
}
/*------------------------------------------------------------------------------------------*/
/* 4. the add form */
/* The journal page's link to it, kept a line's space above any rows of
links that follow it. */
#addformlink + .report-links {
margin-top: 10px;
}
/* Each posting row is indented a little under the date and description. */
#addform .account-group {
padding-left: 1em;
}
/* When the journal has several files, a selector chooses which one to add to.
It sits inline after its "Add to:" label instead of filling the row. */
#addform .file-select {
display: inline-block;
width: auto;
}
#addform button[type=submit] {
font-weight: bold;
}
/* The date picker button. */
#datebutton {
cursor: pointer;
}
/* The date input that backs the picker button. It must be rendered for
showPicker to work, so it is placed under the button rather than hidden. */
#datepicked {
position: absolute;
bottom: 0;
right: 0;
width: 1px;
height: 1px;
padding: 0;
border: 0;
opacity: 0;
pointer-events: none;
}
/* The add form shown on a page of its own, after a submission was rejected. */
.add-page {
margin-top: 1em;
}
/*------------------------------------------------------------------------------------------*/
/* 5. entries: the one the url hash targets, and the one under the pointer */
/* Following a link to a transaction or posting marks it. */
.table > tbody > tr:target > td,
tr:target > td {
background-color: var(--row-target);
}
/* Hovering a transaction shows its journal entry in this tooltip (see
entryTooltipInit in hledger.js), which is as wide as the entry's longest
line and set in a fixed-width font, so that the amounts line up as they do
in the journal. hledger.js places it and keeps it within the window.
Hovering a chart's mark shows its tooltip in a box like it (see
chartTooltipInit), in the page's font. */
.entry-tooltip,
.chart-tooltip {
position: fixed;
z-index: 1070; /* bootstrap's level for tooltips */
width: max-content;
overflow: hidden;
padding: 6px 10px;
font-size: 12px;
line-height: 1.45;
background-color: var(--surface);
border: 1px solid var(--dialog-border);
border-radius: 4px;
box-shadow: 0 3px 9px rgba(0, 0, 0, .2);
/* Like a browser tooltip, it is never in the pointer's way. */
pointer-events: none;
}
.entry-tooltip {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.chart-tooltip {
font-size: 13px;
font-variant-numeric: tabular-nums;
}
.chart-tooltip-head {
font-weight: 600;
}
/* More lines, eg the accounts an "other" series combines, below the
swatch's line and indented to its text. */
.chart-tooltip-more {
padding-left: 16px;
color: var(--muted);
}
/* The mark's colour, which hledger.js sets as the swatch's color: a square
for a bar, a short line for a line, dashed for the average. */
.chart-tooltip-swatch {
display: inline-block;
width: 10px;
height: 10px;
margin-right: 6px;
vertical-align: -1px;
border-radius: 2px;
background-color: currentColor;
}
.chart-tooltip-swatch.line,
.chart-tooltip-swatch.dashed {
width: 14px;
height: 0;
vertical-align: 3px;
border-radius: 0;
border-top: 3px solid currentColor;
background-color: transparent;
}
.chart-tooltip-swatch.dashed {
border-top-style: dashed;
border-top-width: 2px;
}
/* The dot hledger.js puts on the line point whose tooltip is shown. */
.hledger-chart .hover-dot {
stroke: var(--surface);
stroke-width: 2;
pointer-events: none;
}
.entry-tooltip > div {
white-space: pre-wrap;
overflow-wrap: anywhere;
}
/* An entry taller than the window is cut off; this marks the cut. */
.entry-tooltip.clipped::after {
content: "…";
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 0 10px;
background-color: var(--surface);
}
code {
font-weight: bold;
color: var(--code);
}
/*------------------------------------------------------------------------------------------*/
/* 6. dialogs */
/* The add form and help are <dialog> elements. Browsers draw those with a
plain black border, so give them the look of the modals around them. */
dialog {
width: min(900px, calc(100% - 20px));
/* Sit near the top of the viewport, where the modals did, rather than
centered as a <dialog> is by default. */
margin-top: 30px;
margin-bottom: 30px;
padding: 0;
border: 1px solid var(--dialog-border);
border-radius: 6px;
box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}
/* The program name and version, at the right of the help dialog's header. */
.modal-header .version {
float: right;
margin-right: 4em;
}
dialog::backdrop {
background-color: rgba(0, 0, 0, .5);
}
/* showModal() puts focus on the dialog, which is a container rather than
something the user tabs to, so it does not need a focus ring. */
dialog:focus {
outline: none;
}
/* The g key's menu of pages: a small panel near the top, over the page,
styled like the dialogs but without a backdrop, since it closes as soon
as a key is pressed. */
#gomenu {
position: fixed;
top: 30px;
left: 50%;
transform: translateX(-50%);
z-index: 1050;
min-width: 16em;
padding: 10px 20px;
background-color: var(--surface);
border: 1px solid var(--dialog-border);
border-radius: 6px;
box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
}
#gomenu[hidden] {
display: none;
}
#gomenu p {
font-weight: 600;
margin-bottom: 5px;
}
#gomenu ul {
list-style: none;
margin: 0;
padding: 0;
}
#gomenu li {
padding: 2px 0;
}
#gomenu code {
margin-right: 0.5em;
}
/* In the help dialog's lists, an item that starts a new group. */
.modal-body li.gap-above {
margin-top: 1em;
}
/* The help's headings and notes, and its tables of keys: each key, or
each options row's label, in a column of its own, the keys being
keycaps, set apart from the search syntax's code. Its two columns
stack on a phone (col-sm-6). */
#helpmodal h4 {
margin: 0 0 8px;
font-size: 14px;
font-weight: bold;
}
#helpmodal h5 {
margin: 14px 0 6px;
font-size: 14px;
font-weight: bold;
}
#helpmodal h4:not(:first-child) {
margin-top: 16px;
}
#helpmodal .help-note {
margin-bottom: 8px;
color: var(--muted);
}
.help-keys {
margin-bottom: 8px;
}
.help-keys th,
.help-keys td {
padding: 1px 0;
vertical-align: top;
}
.help-keys th {
padding-right: 12px;
font-weight: normal;
white-space: nowrap;
}
.help-keys td > span {
display: inline-block;
margin-right: 12px;
white-space: nowrap;
}
#helpmodal kbd {
display: inline-block;
min-width: 20px;
padding: 0 4px;
font-size: 12px;
line-height: 16px;
text-align: center;
color: inherit;
background-color: var(--row-hover);
border: 1px solid var(--border);
border-bottom-width: 2px;
border-radius: 4px;
box-shadow: none;
}
/*------------------------------------------------------------------------------------------*/
/* 7. the report charts */
/* hledger's SVG charts, styled by /chart.css in their own palette, and
fitted to the page here: they sit on the page's background, and their
tick labels take the page's muted color, which keeps them readable
(4.5:1) in both schemes. */
.report-chart {
margin-bottom: 1em;
}
.report-chart .hledger-chart .bg {
fill: transparent;
}
.report-chart .hledger-chart .tick {
fill: var(--muted);
}
/* The charts' marks are not Bootstrap's highlighted text. */
.hledger-chart .mark {
background-color: transparent;
padding: 0;
}
/* The c key hides a report's chart, and the d key the report's table
after it (hledger.js); a page without a chart keeps its table. */
#main-content.chart-hidden .report-chart,
#main-content.table-hidden .report-chart ~ .report-table {
display: none;
}
/* The charts' total or net line (or marks), with its legend entry, is
hidden until the N key shows it (hledger.js). The scale is fitted to
it either way (with bars, it lies within their extent anyway). */
#main-content:not(.net-shown) .report-chart .total {
display: none;
}
/* So do the Chart and Data buttons (Widget.Chart.chartToggle, dataToggle),
at the right margin, with a caret showing whether their part is shown.
Then, taking no room of their own, Chart sits over the chart's top right
corner, and Data just above the table's, outside the table, so that it
stays at the page's right edge when the table scrolls sideways. While
the chart is hidden, both stand on a line of their own. */
.part-toggle-row {
position: relative;
height: 0;
text-align: right;
}
.part-toggle {
position: absolute;
right: 0;
z-index: 1;
padding: 0;
border: 0;
background: none;
font-size: 12px;
color: var(--muted);
}
.part-toggle:hover {
color: var(--link, #337ab7);
}
.part-toggle::before {
content: "▾";
display: inline-block;
width: 1.1em;
font-size: 1.25em;
line-height: 1;
color: var(--link, #337ab7);
}
.chart-toggle-row .part-toggle {
top: 0;
}
.table-toggle-row .part-toggle {
bottom: 0;
}
/* A chart with no legend row above it makes room for its button. */
.chart-toggle-row + .report-chart:not(.with-legend) {
padding-top: 18px;
}
#main-content.chart-hidden .part-toggle-row {
height: auto;
}
#main-content.chart-hidden .part-toggle {
position: static;
vertical-align: top; /* where Chart is when the chart shows */
}
/* A hidden part's button keeps a margin below it. (Data, hidden under a
chart, stays where it was, just below the chart.) */
#main-content.chart-hidden .chart-toggle-row,
#main-content.table-hidden .table-toggle-row {
margin-bottom: 1em;
}
#main-content.chart-hidden .chart-toggle-row .part-toggle::before,
#main-content.table-hidden .table-toggle-row .part-toggle::before {
content: "▸";
}
/* On the register, dragging across a plot (hledger.js) shades the dates
selected; on a touch screen a sideways drag selects too, rather than
scrolling. */
.register-chart .hledger-chart {
touch-action: pan-y;
}
.register-chart .hledger-chart .plot,
.register-chart .hledger-chart .shade {
cursor: crosshair;
}
.register-chart .hledger-chart .selection {
fill: var(--link, #337ab7);
fill-opacity: .15;
pointer-events: none;
}
/* A chart drawn at two widths (Widget.Chart.chartAtWidths), for the main
column with the sidebar shown and hidden: only the one for the sidebar's
state is shown, so showing or hiding the sidebar needs no redraw. */
#main-content.col-md-8 .chart-width[data-sidebar=hidden],
#main-content.col-md-12 .chart-width[data-sidebar=shown] {
display: none;
}
/* While a chart waits to be redrawn at a new width (hledger.js chartsFit),
eg during a window resize, it is stretched or shrunk to fit, keeping its
height (chartsStretch). */
#main-content.charts-stretched .hledger-chart {
width: 100%;
}
/* With several commodities, a legend chooses the one charted, on the
register and the report pages (Widget.Chart.chartLegend). Its entries
are the labels of radio buttons, hidden but still reached from the
keyboard, each followed by its commodity's chart, shown while it is
chosen: no javascript needed. The legend makes the first row, the charts
and the note of any commodities left out the rows below it. */
.with-legend {
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: 1em;
}
.with-legend .chart-legend-label {
font-weight: bold;
}
.with-legend > input[type=radio] {
position: absolute;
opacity: 0;
pointer-events: none;
}
.with-legend > input + label {
margin: 0;
font-weight: normal;
color: var(--link, #337ab7);
cursor: pointer;
}
.with-legend > input:checked + label {
color: inherit;
text-decoration: underline 2px;
text-underline-offset: 4px;
}
.with-legend > input:focus-visible + label {
outline: 2px solid var(--link, #337ab7);
outline-offset: 2px;
}
.with-legend > .chart-panel {
display: none;
order: 1;
flex-basis: 100%;
}
.with-legend > input:checked + label + .chart-panel {
display: block;
}
.report-chart .chart-note {
order: 2;
flex-basis: 100%;
color: var(--muted);
}
/*------------------------------------------------------------------------------------------*/
/* 8. the manage, edit and upload pages */
/* The list of journal files: each name is centered against its row of buttons. */
.table.files td.filename {
vertical-align: middle;
}
/* The edit form is a table only for layout; no rules between its cells. */
.table.edit-form td {
border: 0;
}
/* The upload form's file input is hidden; its label, styled as a button, is
the visible control and opens the file dialog. (Bootstrap makes file inputs
display:block, which outranks the hidden attribute, hence a rule here.) */
label.btn > input[type=file] {
display: none;
}
ul {
list-style-type: none;
padding: 0;
}
#main-content {
padding-left: 30px;
}
/* focused only so that the keyboard scrolls it (focusPage in hledger.js) */
#main-content:focus {
outline: none;
}
#message {
white-space: pre;
overflow-x: auto;
}
#sidebar-menu {
overflow:hidden;
border-right: 1px solid var(--sidebar-rule);
}
/* On wider screens, give the sidebar and the main content each their own
vertical scrollbar so they scroll independently and the window itself doesn't
scroll. This keeps the account list from shifting when the main pane is long,
and lets its scroll position be preserved across navigations (restored from
sessionStorage in hledger.js). calc leaves room for the header row above, so
the last accounts aren't clipped; short lists stay content-height. */
@media screen and (min-width: 769px) {
#sidebar-menu, #main-content {
max-height: calc(100vh - 5em);
overflow-y: auto;
}
}
/* fixed, so that a row too wide for the sidebar overflows alone, rather
than widening the table and every row with it */
#sidebar-menu .main-menu {
table-layout: fixed;
word-wrap: break-word;
}
/* Each row is laid out on its own, not in columns shared with the other
rows: the balance takes the width it needs and the account name the
rest, shortened if need be. When that would leave the name less than
6em, the balance goes on a line of its own below it. */
#sidebar-menu .main-menu tr {
display: flex;
flex-wrap: wrap;
}
/* a folded row, which the rule above would show */
#sidebar-menu .main-menu tr.tree-fold-hide {
display: none;
}
/* the line above an account is the row's, so that a balance below its
name stays inside it */
#sidebar-menu .main-menu tr[data-indent], #sidebar-menu .main-menu tr.total {
border-top: 1px solid var(--sidebar-rule);
}
#sidebar-menu .main-menu td {
padding: 1px !important;
border-top: none;
overflow: hidden;
white-space:nowrap;
text-overflow:ellipsis;
font-size: 16px;
flex: 1 1 6em;
min-width: 0;
}
#sidebar-menu .main-menu .ff-wrapper { /* This wrapper is needed because firefox won't apply overflow to a td-tag */
overflow:hidden;
text-overflow:ellipsis;
}
#sidebar-menu .main-menu .top {
border: none !important;
}
#sidebar-menu .main-menu a {
display: inline;
font-size: 16px;
font-weight: 500;
color: var(--account);
padding: 4px 20px;
}
#sidebar-menu .main-menu a:hover {
color: var(--account-current);
text-decoration: none;
background-color: transparent;
}
#sidebar-menu .main-menu .only {
visibility: hidden;
padding: 1px;
font-size: 12px;
}
#sidebar-menu .main-menu tr:hover .only {
visibility: visible;
}
#sidebar-menu .main-menu .inacct, #sidebar-menu .main-menu .inacct .acct-name {
font-weight: bold;
color: var(--account-current);
background-color: var(--account-current-bg);
}
#sidebar-menu .main-menu .amount {
flex: none;
margin-left: auto;
font-weight: 500 !important;
}
.transactionsreport .posting td {
border: none !important;
}
.negative {
color: var(--negative);
}
/* The holdings table's gains and losses, green and red as the holdings
command colors them, in the chart's colors. */
.gain {
color: var(--gain);
}
.loss {
color: var(--loss);
}
/* A figure that links is not coloured as a link: the figure's own colour
(red for a negative amount, from the span inside) shows through. In the
sidebar it is not padded like an account link, and underlines on hover,
as the report pages' figures do. */
.balancereport td.amount a,
#sidebar-menu .main-menu .amount a {
color: inherit;
}
#sidebar-menu .main-menu .amount a {
padding: 0;
}
#sidebar-menu .main-menu .amount a:hover {
text-decoration: underline;
}
.col-any-0 {
width:0 !important;
height:0 !important;
float: left;
opacity:0;
}
/* The sidebar's button, at the top left. With the sidebar hidden, the
spacer holding it shrinks to fit it. Its icon's left pane is filled
while the sidebar shows. */
#spacer.sidebar-hidden {
width: auto;
}
#sidebar-toggle {
padding: 4px 8px;
line-height: 1;
}
#sidebar-toggle .sidebar-icon {
display: block;
}
/* The icon's sidebar pane is white while the sidebar shows, and filled
while it is hidden. */
#sidebar-toggle .sidebar-icon-pane {
fill: currentColor;
}
#sidebar-toggle[aria-expanded="true"] .sidebar-icon-pane {
fill: none;
}
/* Full window mode (the f key) shows only the page's heading and data, and
the paging links, across the window's full width; a small button at the
top right leaves it. */
body.fullwindow #spacer,
body.fullwindow #topbar,
body.fullwindow #sidebar-menu,
body.fullwindow #searchform,
body.fullwindow .report-links.reports,
body.fullwindow details.report-controls,
body.fullwindow #addformlink,
body.fullwindow footer {
display: none;
}
body.fullwindow #main-content {
width: 100%;
}
#fullwindow-exit {
display: none;
}
body.fullwindow #fullwindow-exit {
display: block;
position: fixed;
top: 8px;
right: 8px;
z-index: 10;
}
@media screen and (max-width: 768px) {
.row-offcanvas {
position: relative;
transition: all .25s ease-out;
}
.row-offcanvas-right {
right: 0;
}
.row-offcanvas-left {
left: 0;
}
.row-offcanvas-right
.sidebar-offcanvas {
right: -90%;
}
.row-offcanvas-left
.sidebar-offcanvas {
left: -90%;
}
.row-offcanvas-right.active {
right: 90%;
}
.row-offcanvas-left.active {
left: 90%;
}
.sidebar-offcanvas {
position: absolute;
top: 0;
width: 90%;
}
/* Here the sidebar slides in, so hiding it on a wider screen
doesn't apply. */
#sidebar-menu.col-any-0 {
width: 90% !important;
height: auto !important;
opacity: 1;
padding: 0 15px;
}
#sidebar-menu .main-menu td {
max-width: 200px;
}
}
/*------------------------------------------------------------------------------------------*/
/* 9. bootstrap and the browser, in the dark */
/* Bootstrap 3 is light only, as are some of the browser's own defaults for
the elements these pages use. In the dark scheme, restyle those parts with
the palette from section 1. */
@media screen and (prefers-color-scheme: dark) {
body {
color: var(--text);
background-color: var(--bg);
}
a {
color: var(--link);
}
a:hover, a:focus {
color: var(--link-hover);
}
dialog {
color: var(--text);
background-color: var(--surface);
}
code {
background-color: var(--surface-hover);
}
pre {
color: var(--text);
background-color: var(--bg);
border-color: var(--border);
}
.table > tbody > tr > td,
.table > tbody > tr > th {
border-top-color: var(--rule);
}
.table-responsive,
.modal-header {
border-color: var(--rule);
}
.form-control,
.input-group-addon {
color: var(--text);
background-color: var(--surface);
border-color: var(--border);
}
.help-block {
color: var(--muted);
}
.has-error .help-block {
color: var(--negative);
}
.has-error .form-control,
.has-error .form-control:focus {
border-color: var(--negative);
}
.has-error .form-control:focus {
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px var(--negative);
}
.has-error .input-group-addon {
color: var(--negative);
background-color: var(--danger-bg);
border-color: var(--negative);
}
.btn-default {
color: var(--text);
background-color: var(--surface);
border-color: var(--border);
}
.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active,
.btn-default:active:hover,
.btn-default:active:focus,
.btn-default.active:hover,
.btn-default.active:focus {
color: var(--text);
background-color: var(--surface-hover);
border-color: var(--border-hover);
}
.close,
.close:hover,
.close:focus {
color: var(--text);
text-shadow: none;
}
.alert-info {
color: var(--info);
background-color: var(--info-bg);
border-color: var(--info-border);
}
.alert-danger {
color: var(--negative);
background-color: var(--danger-bg);
border-color: var(--danger-border);
}
}
/* Tree-fold rows: the tree-mode report tables (reportTreeInit in
hledger.js) and the sidebar's accounts (the inline script in
default-layout.hamlet) are folded with a caret at each group. In the
report tables the indent is padding, set by the depth class, so the
caret sits at the account name. */
.tree-fold-hide { display: none; }
.more-commodities { opacity: .55; white-space: nowrap; }
#sidebar-menu tr.total > td.total-label { text-align: right; padding-right: 6px; opacity: .7; white-space: nowrap; }
/* The caret absorbs the indent to its left rather than adding width, so
the account names sit exactly where list mode puts them; the glyph
hugs the name. */
.tree-caret { display: inline-block; width: 1.1em; margin-left: -1.1em; text-align: right; padding-right: 0.15em; cursor: pointer; color: var(--link, #337ab7); user-select: none; }
/* The sidebar's account links have 20px of padding before the name, so
there its carets move over it, above the link so a click folds, to hug
the name too (and stay on screen when the sidebar slides in). */
#sidebar-menu .tree-caret { position: relative; left: 20px; z-index: 1; }
/* Depth 0 has no indent to absorb, so it gets one caret-width of its own. */
.report-table td.account.indent-0 { padding-left: 1.1em; }
.report-table td.account.indent-1 { padding-left: 1.6em; }
.report-table td.account.indent-2 { padding-left: 3.0em; }
.report-table td.account.indent-3 { padding-left: 4.4em; }
.report-table td.account.indent-4 { padding-left: 5.8em; }
.report-table td.account.indent-5 { padding-left: 7.2em; }
.report-table td.account.indent-6 { padding-left: 8.6em; }
.report-table td.account.indent-7 { padding-left: 10.0em; }
.report-table td.account.indent-8 { padding-left: 11.4em; }
.report-table td.account.indent-9 { padding-left: 12.8em; }
.report-table td.account.indent-10 { padding-left: 14.2em; }
.report-table td.account.indent-11 { padding-left: 15.6em; }
.report-table td.account.indent-12 { padding-left: 17.0em; }
/* The holdings page's tree mode: account heading rows stand out from the
position rows (named by their commodity) grouped beneath them. */
.report-table td.account.acctheading { font-weight: bold; }
/* Beside a report table's account heading, the depth limit's - and +
steps (depthStepper), kept quiet like the heading: the links are
there when you look for them. Not uppercased, so "Depth 2" reads as
a setting, not a column name. */
.param-switch { margin-left: 1.5em; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.param-switch > * + * { margin-left: 0.5em; padding-left: 0.5em; border-left: 1px solid var(--border); }
.param-switch .current { font-weight: 600; color: var(--text, inherit); }
/* The account heading keeps its controls beside it, whatever the columns. */
.report-table thead th.account { white-space: nowrap; }
.depth-stepper { margin-left: 1.5em; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.depth-stepper .depth-step { display: inline-block; min-width: 1.4em; text-align: center; font-weight: 600; text-decoration: none; }
.depth-stepper .depth-step.disabled { color: var(--muted); font-weight: normal; }
/* The row above the sidebar's accounts, small and muted like the
table's stepper: the balances' date, right-aligned over the amounts. */
#sidebar-menu .main-menu tr.depth-row > td { text-align: right; font-size: 12px; color: var(--muted); padding-top: 2px; padding-bottom: 2px; max-width: none; }
/* The depth stepper, at the left, indented like the account names below
it: the content of the All accounts link above, and clear of the left
edge, which on a narrow screen is off the screen. */
#sidebar-menu .main-menu tr.depth-row .depth-stepper { float: left; margin-left: 0; padding-left: 33px; }
/* The balances' date is a button, like the reports' Chart and Data
buttons, that hides the sidebar's balances (the amounts, and the total
row), leaving the account names the whole width; it then reads just
"Balances". */
#sidebar-menu .balances-toggle { padding: 0; border: 0; background: none; color: inherit; }
#sidebar-menu .balances-toggle:hover { color: var(--link, #337ab7); }
#sidebar-menu .balances-toggle::before { content: "▾"; display: inline-block; width: 1.1em; font-size: 1.25em; line-height: 1; color: var(--link, #337ab7); }
#sidebar-menu.balances-hidden .balances-toggle::before { content: "▸"; }
#sidebar-menu .balances-word,
#sidebar-menu.balances-hidden .balances-date,
#sidebar-menu.balances-hidden .main-menu td.amount,
#sidebar-menu.balances-hidden .main-menu tr.total { display: none; }
#sidebar-menu.balances-hidden .balances-word { display: inline; }
#sidebar-menu.balances-hidden .main-menu td.acct { max-width: none; }
/* The sidebar's steps are buttons (they fold in place, not links to
another page), looking like the table's link steps. */
#sidebar-menu .main-menu tr.depth-row button.depth-step { padding: 0; border: 0; background: none; font-size: 12px; font-weight: 600; line-height: inherit; color: var(--link, #337ab7); cursor: pointer; }
#sidebar-menu .main-menu tr.depth-row button.depth-step:disabled { color: var(--muted); font-weight: normal; cursor: default; }