diff --git a/doc/_static/style.css b/doc/_static/style.css index 4bc6e03708e..8e53c6a49eb 100644 --- a/doc/_static/style.css +++ b/doc/_static/style.css @@ -161,20 +161,45 @@ iframe.sg_report { top: 0; } -/* TODO: Either pydata-sphinx-theme (for using Bootstrap) or sphinx-gallery (for adding table formatting) should fix this */ -.table-striped-columns>:not(caption)>tr>:nth-child(2n),.table-striped>tbody>tr:nth-of-type(odd)>* { - --bs-table-accent-bg: var(--bs-table-striped-bg); +/* ******************************************************** HTML repr tables */ + +/* make table responsive to pydata-sphinx-theme's light/dark mode */ +.table > :not(caption) > * > * { color: var(--pst-color-text-base); } -.table-hover>tbody>tr:hover>* { - --bs-table-accent-bg: var(--bs-table-hover-bg); - color: var(--pst-color-text-base); +.mne-repr-table tbody tr:hover { + background-color: var(--pst-color-table-row-hover-bg); } -.rendered_html table { - color: var(--pst-color-text-base); +.mne-repr-section-toggle > button > svg > path { + fill: var(--pst-color-text-base); } - - +/* make the expand/collapse button look nicer */ +.mne-repr-section-toggle > button { + padding: 20%; +} +/* make section header rows more distinct (and harmonize with pydata-sphinx-theme table +style in the process). Color copied from pydata-sphinx-theme; 2px copied from bootstrap. +*/ +.mne-repr-table th { + border-bottom: 2px solid var(--pst-color-primary); +} +/* harmonize the channel names buttons with the rest of the table */ +.mne-ch-names-btn { + font-size: inherit; + padding: 0.25rem; + min-width: 1.5rem; + font-weight: bold; +} +/* +.mne-ch-names-btn:hover { + background-color: var(--pst-color-); + text-decoration: underline; +} +.mne-ch-names-btn:focus-visible { + outline: 0.1875rem solid var(--pst-color-accent); + outline-offset: 0.1875rem; +} +*/ /* ***************************************************** sphinx-design fixes */ p.btn a { color: unset; diff --git a/mne/html_templates/repr/_acquisition.html.jinja b/mne/html_templates/repr/_acquisition.html.jinja index c688107b0d1..0016740cdf8 100644 --- a/mne/html_templates/repr/_acquisition.html.jinja +++ b/mne/html_templates/repr/_acquisition.html.jinja @@ -3,33 +3,23 @@ {# Collapse content during documentation build. #} {% if collapsed %} -{% set collapsed_row_class = "repr-element-faded repr-element-collapsed" %} +{% set collapsed_row_class = "mne-repr-collapsed" %} {% else %} {% set collapsed_row_class = "" %} {% endif %} - - - - - - {{ section }} - - +{%include 'static/_section_header_row.html.jinja' %} + {% if duration %} - + Duration {{ duration }} (HH:MM:SS) {% endif %} {% if inst is defined and inst | has_attr("kind") and inst | has_attr("nave") %} - + Aggregation {% if inst.kind == "average" %} average of {{ inst.nave }} epochs @@ -42,21 +32,21 @@ {% endif %} {% if inst is defined and inst | has_attr("comment") %} - + Condition {{inst.comment}} {% endif %} {% if inst is defined and inst | has_attr("events") %} - + Total number of events {{ inst.events | length }} {% endif %} {% if event_counts is defined %} - + Events counts {% if events is not none %} @@ -72,35 +62,35 @@ {% endif %} {% if inst is defined and inst | has_attr("tmin") and inst | has_attr("tmax") %} - + Time range {{ inst | format_time_range }} {% endif %} {% if inst is defined and inst | has_attr("baseline") %} - + Baseline {{ inst | format_baseline }} {% endif %} {% if info["sfreq"] is defined and info["sfreq"] is not none %} - + Sampling frequency {{ "%0.2f" | format(info["sfreq"]) }} Hz {% endif %} {% if inst is defined and inst.times is defined %} - + Time points {{ inst.times | length | format_number }} {% endif %} {% if inst is defined and inst | has_attr("metadata") %} - + Metadata {{ inst | format_metadata }} diff --git a/mne/html_templates/repr/_channels.html.jinja b/mne/html_templates/repr/_channels.html.jinja index d6ccb09312d..4f7646e9c80 100644 --- a/mne/html_templates/repr/_channels.html.jinja +++ b/mne/html_templates/repr/_channels.html.jinja @@ -3,36 +3,26 @@ {# Collapse content during documentation build. #} {% if collapsed %} -{% set collapsed_row_class = "repr-element-faded repr-element-collapsed" %} +{% set collapsed_row_class = "mne-repr-collapsed" %} {% else %} {% set collapsed_row_class = "" %} {% endif %} - - - - - - {{ section }} - - +{%include 'static/_section_header_row.html.jinja' %} + {% for channel_type, channels in (info | format_channels).items() %} {% set channel_names_good = channels["good"] | map(attribute='name_html') | join(', ') %} - + {{ channel_type }} - {% if channels["bad"] %} {% set channel_names_bad = channels["bad"] | map(attribute='name_html') | join(', ') %} - and {% endif %} @@ -41,7 +31,7 @@ {% endfor %} - + Head & sensor digitization {% if info["dig"] is not none %} {{ info["dig"] | length }} points diff --git a/mne/html_templates/repr/_filters.html.jinja b/mne/html_templates/repr/_filters.html.jinja index b01841cf137..97ede5157c1 100644 --- a/mne/html_templates/repr/_filters.html.jinja +++ b/mne/html_templates/repr/_filters.html.jinja @@ -3,40 +3,30 @@ {# Collapse content during documentation build. #} {% if collapsed %} -{% set collapsed_row_class = "repr-element-faded repr-element-collapsed" %} +{% set collapsed_row_class = "mne-repr-collapsed" %} {% else %} {% set collapsed_row_class = "" %} {% endif %} - - - - - - {{ section }} - - +{%include 'static/_section_header_row.html.jinja' %} + {% if info["highpass"] is defined and info["highpass"] is not none %} - + Highpass {{ "%0.2f" | format(info["highpass"]) }} Hz {% endif %} {% if info["lowpass"] is defined and info["lowpass"] is not none %} - + Lowpass {{ "%0.2f" | format(info["lowpass"]) }} Hz {% endif %} {% if info.projs is defined and info.projs %} - + Projections {% for p in (info | format_projs) %} diff --git a/mne/html_templates/repr/_general.html.jinja b/mne/html_templates/repr/_general.html.jinja index c9ad8310e64..a57ae40049d 100644 --- a/mne/html_templates/repr/_general.html.jinja +++ b/mne/html_templates/repr/_general.html.jinja @@ -3,26 +3,16 @@ {# Collapse content during documentation build. #} {% if collapsed %} -{% set collapsed_row_class = "repr-element-faded repr-element-collapsed" %} +{% set collapsed_row_class = "mne-repr-collapsed" %} {% else %} {% set collapsed_row_class = "" %} {% endif %} - - - - - - {{ section }} - - +{%include 'static/_section_header_row.html.jinja' %} + {% if filenames %} - + Filename(s) {% for f in filenames %} @@ -33,12 +23,12 @@ {% endif %} - + MNE object type {{ inst | data_type }} - + Measurement date {% if info["meas_date"] is defined and info["meas_date"] is not none %} {{ info["meas_date"] | dt_to_str }} @@ -47,7 +37,7 @@ {% endif %} - + Participant {% if info["subject_info"] is defined and info["subject_info"] is not none %} {% if info["subject_info"]["his_id"] is defined %} @@ -58,7 +48,7 @@ {% endif %} - + Experimenter {% if info["experimenter"] is defined and info["experimenter"] is not none %} {{ info["experimenter"] }} diff --git a/mne/html_templates/repr/epochs.html.jinja b/mne/html_templates/repr/epochs.html.jinja index 991aa8de0e3..6b33c177e87 100644 --- a/mne/html_templates/repr/epochs.html.jinja +++ b/mne/html_templates/repr/epochs.html.jinja @@ -2,7 +2,7 @@ {% set info = inst.info %} - +
{%include '_general.html.jinja' %} {%include '_acquisition.html.jinja' %} {%include '_channels.html.jinja' %} diff --git a/mne/html_templates/repr/evoked.html.jinja b/mne/html_templates/repr/evoked.html.jinja index 991aa8de0e3..6b33c177e87 100644 --- a/mne/html_templates/repr/evoked.html.jinja +++ b/mne/html_templates/repr/evoked.html.jinja @@ -2,7 +2,7 @@ {% set info = inst.info %} -
+
{%include '_general.html.jinja' %} {%include '_acquisition.html.jinja' %} {%include '_channels.html.jinja' %} diff --git a/mne/html_templates/repr/forward.html.jinja b/mne/html_templates/repr/forward.html.jinja index 22be9248ecc..510a775c2b6 100644 --- a/mne/html_templates/repr/forward.html.jinja +++ b/mne/html_templates/repr/forward.html.jinja @@ -1,12 +1,12 @@ {%include '_js_and_css.html.jinja' %} -
+
{% for channel_type, channels in (info | format_channels).items() %} {% set channel_names_good = channels["good"] | map(attribute='name_html') | join(', ') %}
{{ channel_type }} -