I am trying to make document forms (like Sales Invoice and Stock Entry) span the full width of the screen in v16, but I’m hitting a wall trying to bypass the default max-width restrictions.
The native “Toggle Full Width” option is not appearing in my document action menu (the three dots), even after saving the document as a Draft.
I have tried injecting a few different Client Scripts to force the width, but v16 seems to overwrite or ignore them:
Injecting standard CSS to override .container and .layout-main-section.
Using frappe.dom.set_style to apply custom CSS variables (--container-width).
Using jQuery on refresh to directly modify the container’s CSS properties.
Is there a new standard method or workspace setting in v16 to achieve a global full-width layout? Any guidance would be greatly appreciated!
Let me know if you get a working solution from the forum, or if you want to try looking into your Frappe Cloud server configuration next!
/* ============================================
FORM WIDTH — always full width
Frappe caps .section-body / .form-footer at --page-max-width (900px)
unless the per-browser “Toggle Full Width” is on. Lift the cap for
all desk forms so grids and sections use the available space.
============================================ */
.std-form-layout .section-head,
.std-form-layout .section-body,
.form-footer {
max-width: none !important;
}
@RsALs Thank you for providing the exact CSS classes for v16! This is exactly what I was looking for.
I have two quick follow-up questions on implementing this:
Where is the best place to inject this CSS? Since v16 seems to overwrite or ignore standard <style> tag injections via onload or refresh Client Scripts, should this be deployed via a custom app’s hooks.py, or is there a trick to making it stick using a standard Client Script?
Preventing standard fields from stretching: When lifting the 900px cap, all the standard input fields (like Date, Customer, etc.) stretch across the entire screen, which makes the top of the form visually jarring. Is there an additional CSS class we can target to constrain the standard form fields to a sensible max width, while still allowing the child tables/grids to use 100% of the available space?