Source code for panel.template.bootstrap

"""
Bootstrap template based on the bootstrap.css library.
"""
import pathlib

import param

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


[docs]class BootstrapTemplate(BasicTemplate): """ BootstrapTemplate """ _css = pathlib.Path(__file__).parent / 'bootstrap.css' _template = pathlib.Path(__file__).parent / 'bootstrap.html' _modifiers = { Card: { 'children': {'margin': (10, 10)}, 'button_css_classes': ['card-button'], 'margin': (10, 5) }, } _resources = { 'css': { 'bootstrap': "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" }, 'js': { 'jquery': "https://code.jquery.com/jquery-3.4.1.slim.min.js", 'bootstrap': "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js", } }
[docs]class BootstrapDefaultTheme(DefaultTheme): _template = BootstrapTemplate
[docs]class BootstrapDarkTheme(DarkTheme): css = param.Filename(default=pathlib.Path(__file__).parent / 'dark.css') _template = BootstrapTemplate