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

Material Template Fixes #1662

Merged
merged 7 commits into from
Oct 21, 2020

Conversation

MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented Oct 20, 2020

I have tested the Material Template and see some issues that I would like to fix

  • The header items overflow the header on the right
  • The header has no box shadow (as the Vanilla template has)
  • There are a lot of scrollbars.
  • A little bit more padding/ margin is need.
  • Cannot set the main max-width.
  • Add a little bit of gray to the sidebar.

image

I will develop the fixes ASAP. Will change the Material Template to behave as the Vanilla Template.

@philippjfr
Copy link
Member

See #1661

@philippjfr
Copy link
Member

Sorry misread, thought this was Golden layout as well.

@philippjfr
Copy link
Member

philippjfr commented Oct 20, 2020

There are a lot of scrollbars.

So I don't know what's up with that, I do not see scrollbars, only when I actually try to scroll. Same with the other templates.

@philippjfr
Copy link
Member

philippjfr commented Oct 20, 2020

That's probably specific to my particular browser tbh, so I'll probably have to fix this everywhere for all templates.

@philippjfr
Copy link
Member

Actually I can't any browser to show all the scrollbars all the time, is this a windows thing?

@nghenzi
Copy link
Contributor

nghenzi commented Oct 20, 2020

I see the scrollbars in windows too with chrome

@philippjfr
Copy link
Member

Okay, clearly needs fixing but really I blame windows 😜

@MarcSkovMadsen
Copy link
Collaborator Author

The only thing I know is that overflow: auto is handle differently by Chrome and Firefox. As far as I remember Chrome shows disabled scrollbars while Firefox only shows the scrollbars when needed. Therefore I always set them to scroll instead of auto because then they behave the same and I don't need to handle margin/ padding/ width differences between browsers.

@MarcSkovMadsen
Copy link
Collaborator Author

image

@MarcSkovMadsen
Copy link
Collaborator Author

FYI. I will start working on this.

@MarcSkovMadsen
Copy link
Collaborator Author

I've now implemented the fixes needed and aligned with the VanillaTemplate.

I have some ideas on providing a MaterialTheme for Bokeh. I will try to add that as well.

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Oct 21, 2020

I've now added a Bokeh MaterialTheme and MaterialDarkTheme but then

  • the default.css is no longer imported (and it gets the purple header as shown below)
  • and I don't think the bokeh theme is actually changed. The font in the plots does not look bigger and Roboto like

image

I will stop now. @philippjfr can you help or guide me to a solution on the two issues above? Thanks.

@@ -59,3 +59,113 @@ class DarkTheme(Theme):

bokeh_theme = param.ClassSelector(class_=(_BkTheme, str),
default=_BkTheme(json=BOKEH_DARK))

MATERIAL_FONT = "Roboto, sans-serif, Verdana"
MATERIAL_THEME = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should live in panel/template/material/init.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's awesome. I just did not know that one. Will move it.

@philippjfr
Copy link
Member

Again, in the interest of making quick progress here I'll merge and make a new PR. You have access rights for this repo so please push directly to holoviz/panel rather than your own fork so we can collaborate more easily.

@MarcSkovMadsen
Copy link
Collaborator Author

MarcSkovMadsen commented Oct 21, 2020

@philippjfr . Did you have any ideas on fixing the below


I've now added a Bokeh MaterialTheme and MaterialDarkTheme but then

  • the default.css is no longer imported (and it gets the purple header as shown below)
  • and I don't think the bokeh theme is actually changed. The font in the plots does not look bigger and Roboto like

@MarcSkovMadsen
Copy link
Collaborator Author

Hi @ceball

I've have heard you have an interest in applications using Material Theme. If you have any ideas, guidance, requirements feel free to comment. Thanks.

@philippjfr
Copy link
Member

the default.css is no longer imported (and it gets the purple header as shown below)

That is deliberate, the default.css corresponds to the default theme. I'm still trying to understand why you created the MaterialTheme instead of extending the DefaultTheme but maybe it's just not well documented and that was your intention?

@philippjfr philippjfr merged commit 7e39884 into holoviz:master Oct 21, 2020
@MarcSkovMadsen
Copy link
Collaborator Author

The intention is to make the Bokeh/ HoloViews plot look consistent with the bootstrap theme. This includes the "Roboto" font, some font size changes, some color changes etc.

Maybe I implemented it wrongly. I believe the Bokeh JSON THEME is correct. But maybe I need some guidance on how to move on from there @philippjfr ?

@MarcSkovMadsen
Copy link
Collaborator Author

@philippjfr . One temporary solution for getting material themed widgets could be using a small script to replace the bokeh classes with the material classes. Maybe it's as simple as defining the conversions in a dictionary.

What do you think?

The thing I don't know is if I can get the script to execute every time the css class changes. But maybe I can using a MUTATIONOBSERVER.

If it works it could be a really easy and powerful thing.

POC

image

image

@MarcSkovMadsen
Copy link
Collaborator Author

One problem right now is I don't know how to find documentation for MASTER. I can only find documentation for 0.9.7.

Maybe a link to the MASTER documentation in the GITHUB README or the DEVELOPER GUIDE would be nice to have.

@philippjfr
Copy link
Member

Here's where those builds go: https://pyviz-dev.github.io/panel/

@philippjfr philippjfr mentioned this pull request Oct 21, 2020
@xavArtley
Copy link
Collaborator

@philippjfr
when is updated this site?
For what I see the version is Panel 0.10.0a24.post1+g2b9c98f documentation

@philippjfr
Copy link
Member

The builds have been broken for a while, trying to fix that. It's usually rebuilt on each dev release or when a commit ending in [doc-build] is merged.

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.

4 participants