youhosi / nodebb-theme-oxide

Theme based on Github for NodeBB.
MIT License
23 stars 19 forks source link

Second row on subcategories #5

Closed tom-rade closed 5 years ago

tom-rade commented 5 years ago

When you have a lot of subcategories, there should be a new line, instead of a scrollbar. This is currently used in persona and is way more practical. Would also appreciate CSS-snippet to change this if this won't be changed in master.

youhosi commented 5 years ago

@tom-rade Could you give a screenshot?

tom-rade commented 5 years ago

https://imgur.com/Eds7duu There you go

youhosi commented 5 years ago

Hello @tom-rade! I will not change this to branch master, but you have here the code that corrects it, let me know if exactly what you wanted! :)

[component="categories/category"] {
    .category-children {
        display: block !important;
        flex-wrap: unset !important;
        padding-bottom: 5px !important;

        .category-children-item {
            width: ~"calc(33% - 10px)";
            padding-bottom: 10px;
            display: block;
            flex: unset;
        }
    }
}
tom-rade commented 5 years ago

@youhosi Doesn't look very nice but still thanks. Could you nullify your changes for .category-children and .category-children-item (I think) and just use the persona way of doing things? Persona just does lists them in display: block; without doing seperated 33% width like this code.

youhosi commented 5 years ago

@tom-rade, sure:

[component="categories/category"] {
    .category-children {
        display: block !important;
        flex-wrap: unset !important;
        padding-bottom: 5px !important;

        .category-children-item {
            padding-bottom: 10px;
            display: block;
            flex: unset;
        }
    }
}
tom-rade commented 5 years ago

@youhosi I eventually settled for this custom CSS (easier to implement and is consistent across theme updates:

.category-children {
    display: block !important;
    flex-wrap: unset !important;
    padding-bottom: 5px !important;
}
.category-children-item {
    padding-bottom: 5px;
    display: block;
    flex: unset;
}

Thank you