From 674e908a543664a610cd62b466631545ab3cace9 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Fri, 12 Nov 2021 07:31:42 -0500 Subject: [PATCH] Allow setting a maximum height for the loading indicator (#2910) --- panel/config.py | 3 +++ panel/io/resources.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/panel/config.py b/panel/config.py index 0677e92ad3..40775e4b57 100644 --- a/panel/config.py +++ b/panel/config.py @@ -96,6 +96,9 @@ class _config(_base_config): loading_color = param.Color(default='#c3c3c3', doc=""" Color of the loading indicator.""") + loading_max_height = param.Integer(default=400, doc=""" + Maximum height of the loading indicator.""") + profiler = param.Selector(default=None, allow_None=True, objects=[ 'pyinstrument', 'snakeviz'], doc=""" The profiler engine to enable.""") diff --git a/panel/io/resources.py b/panel/io/resources.py index daf26a4a62..c02703cb59 100644 --- a/panel/io/resources.py +++ b/panel/io/resources.py @@ -77,7 +77,8 @@ def loading_css(): b64 = b64encode(svg.encode('utf-8')).decode('utf-8') return f""" .bk.pn-loading.{config.loading_spinner}:before {{ - background-image: url("data:image/svg+xml;base64,{b64}") + background-image: url("data:image/svg+xml;base64,{b64}"); + max-height: {config.loading_max_height}px; }} """