My CSS design for the three 'nav-item's requires me to have different styles for each one, making the code repetitive. Is there a way to streamline the code while keeping the unique design of the first 'nav-item'?
.nav {
width: 100%;
}
.nav-item {
width: 30%;
text-align: center;
}
.nav-link {
background-color: #F3F4F5;
color: black;
font-family: "Times New Roman", Times, serif;
}
#progress-item {
clip-path: polygon(90% 0%, 0% 0%, 0% 100%, 100% 100%);
}
#rank-item {
margin-left: -2.5%;
clip-path: polygon(0% 0%, 90% 0%, 100% 100%, 10% 100%);
}
#achievements-item {
margin-left: -2.5%;
clip-path: polygon(0% 0%, 90% 0%, 100% 100%, 10% 100%);
}
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<div class="container">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" id="progress-item" role="presentation">
<a class="nav-link" id="progress-tab" data-toggle="tab" href="#progress">
Overall progress
</a>
</li>
<li class="nav-item" id="rank-item" role="presentation">
<a class="nav-link" id="rank-tab" data-toggle="tab" href="#rank">
Ranking table
</a>
</li>
<li class="nav-item" id="achievements-item" role="presentation">
<a class="nav-link" id="achievements-tab" data-toggle="tab" href="#achievements">
Achievements list
</a>
</li>
</ul>
</div>