fix: keep the tab rows from scrolling vertically
This commit is contained in:
1 parent
e9b0de44f1
commit
8f4c4d8267
3 files changed
+22
-4
No files matched your search
@@ -23,3 +23,21 @@
|
|||||||
.section-title {
|
.section-title {
|
||||||
@apply text-base font-semibold uppercase tracking-wide text-brand;
|
@apply text-base font-semibold uppercase tracking-wide text-brand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A row of tabs (_partials/_tabs.html.twig, the questionnaire list). The row scrolls sideways on
|
||||||
|
* narrow screens, which makes it a vertical scroll container too, so nothing may stick out below
|
||||||
|
* it: the base line is an inset shadow the tabs' underline paints over, not a border they would
|
||||||
|
* have to overlap with a negative margin.
|
||||||
|
*/
|
||||||
|
.tabs {
|
||||||
|
@apply flex overflow-x-auto shadow-[inset_0_-1px_0_var(--color-line)];
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
@apply shrink-0 whitespace-nowrap border-b-4 border-transparent px-3 py-2 text-sm text-ink hover:text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab--current {
|
||||||
|
@apply border-brand-bright font-bold text-brand;
|
||||||
|
}
|
||||||
@@ -8,12 +8,12 @@
|
|||||||
{% if back %}
|
{% if back %}
|
||||||
{{ include('_partials/_back_link.html.twig', { 'url': back.uri, 'label': back.label }) }}
|
{{ include('_partials/_back_link.html.twig', { 'url': back.uri, 'label': back.label }) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<nav aria-label="Bereiche" class="flex overflow-x-auto border-b border-line mb-8">
|
<nav aria-label="Bereiche" class="tabs mb-8">
|
||||||
{% for child in item.children|filter(child => child.displayed and child.extras.divider is not defined and child.extras.back is not defined) %}
|
{% for child in item.children|filter(child => child.displayed and child.extras.divider is not defined and child.extras.back is not defined) %}
|
||||||
{# by route name: the items carry the return url, which the matcher would compare as well #}
|
{# by route name: the items carry the return url, which the matcher would compare as well #}
|
||||||
{% set current = child.extras.routes|default([])|filter(r => r.route is defined and r.route == app.request.attributes.get('_route'))|length > 0 %}
|
{% set current = child.extras.routes|default([])|filter(r => r.route is defined and r.route == app.request.attributes.get('_route'))|length > 0 %}
|
||||||
<a href="{{ child.uri }}"
|
<a href="{{ child.uri }}"
|
||||||
class="{{ html_classes('-mb-px shrink-0 whitespace-nowrap border-b-4 px-3 py-2 text-sm', { 'border-brand-bright font-bold text-brand': current, 'border-transparent text-ink hover:text-brand': not current }) }}"
|
class="{{ html_classes('tab', { 'tab--current': current }) }}"
|
||||||
{% if current %}aria-current="page"{% endif %}>{{ child.label|raw }}</a>
|
{% if current %}aria-current="page"{% endif %}>{{ child.label|raw }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -29,11 +29,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{# one tab per questionnaire, as the record tabs (_partials/_tabs.html.twig) #}
|
{# one tab per questionnaire, as the record tabs (_partials/_tabs.html.twig) #}
|
||||||
<nav aria-label="Fragebögen" class="flex overflow-x-auto border-b border-line mb-6">
|
<nav aria-label="Fragebögen" class="tabs mb-6">
|
||||||
{% for other in definitions %}
|
{% for other in definitions %}
|
||||||
{% set current = other.key == definition.key %}
|
{% set current = other.key == definition.key %}
|
||||||
<a href="{{ path('app_administrative_questionnaire_index', { 'questionnaire': other.key }) }}"
|
<a href="{{ path('app_administrative_questionnaire_index', { 'questionnaire': other.key }) }}"
|
||||||
class="{{ html_classes('-mb-px shrink-0 whitespace-nowrap border-b-4 px-3 py-2 text-sm', { 'border-brand-bright font-bold text-brand': current, 'border-transparent text-ink hover:text-brand': not current }) }}"
|
class="{{ html_classes('tab', { 'tab--current': current }) }}"
|
||||||
{% if current %}aria-current="page"{% endif %}>{{ other.title }}</a>
|
{% if current %}aria-current="page"{% endif %}>{{ other.title }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
Reference in new issue
Block a user