Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/extend/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ Independently of the container, the discussion post stream is capped on wide scr
}
```

## Logo Size and Quality

From Flarum 2.1, an uploaded logo, and the dark mode logo, are stored 90px tall as WebP at quality 90. The header shows the logo at most 30px tall, so it stays sharp on screens with up to three times the pixel density. A theme that shows the logo larger can store it taller, or at another quality, with the `Theme` extender:

```php
use Flarum\Extend;

return [
(new Extend\Theme())
->logo(height: 126, quality: 95),
];
```

Store the logo at its displayed height times the pixel density it should stay sharp at: a logo shown 42px tall needs 126px for 3x screens. Both arguments are optional, and the one you leave out keeps its default. The quality runs from 1 to 100. An animated logo is stored as GIF, which has no quality setting.

The values apply when a logo is uploaded. A logo that is already stored keeps its size and quality until an admin uploads it again.

## Switching Between Themes

Flarum doesn't currently have a comprehensive system that would support switching between themes. This is planned for future releases.
4 changes: 4 additions & 0 deletions docs/extend/update-2_x.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ If you need help applying these changes or using new features, please start a di

## 2.1 Changes

### Logos

Uploaded logos are now stored 90px tall at WebP quality 90, rather than 60px tall at quality 75. A theme that shows the logo larger can choose the stored height and quality with `(new Extend\Theme())->logo()`. See [Logo Size and Quality](theme.md#logo-size-and-quality).

Loading