[question] 2 column setup for profile links, how?

Hello beautiful people. I’ve come across https://8bit.lol/ and quite like the 2 column setup for the profile links.

Question: how can we achieve that with Markup? :slight_smile:

Screenshot from 2023-07-26 23-25-12

1 Like

Hey there. I suggest you take a look at the source code (on mobile so i can’t check for you) or ask @8bit himself.

Now how I’d do it. I’d wrap two fa-li unordered list elements in a div with the “flex” display property, one styled to align right and one styled to align left. This would probably scale horribly to mobile so I suggest you wait for 8bit to see this lol

1 Like

Hilariously I think you nailed exactly how I did it lol. I’ll copy in the relevant bits below, but I haven’t actually done any special handling for mobile, it just happens to not break because the amount of text on each line is small enough!

In the markdown:

--- Links ---

 <div id="links-left">

- https://social.lol/@8bit
- Links here

</div>
<div id="links-right">

- More links here

</div>

And then a bit of CSS in the custom styles section:

#links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 1em;
}

#links-left .fa-ul {
    margin-left: unset;
    margin-right: var(--fa-li-margin, 2.5em);
    padding-left: unset;
    padding-right: 0;
}

#links-left .fa-li {
    right: calc(var(--fa-li-width, 2em) * -1);
    left: unset;
}

#links-left li {
    text-align: right;
}

You could probably do it with flex too but I happened to try grid and it seemed to work :smiley:

Hope that helps @ricardo!

6 Likes

grid is probably better lol. Reminds me to do something similar on my own page.

2 Likes

Awesome, thanks for sharing!

2 Likes

what if i want all the icons to align left?

1 Like

Totally missed this reply, it should be even simpler since the icons are on the left by default.

As before:

#links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 1em;
}

But you’ll probably need some padding so it feels balanced, this seems alright:

#links-left {
    margin-left: 40px;
}
1 Like