1
"""
2
Bootstrap template based on the bootstrap.css library.
3
"""
4 7
import pathlib
5

6 7
import param
7

8 7
from ...layout import Card
9 7
from ..base import BasicTemplate
10 7
from ..theme import DarkTheme, DefaultTheme
11

12

13 7
class BootstrapTemplate(BasicTemplate):
14
    """
15
    BootstrapTemplate
16
    """
17

18 7
    _css = pathlib.Path(__file__).parent / 'bootstrap.css'
19

20 7
    _template = pathlib.Path(__file__).parent / 'bootstrap.html'
21

22 7
    _modifiers = {
23
        Card: {
24
            'children': {'margin': (10, 10)},
25
            'button_css_classes': ['card-button'],
26
            'margin': (10, 5)
27
        },
28
    }
29

30 7
    _resources = {
31
        'css': {
32
            'bootstrap': "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
33
        },
34
        'js': {
35
            'bootstrap': "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js",
36
            'jquery': "https://code.jquery.com/jquery-3.4.1.slim.min.js"
37
        }
38
    }
39

40

41 7
class BootstrapDefaultTheme(DefaultTheme):
42

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

45 7
    _template = BootstrapTemplate
46

47

48 7
class BootstrapDarkTheme(DarkTheme):
49

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

52 7
    _template = BootstrapTemplate

Read our documentation on viewing source code .

Loading