filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.39k stars 2.97k forks source link

Support globally setting simple page max width #14819

Open zepfietje opened 5 days ago

zepfietje commented 5 days ago

Description

Currently it's not possible to globally set the max width for simple pages like registration and login. This pull request adds support for globally configuring the width just like is already possible for regular pages.

Functional changes

zepfietje commented 4 days ago

Hmm, ideally the APIs would be maxPageContentWidth and maxSimplePageContentWidth, don't you think? Just "simple" without "page" might not be clear enough.

Regarding "max width" vs "max content width", I'm aware of that inconsistency but just stuck to the existing naming. Happy to change anything where possible :)

zepfietje commented 3 days ago

@danharrin actually I'm not sure if I like this configuration on the panel provider as global config methods. What do you think about introducing a static property on the page classes, $defaultMaxContentWidth?

danharrin commented 3 days ago

1) Static properties can only really be set once and not per-request otherwise it breaks Octane 2) Static properties can't differentiate widths based on which panel is used

Personally I usually only use static properties for BC or when something can't be a panel configuration option

Why don't you like the panel config method pattern?

zepfietje commented 3 days ago
  1. Didn't know about that, good point.
  2. Static properties would have to be set in bootUsing() of the panel config.

I do like the panel config method pattern in general, but the max page content width APIs feel a bit weird since there's two different types of pages. Maybe it's just a naming issue we can easily resolve though.