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

panel template header colors not working. #1872

Closed
ea42gh opened this issue Dec 24, 2020 · 1 comment · Fixed by #1917
Closed

panel template header colors not working. #1872

ea42gh opened this issue Dec 24, 2020 · 1 comment · Fixed by #1917
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@ea42gh
Copy link
Contributor

ea42gh commented Dec 24, 2020

ALL software version info

panel version 0.10.2

Description of expected behavior and the observed behavior

The templates do not handle header_color and header_background correctly.

  • VanillaTemplate, Material template set the background, but not the color
  • GoldenTemplate sets neither

header background set with '#ABCDEF' fails

Further information is at
https://discourse.holoviz.org/t/how-do-template-parameters-header-color-and-header-background-work/1613/2

Complete, minimal, self-contained example code that reproduces the issue

css = """ 
.title{color:white !important;}
"""
import panel as pn
pn.extension() #  pn.extension( raw_css=[css])  # workaround needed for setting the title color

tmpl = pn.template.MaterialTemplate(title='Test Material Template', header_color='yellow', header_background="rgb(59,54,81)")

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Dec 26, 2020
@philippjfr philippjfr added this to the v0.10.3 milestone Jan 15, 2021
@awesomebytes
Copy link

I misunderstood header_background to be... well, anything being a background instead of a color. I wanted to put a background image. I solved it by doing:

css = """ 
.mdc-top-app-bar{background-image: url('my_image.png'); !important; }
"""
pn.extension(raw_css=[css])

And that did the trick for me. While trying to find a solution with different search engine queries this closed issue appeared often, so I thought it would be worth it to put my solution here.

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.

3 participants