From ff17afbe690a2958682e7948bdedc5e4fc47566a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 29 Mar 2024 11:03:11 +0100 Subject: [PATCH 1/2] Only update bootstrap buttons --- panel/dist/css/button.css | 9 --------- panel/theme/css/bootstrap.css | 9 +++++++++ panel/widgets/input.py | 7 ++----- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/panel/dist/css/button.css b/panel/dist/css/button.css index cad2e7e13f..b86c067213 100644 --- a/panel/dist/css/button.css +++ b/panel/dist/css/button.css @@ -157,12 +157,3 @@ :host(.bk-panel-models-widgets-FileDownload) .bk-btn .bk-TablerIcon { margin-left: 0.5em; } - -input[type='file'].bk-input { - padding-left: 10px; -} - -input[type='file']::file-selector-button { - background: var(--surface-color); - color: var(--surface-text-color); -} diff --git a/panel/theme/css/bootstrap.css b/panel/theme/css/bootstrap.css index e3e3a40308..c70fc7dcd7 100644 --- a/panel/theme/css/bootstrap.css +++ b/panel/theme/css/bootstrap.css @@ -595,6 +595,15 @@ textarea.bk-input { --bs-btn-disabled-border-color: #212529; } +input[type='file'].bk-input { + padding-left: 10px; +} + +input[type='file']::file-selector-button { + background: var(--surface-color); + color: var(--surface-text-color); +} + .bk-menu { background-color: var(--bs-form-control-bg); color: var(--bs-form-control-color); diff --git a/panel/widgets/input.py b/panel/widgets/input.py index f370386762..88b8039301 100644 --- a/panel/widgets/input.py +++ b/panel/widgets/input.py @@ -10,8 +10,8 @@ from base64 import b64decode from datetime import date, datetime from typing import ( - TYPE_CHECKING, Any, ClassVar, Dict, Iterable, List, Mapping, Optional, - Tuple, Type, + TYPE_CHECKING, Any, ClassVar, Dict, Iterable, Mapping, Optional, Tuple, + Type, ) import numpy as np @@ -27,7 +27,6 @@ ) from ..config import config -from ..io.resources import CDN_DIST from ..layout import Column, Panel from ..models import ( DatetimePicker as _bkDatetimePicker, TextAreaInput as _bkTextAreaInput, @@ -196,8 +195,6 @@ class FileInput(Widget): _widget_type: ClassVar[Type[Model]] = _BkFileInput - _stylesheets: ClassVar[List[str]] = [f'{CDN_DIST}css/button.css'] - def _process_param_change(self, msg): msg = super()._process_param_change(msg) if 'value' in msg: From 63e7f5b2c81a98b729fb2f55dca09b11248eec43 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 1 Apr 2024 14:26:10 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- panel/theme/css/bootstrap.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/theme/css/bootstrap.css b/panel/theme/css/bootstrap.css index c70fc7dcd7..4b94389d22 100644 --- a/panel/theme/css/bootstrap.css +++ b/panel/theme/css/bootstrap.css @@ -600,8 +600,8 @@ input[type='file'].bk-input { } input[type='file']::file-selector-button { - background: var(--surface-color); - color: var(--surface-text-color); + background: var(--bs-surface-bg); + color: var(--bs-surface-color); } .bk-menu {