Skip to content

Commit

Permalink
Add stylesheet to fileinput button (#6479)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Mar 11, 2024
1 parent 7d525e6 commit 339ade7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions panel/dist/css/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,12 @@
: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);
}
7 changes: 5 additions & 2 deletions panel/widgets/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from base64 import b64decode
from datetime import date, datetime
from typing import (
TYPE_CHECKING, Any, ClassVar, Dict, Iterable, Mapping, Optional, Tuple,
Type,
TYPE_CHECKING, Any, ClassVar, Dict, Iterable, List, Mapping, Optional,
Tuple, Type,
)

import numpy as np
Expand All @@ -27,6 +27,7 @@
)

from ..config import config
from ..io.resources import CDN_DIST
from ..layout import Column, Panel
from ..models import (
DatetimePicker as _bkDatetimePicker, TextAreaInput as _bkTextAreaInput,
Expand Down Expand Up @@ -195,6 +196,8 @@ 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:
Expand Down

0 comments on commit 339ade7

Please sign in to comment.