Browse Source

Début d’onglets sur l’index

master
Matthieu Marcillaud 9 months ago
parent
commit
6635d1e6f0
  1. 80
      templates/autodoc.css
  2. 2
      templates/index.html.twig

80
templates/autodoc.css

@ -10,6 +10,9 @@
--border-color--dark: #ccc;
--table-heading-bg: #f6f6f6;
--table-hover-bg: #f5f5f5;
--link-color: #91548c;
--link-color--hover: #6d446a;
}
html {
accent-color: var(--theme-color);
@ -27,12 +30,13 @@ main {
}
a {
color: #91548C;
color: var(--link-color);
text-decoration: none;
transition: color .2s;
transition: color 0.2s;
}
a:hover, a:focus {
color: #6D446A;
a:hover,
a:focus {
color: var(--link-color--hover);
text-decoration: underline;
}
@ -92,6 +96,10 @@ a:hover, a:focus {
padding-left: 150px;
}
.content {
margin-top: 2em;
}
table {
border-collapse: collapse;
border-spacing: 0;
@ -138,8 +146,66 @@ td.links a + a:before {
}
.footer {
background-color: #F5F5F5;
border-top: 1px solid #E5E5E5;
background-color: #f5f5f5;
border-top: 1px solid #e5e5e5;
margin-top: 70px;
padding: 40px 0;
}
}
/* tabs interaction */
.tabset > input[type="radio"] {
position: absolute;
left: -200vw;
}
.tabset .tab-panel {
display: none;
}
.tabset > input:first-child:checked ~ .tab-panels > .tab-panel:first-child,
.tabset > input:nth-child(3):checked ~ .tab-panels > .tab-panel:nth-child(2),
.tabset > input:nth-child(5):checked ~ .tab-panels > .tab-panel:nth-child(3),
.tabset > input:nth-child(7):checked ~ .tab-panels > .tab-panel:nth-child(4),
.tabset > input:nth-child(9):checked ~ .tab-panels > .tab-panel:nth-child(5),
.tabset > input:nth-child(11):checked ~ .tab-panels > .tab-panel:nth-child(6) {
display: block;
}
/* tabs decoration */
.tabset > label {
position: relative;
display: inline-block;
padding: .5em 1em 10px;
cursor: pointer;
font-weight: 600;
background: var(--theme-gray-lighter);
}
.tabset > label::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 4px;
background: var(--theme-gray-light);
}
.tabset > label:hover,
.tabset > input:focus + label {
color: var(--link-color--hover);
}
.tabset > label:hover::after,
.tabset > input:focus + label::after,
.tabset > input:checked + label::after {
background: var(--link-color--hover);
}
.tabset > input:checked + label {
background: transparent;
}
.tab-panel {
padding: 30px 0;
}

2
templates/index.html.twig

@ -43,7 +43,7 @@
<label for="tab0">Tous</label>
{% for organization, name in organizations %}
{% if groups[organization] %}
<input type="radio" name="tabset" id="tab{{ loop.index }}" aria-controls="{{ name|slug }}" checked>
<input type="radio" name="tabset" id="tab{{ loop.index }}" aria-controls="{{ name|slug }}">
<label for="tab{{ loop.index }}">{{ name }}</label>
{% endif %}
{% endfor %}

Loading…
Cancel
Save