Currently tackling the challenge of arranging tournament pairs in a visually appealing tournaments tree view
The issue arises when the bracket columns have varying quantities of pairs, resulting in different heights due to the use of flex
I aim to achieve equality in height so that I can place pairs neatly between two pairs from the previous column
For example:
pair1
pair 5
pair2
pair3
pair 6
pair4
HTML:
<div class="flex">
<div *ngFor='let stage of stages; let i = index' class="bracket-column flex-column">
<div *ngFor='let pair of stage; let last = last' class="flex bracket-wrapper" style="flex: 1 !important">
<div *ngIf="pair.bracket === 1" class="bracket">
<p class="flex" [class.glow-text]='pair.score_participant_one > pair.score_participant_two'>{{pair.participant_one.user.username}} <span class="score">{{pair.score_participant_one}}</span></p>
<hr>
<p class="flex" [class.glow-text]='pair.score_participant_one < pair.score_participant_two'>{{pair.participant_two ? pair.participant_two?.user.username : 'BYE' }} <span class="score">{{pair.participant_two ? pair.score_participant_two : '-'}}</span></p>
</div>
</div>
</div>
</div>
CSS:
.bracket-column
margin-right: 2em
flex: 1 !important
box-sizing: border-box !important
height: 100% !important
.bracket
margin-bottom: 1em
padding: 0.5em
border: 2px solid styles.$highlight-color
width: 150px
background-color: styles.$additional-darker-color
p
margin: 0
width: 100%
color: styles.$additional-color
span
color: white
.flex
display: flex
justify-content: space-between
align-items: center
.flex-column
display: flex
flex-direction: column
justify-content: space-between
align-items: flex-start
Current Appearance:https://i.sstatic.net/ndg2a.png