mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-07 22:06:01 +02:00
More tabs styling
This commit is contained in:
2
themes/grav/css-compiled/preset.css
vendored
2
themes/grav/css-compiled/preset.css
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -830,7 +830,31 @@ form {
|
||||
color: shade($content-text, 20%);
|
||||
background: shade($content-bg, 10%);
|
||||
}
|
||||
|
||||
border-bottom: 1px solid $form-border;
|
||||
|
||||
&.active {
|
||||
border-top: 1px solid $form-border;
|
||||
border-left: 1px solid $form-border;
|
||||
border-right: 1px solid $form-border;
|
||||
border-bottom: 0;
|
||||
|
||||
&:hover {
|
||||
background: $content-bg;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.tabs-content {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
{% set active = 1 %}
|
||||
{% endif %}
|
||||
|
||||
{{ dump(active) }}
|
||||
|
||||
{% if field.fields %}
|
||||
{% set storedValue = get_cookie('grav-tabs-state')|default('{}')|json_decode %}
|
||||
{% set tabsKey = field.fields|keys|join('.') %}
|
||||
@@ -15,14 +17,14 @@
|
||||
<div class="tabs-nav">
|
||||
{% for tab in field.fields %}
|
||||
{% if tab.type == 'tab' and (tab.security is empty or authorize(array(tab.security))) %}
|
||||
{#<input type="radio" name="tab-{{ tabsKey }}" id="tab-{{ tabsKey ~ loop.index }}" value="{{ (scope ~ tab.name) }}" class="tab-head no-form" />#}
|
||||
{#<label for="tab-{{ tabsKey ~ loop.index }}">#}
|
||||
{#{% if grav.twig.twig.filters['tu'] is defined %}{{ tab.title|tu }}{% else %}{{ tab.title|t }}{% endif %}#}
|
||||
{#</label>#}
|
||||
{#<input type="radio" name="tab-{{ tabsKey }}" id="tab-{{ tabsKey ~ loop.index }}" value="{{ (scope ~ tab.name) }}" class="tab-head no-form" />#}
|
||||
{#<label for="tab-{{ tabsKey ~ loop.index }}">#}
|
||||
{#{% if grav.twig.twig.filters['tu'] is defined %}{{ tab.title|tu }}{% else %}{{ tab.title|t }}{% endif %}#}
|
||||
{#</label>#}
|
||||
|
||||
<a class="tab__link {{ ((attribute(storedValue, 'tab-' ~ tabsKey) == scope ~ tab.name) or active == loop.index) ? 'active' : '' }}" href="#" data-tabid="tab-{{ tabsKey ~ loop.index }}">
|
||||
{% if grav.twig.twig.filters['tu'] is defined %}{{ tab.title|tu }}{% else %}{{ tab.title|t }}{% endif %}
|
||||
</a>
|
||||
<a class="tab__link {{ ((attribute(storedValue, 'tab-' ~ tabsKey) == scope ~ tab.name) or active == loop.index) ? 'active' : '' }}" href="#" data-tabid="tab-{{ tabsKey ~ loop.index }}">
|
||||
{% if grav.twig.twig.filters['tu'] is defined %}{{ tab.title|tu }}{% else %}{{ tab.title|t }}{% endif %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user