This Discourse component allows you to easily customize the appearance of category logos across your forum. With various configurable settings, you can control how these logos are displayed, ensuring they fit seamlessly with your site's design.
- Enable/Disable Logo: Toggle the display of category logos.
- Aspect Ratio Options: Select the desired aspect ratio for the logos.
- Maximum Width Control: Set a maximum width for the logos, ensuring they don't exceed container size.
- Fit Options: Customize how logos fit within their containers using CSS
object-fit
properties. - Floating Logo Option: Decide if the category logos should float.
- Subcategories Layout: Control the placement of subcategories in relation to the category logo.
-
enabled
- Default:
true
- Description: Enable the category logo.
- Default:
-
container
- Default:
body
- Type:
string
- Description: CSS selector of the container to apply the style.
- Default:
-
ratio
- Default:
landscape
- Description: Ratio to display the category logo.
- Type:
enum
- Choices:
square
landscape
portrait
- Default:
-
max_width
- Default:
150
- Description: Value between 25 and 500 to limit the maximum width of the category logo (in pixels). The logo won't exceed the width of its container.
- Type:
float
- Min:
25
- Max:
500
- Default:
-
fit
- Default:
contain
- Description: The CSS function to use to sets how the category logo should be resized to fit its container. See
object-fit
on MDN. - Type:
enum
- Choices:
contain
cover
fill
none
scale-down
- Default:
-
floating
- Default:
true
- Description: Should the category logo be floating.
- Type:
bool
- Default:
-
subcategories_clear
- Default:
true
- Description: Should subcategories be below the category logo.
- Type:
bool
- Default:
To install this component on your Discourse forum:
- Go to
Admin
>Customize
>Themes
. - Click
Install
. - Choose
From a git repository
. - Enter the URL of this repository:
https://github.com/ICIJ/discourse-category-logo-aspect
- Click
Install
.
Contributions to this component are welcome! Please submit pull requests or issues to the repository to propose changes or report bugs.
This project is licensed under MIT License.