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

Add vanilla template #1421

Merged
merged 24 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f007f95
adding a vanilla html template to panel
kebowen730 Jun 9, 2020
be65b47
updating css
kebowen730 Jun 10, 2020
951b4b5
fixing noqa declaration
kebowen730 Jun 10, 2020
cc63e5e
updating the vanilla template to have more complete styling, as well …
kebowen730 Jun 18, 2020
ceb1d3c
removing commented elements
kebowen730 Jun 18, 2020
366a403
fixing the edges on the display cards and consolidating the sidebar c…
kebowen730 Jun 23, 2020
b259415
Merge branch 'master' of github.com:holoviz/panel into add-vanilla-te…
kebowen730 Jun 24, 2020
50ce432
updating css
kebowen730 Jun 24, 2020
92317e0
fixing the edges of the cards so the canvas doesnt run over the border
kebowen730 Jun 24, 2020
f83e55d
removing unneeded imports
kebowen730 Jun 24, 2020
ed6e1f7
adding a vanilla html template to panel
kebowen730 Jun 9, 2020
c66b3da
updating css
kebowen730 Jun 10, 2020
51d4d03
fixing noqa declaration
kebowen730 Jun 10, 2020
5b0ec5f
updating the vanilla template to have more complete styling, as well …
kebowen730 Jun 18, 2020
ebde675
removing commented elements
kebowen730 Jun 18, 2020
d5a46f1
fixing the edges on the display cards and consolidating the sidebar c…
kebowen730 Jun 23, 2020
3b80a5c
updating css
kebowen730 Jun 24, 2020
d3128dd
fixing the edges of the cards so the canvas doesnt run over the border
kebowen730 Jun 24, 2020
3701dd1
removing unneeded imports
kebowen730 Jun 24, 2020
e59e4ee
Minor fixes
philippjfr Jul 3, 2020
548d593
merging in upstream changes
kebowen730 Jul 3, 2020
63af927
Merge remote-tracking branch 'origin/master' into add-vanilla-template
kebowen730 Jul 9, 2020
94dc78d
updating the css to fix the title centering and sidebar margin
kebowen730 Jul 9, 2020
2c59746
Update panel/template/__init__.py
philippjfr Jul 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion panel/template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
from .bootstrap import BootstrapTemplate # noqa
from .material import MaterialTemplate # noqa
from .theme import DarkTheme, DefaultTheme # noqa
from .golden import GoldenTemplate # noqa
from .golden import GoldenTemplate # noqa
from .vanilla import VanillaTemplate # noqa
45 changes: 45 additions & 0 deletions panel/template/vanilla/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
Vanilla template
"""
import pathlib

import param

from ...layout import Card
from ..base import BasicTemplate
from ..theme import DarkTheme, DefaultTheme



class VanillaTemplate(BasicTemplate):
"""
VanillaTemplate is built on top of Vanilla web components.
"""

_css = pathlib.Path(__file__).parent / 'vanilla.css'

_template = pathlib.Path(__file__).parent / 'vanilla.html'

_modifiers = {
Card: {
'children': {'margin': (0, 10)}
}
}

def _apply_root(self, name, model, tags):
if 'main' in tags:
model.margin = (10, 15, 10, 10)


class VanillaDefaultTheme(DefaultTheme):

css = param.Filename(default=pathlib.Path(__file__).parent / 'default.css')

_template = VanillaTemplate


class VanillaDarkTheme(DarkTheme):

css = param.Filename(default=pathlib.Path(__file__).parent / 'dark.css')

_template = VanillaTemplate
29 changes: 29 additions & 0 deletions panel/template/vanilla/dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
body {
color: white;
background-color: #121212;
}

#header {
background-color: #2f2f2f;
}

#main {
color: white;
background-color: #121212;
}

#sidebar {
color: white;
border-color: #2f2f2f !important;
background-color: #121212;
}

.bk.card {
color: white;
background-color: #2f2f2f;
}

.bk.card-header {
color: white;
background-color: #292929 !important;
}
12 changes: 12 additions & 0 deletions panel/template/vanilla/default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#header {
background-color: #00aa41;
}

#sidebar {
background-color: white;
box-shadow: 0px 0px 1px;
}

#sidebar-button {
color: white;
}
116 changes: 116 additions & 0 deletions panel/template/vanilla/vanilla.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
body {
height: 100vh;
margin: 0px;
}

#container {
padding:0px;
width: 100vw;
}

#header{
padding: 10px;
}

.title{
color: #fff;
padding-left: 10px;
text-decoration: none;
text-decoration-line: none;
text-decoration-style: initial;
text-decoration-color: initial;
font-weight: 400;
font-size: 28px;
}

.bk-canvas {
padding-right: 2px !important;
}

#content {
height: 100vh;
margin: 0px;
width: 100vw;
display: inline-flex;
}

#sidebar {
transition: all 0.2s cubic-bezier(0.945, 0.020, 0.270, 0.665);
transform-origin: center left; /* Set the transformed position of sidebar to center left side. */
width: 15vw;
margin-top: 60px;
}

#sidebar.active {
margin-left: -16.7%;
}

#main {
overflow-y: scroll;
width: 100vw;
margin-left: 15vw;
}

#sidebarCollapse {
background: none;
border: none;
}

a.navbar-brand {
padding-left: 10px;
}

p.bk.card-button {
display: none;
}

body {
font-family: "Lato", sans-serif;
}

.sidenav {
height: 100%;
width: 0;
position: absolute;
z-index: 1;
top: 0;
left: 0;
background-color: #eeeeee;
overflow-x: hidden;
transition: 0.5s;
padding-top: 15px;
}

.bk.card-title {
position: absolute !important;
}

.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s;
}

.sidenav a:hover {
color: #f1f1f1;
}

.sidenav .closebtn {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}

@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}

.nav.flex-column {
padding-inline-start: 0px;
}
62 changes: 62 additions & 0 deletions panel/template/vanilla/vanilla.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{% extends base %}

<!-- goes in body -->
{% block contents %}
<div class="" id="container">
<nav class="" style="{% if header_background %}background-color: {{ header_background }} !important;{% endif %}{% if header_color %}color: {{ header_color }}{% endif %}" id="header">
{% if nav %}
<span style="font-size:30px;cursor:pointer" onclick="closeNav()" id="sidebar-button">&#9776;</span>
{% endif %}
<a class="title" href="#">{{ app_title }}</a>
{% for doc in docs %}
{% for root in doc.roots %}
{% if "header" in root.tags %}
{{ embed(root) | indent(8) }}
{% endif %}
{% endfor %}
{% endfor %}
</nav>

<div class="row" id="content">
{% if nav %}
<div class="sidenav" id="sidebar">
<ul class="nav flex-column">
{% for doc in docs %}
{% for root in doc.roots %}
{% if "nav" in root.tags %}
{{ embed(root) | indent(8) }}
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</div>
{% endif %}

<div class="" id="main">
{% for doc in docs %}
{% for root in doc.roots %}
{% if "main" in root.tags %}
{{ embed(root) | indent(4) }}
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
</div>

<script>
function openNav() {
document.getElementById("sidebar").style.width = "15vw";
document.getElementById("main").style.marginLeft = "15vw";
document.getElementById("sidebar-button").onclick=closeNav;
window.dispatchEvent(new Event("resize"))
}

function closeNav() {
document.getElementById("sidebar").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
document.getElementById("sidebar-button").onclick=openNav;
window.dispatchEvent(new Event("resize"))
}
</script>
{% endblock %}