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

Change header accent base color to white in Fast Templates #2611

Merged
merged 3 commits into from
Aug 4, 2021

Conversation

MarcSkovMadsen
Copy link
Collaborator

Fixes #2610

Looks like

image

when running

import panel as pn

pn.extension()

template=pn.template.FastListTemplate(title="App with Menu", header_accent_base_color="white")

ACCENT_BASE_COLOR = template.accent_base_color

COLLAPSED_ICON = f"""<svg style="stroke: { ACCENT_BASE_COLOR }" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" slot="collapsed-icon">
<path d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>"""

EXPANDED_ICON = f"""<svg style="stroke: { ACCENT_BASE_COLOR }" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" slot="expanded-icon">
<path d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z" stroke-linecap="round" stroke-linejoin="round"></path>
<path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
"""

MENU_HTML=f"""
<fast-accordion id="menu">
    <fast-accordion-item slot="item" expanded>
        <h3 slot="heading" style="margin:0px">Introduction</h3>{ COLLAPSED_ICON }{ EXPANDED_ICON }
        <ul>
            <li><a href="introduction">Introduction</a></li>
        </ul>
    </fast-accordion-item>
    <fast-accordion-item slot="item" expanded>
        <h3 slot="heading" style="margin:0px">Example Apps</h3>{ COLLAPSED_ICON }{ EXPANDED_ICON }
        <ul>
            <li class="menu-item-active"><a href="/">ML Explainability</a></li>
            <li><a href="/">Plots and Tables with Events</a></li>
            <li><a href="/">Cross Filtering</a></li>
            <li><a href="/">Streaming Data</a></li>
        </ul>
    </fast-accordion-item>
</fast-according>
"""

template.sidebar_footer=MENU_HTML

template.servable()

@codecov
Copy link

codecov bot commented Aug 4, 2021

Codecov Report

Merging #2611 (5a928d2) into master (b220588) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2611   +/-   ##
=======================================
  Coverage   83.09%   83.09%           
=======================================
  Files         184      184           
  Lines       23295    23295           
=======================================
  Hits        19356    19356           
  Misses       3939     3939           
Impacted Files Coverage Δ
panel/template/fast/theme.py 97.72% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b220588...5a928d2. Read the comment docs.

@philippjfr philippjfr merged commit 7f4b146 into master Aug 4, 2021
@philippjfr philippjfr deleted the fix-header-accent-base-color branch August 4, 2021 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change fast theme button color back to white
2 participants