Can we arrange the subcategories like this?

Hi helpful friends.

This is how I use it now. display : flex
Ekran görüntüsü 2024-06-13 160953

Can we do it like this?
How

But not like that. display : block
Ekran görüntüsü 2024-06-13 161553

Thank you :pray:

2 Likes

That looks SO much better :star_struck:

1 Like

I found the solution this way.
But when the subcategory name is long, it breaks.
I’m waiting if anyone can find a solution to this.
You can use it in this state. :slight_smile:

When long name.
Ekran görüntüsü 2024-06-13 220505

When short name.
Ekran görüntüsü 2024-06-13 220610

.category-list .subcategories {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}
.category-list .subcategories .subcategory {
    flex-shrink: 0;
    min-width: 25%;
}
1 Like

You’ll want to use CSS Grids here.

Something like:

.category-list .subcategories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, min-content));
}

If you want the columns to be perfectly equal size, you can change min-content to 1fr.

7 Likes

Now this is much better. Thank you @Alteras :pray:

2 Likes

how can I add this to the theme in my community.

can someone help?

thanks.


Here in CSS write and save

1 Like

As ogulcan1787 stated, you can create a new component and insert the CSS there.

You can follow these instructions:

  • Go to Admin → Customize

  • Click on Install button
    image

  • Then attach it to your theme and click on Edit CSS/HTML button
    image

  • Use the CSS section:
    image

6 Likes

thank you @Arkshine

this was helpful.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.