Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main area of FastListTemplate does not stretch when main_layout=None #6024

Closed
MarcSkovMadsen opened this issue Dec 9, 2023 · 1 comment · Fixed by #6023
Closed

main area of FastListTemplate does not stretch when main_layout=None #6024

MarcSkovMadsen opened this issue Dec 9, 2023 · 1 comment · Fixed by #6023
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

I would like to be able to use the FastListTemplate with main_layout=None some more. Because it is really nicely styled when #6023 is merged.

But currently sizing_mode="stretch_both" does not make things stretch. It does when I don't use main_layout=None.

import panel as pn

CSS_FIXES_TO_BE_UPSTREAMED_TO_PANEL = """
#sidebar {
    padding-left: 5px !important;
    background-color: var(--panel-surface-color);
}
.bk-active.bk-btn-primary {border-color: var(--accent-fill-active)}
.bk-btn-primary:hover {border-color: var(--accent-fill-hover)}
.bk-btn-primary {border-color: var(--accent-fill-rest)}
a {color: var(--accent-fill-rest) !important;}
a:hover {color: var(--accent-fill-hover) !important;}
"""
# .pn-wrapper {
#     height: calc( 100vh - 150px);
# }

pn.extension(sizing_mode="stretch_width", inline=True, raw_css=[CSS_FIXES_TO_BE_UPSTREAMED_TO_PANEL])

ACCENT = "#da1a5f"

def even_or_odd(contents, user, instance):
    if len(contents) % 2 == 0:
        return "Even number of characters."
    return "Odd number of characters."

chat = pn.chat.ChatInterface(callback=even_or_odd, sizing_mode="stretch_both")

pn.template.FastListTemplate(
       title="Test App", 
       sidebar="## Settings",
       main=[chat],
       accent=ACCENT,
       main_layout=None,
).servable()

image

Works when I use default value for main_layout.

image

@MarcSkovMadsen MarcSkovMadsen added the type: bug Something isn't correct or isn't working label Dec 9, 2023
@MarcSkovMadsen MarcSkovMadsen added this to the next milestone Dec 9, 2023
@MarcSkovMadsen
Copy link
Collaborator Author

I can see that this can be fixed by adding

div.pn-wrapper {
  height: 100%;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants