mirror of
https://github.com/documenso/documenso.git
synced 2026-07-09 12:35:04 +10:00
0b86ece1d5
Platform-plan organisations and teams can now customise non-embed signing pages with six brand colour tokens, a border-radius, and a free-text custom CSS block (up to 256 KB). - Stored on OrganisationGlobalSettings / TeamGlobalSettings; teams inherit from the org via brandingEnabled === null. - CSS is sanitised on save (PostCSS) so we can inline it at SSR with no per-render parsing. - Rendered via a nonce'd <style> scoped under .documenso-branded, using native CSS nesting so user selectors don't need scoping. - Gated on the existing embedSigningWhiteLabel claim (or self-hosted) — reuses the embed white-label decision.
12 lines
566 B
TypeScript
12 lines
566 B
TypeScript
/**
|
|
* Maximum length (in characters) of the user-supplied custom CSS for branding.
|
|
* Bound enforced at the TRPC request boundary on both the organisation and
|
|
* team settings update routes. The sanitiser is run after this check; this
|
|
* limit is purely a request-size guard.
|
|
*
|
|
* 256 KB — generous enough for hand-written branding CSS and the occasional
|
|
* compiled-from-Tailwind-or-similar paste, while still keeping a request
|
|
* cap so a malicious or runaway payload can't exhaust PostCSS/server memory.
|
|
*/
|
|
export const BRANDING_CSS_MAX_LENGTH = 256 * 1024;
|