Please see the snippet below. By using a big text size, you can see that it will overflow the columns in small screens. I can't get why... Shouldn't auto-fill/fit algorithms take it into account while sizing columns and make them flow on the following row?
Please note: I am not looking for font-size auto-scaling here. My problem here is grid columns are not auto sizing and auto flowing accordingly. Also, if you want to understand the issue, you must see the example on small screens.
ul {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
gap: .5em;
padding: 0;
list-style: none;
}
li a {
display: block;
text-align: center;
padding: 10px;
background-color: red;
color: #fff;
text-decoration: none;
font-size: 29px;
}
<ul class="year-archives custom">
<li>
<a href="#" title="Archivio 2022" class="active">2022/23</a>
</li>
<li>
<a href="#" title="Archivio 2021">2021/22</a>
</li>
<li>
<a href="#" title="Archivio 2020">2020/21</a>
</li>
<li>
<a href="#" title="Archivio 2019">2019/20</a>
</li>
<li>
<a href="#" title="Archivio 2018">2018/19</a>
</li>
<li>
<a href="#" title="Archivio 2017">2017/18</a>
</li>
</ul>