Debian Codegraph @

docs/colors.rst

raw
1 .. COPY FROM PYDATA THEME DOCS (https://github.com/pydata/pydata-sphinx-theme under BSD-3-Clause)
2
3 Colors
4 ******
5
6
7 Admonitions
8 -----------
9
10 .. admonition:: Generic Admonition
11
12 Generic admonition needs content apparently
13
14 .. attention:: attention
15 .. caution:: caution
16 .. danger:: danger
17 .. error:: error
18 .. hint:: hint
19 .. important:: important
20 .. note:: note
21 .. tip:: tip
22 .. warning:: warning
23
24 Snippets
25 --------
26
27 Documentation :any:`index <genindex>` and :any:`Module <modindex>` index.
28
29 Some code:
30
31 .. code-block:: python
32
33 """
34 Parameters
35 ----------
36 x : `type`
37 Description of parameter x.
38 """
39 import numpy as np
40
41 def func(x):
42 return np.mean(x)
43
44 # This is a comment
45 return func
46
47 It's good to have your upstream remote have a scary name [#]_, to remind you that it's a read-write remote:
48
49 .. code-block:: bash
50
51 $ git remote add upstream-rw [email protected]:sunpy/sunpy.git
52 $ git fetch upstream-rw
53
54 .. [#] Text of the first footnote.
55
56 ``:func:``
57 :func:`numpy.mean`
58
59 ``:meth:``
60 :meth:`numpy.mean`
61
62 ``:class:``
63 :class:`numpy.mean`
64
65 Normal
66 `numpy.mean`
67
68 ``:func:``
69 :func:`numpy.ndarray.mean`
70
71 ``:meth:``
72 :meth:`numpy.ndarray.mean`
73
74 ``:class:``
75 :class:`numpy.ndarray.mean`
76
77 Normal
78 `numpy.ndarray.mean`
79
80 Sometimes you need a URL: `bbc.com <https://www.bbc.com>`__
81
82 Contributing to ``sunraster``
83
84 New Astropy Theme Colors
85 ------------------------
86
87 .. note::
88
89 This section is not applicable to the old bootstrap-astropy theme.
90
91 This theme specifies color variables for the primary and secondary colors (``--pst-color-primary`` and ``--pst-color-secondary``, respectively).
92 These are meant to complement one another visually across the theme, if you modify these, choose colors that look good when paired with one another.
93 There are also several other color variables that control the color for admonitions, links, menu items, etc.
94
95 Each color variable has two values, one corresponding to the "light" and one for the "dark" theme.
96 These are used throughout many of the theme elements to define text color, background color, etc.
97
98 Here is an overview of the colors available in the theme (change theme mode to switch from light to dark versions).
99
100 .. raw:: html
101
102 <style>
103 span.pst-primary {background-color: var(--pst-color-primary);}
104 span.pst-secondary {background-color: var(--pst-color-secondary);}
105 span.pst-accent {background-color: var(--pst-color-accent);}
106 span.pst-success {background-color: var(--pst-color-success);}
107 span.pst-info {background-color: var(--pst-color-info);}
108 span.pst-warning {background-color: var(--pst-color-warning);}
109 span.pst-danger {background-color: var(--pst-color-danger);}
110 span.pst-background {background-color: var(--pst-color-background);}
111 span.pst-on-background {background-color: var(--pst-color-on-background);}
112 span.pst-surface {background-color: var(--pst-color-surface);}
113 span.pst-on-surface {background-color: var(--pst-color-on-surface);}
114 span.pst-target {background-color: var(--pst-color-target);}
115 </style>
116
117 <p>
118 <span class="sd-sphinx-override sd-badge pst-badge pst-primary sd-bg-text-primary">primary</span>
119 <span class="sd-sphinx-override sd-badge pst-badge pst-secondary sd-bg-text-secondary">secondary</span>
120 <span class="sd-sphinx-override sd-badge pst-badge pst-accent sd-bg-text-secondary">accent</span>
121 <span class="sd-sphinx-override sd-badge pst-badge pst-success sd-bg-text-success">success</span>
122 <span class="sd-sphinx-override sd-badge pst-badge pst-info sd-bg-text-info">info</span>
123 <span class="sd-sphinx-override sd-badge pst-badge pst-warning sd-bg-text-warning">warning</span>
124 <span class="sd-sphinx-override sd-badge pst-badge pst-danger sd-bg-text-danger">danger</span>
125 <span class="sd-sphinx-override sd-badge pst-badge pst-background">background</span>
126 <span class="sd-sphinx-override sd-badge pst-badge pst-on-background">on-background</span>
127 <span class="sd-sphinx-override sd-badge pst-badge pst-surface">surface</span>
128 <span class="sd-sphinx-override sd-badge pst-badge pst-on-surface sd-bg-text-primary">on-surface</span>
129 <span class="sd-sphinx-override sd-badge pst-badge pst-target">target</span>
130 </p>
131
132 This theme uses shadows to convey depth in the light theme mode and opacity in the dark one.
133 It defines 4 color variables that help build overlays in your documentation.
134
135 - :code:`background`: color of the back-most surface of the documentation
136 - :code:`on-background` elements that are set on top of this background (e.g. the header navbar on dark mode).
137 - :code:`surface` elements set on the background with a light-grey color in the light theme mode. This color has been kept in the dark theme (e.g. code-block directives).
138 - :code:`on-surface` elements that are on top of :code:`surface` elements (e.g. sidebar directives).
139
140 The following image should help you understand these overlays:
141
142 .. raw:: html
143
144 <style>
145 /* use https://unminify.com to check the indented version of the overlay component */
146 .overlay-container {margin-top: 10%; left: 20%; --width: 80%; --height: 200px; width: var(--width); height: var(--height); position: relative;}
147 .overlay-container .pst-overlay {position: absolute; border: 2px solid var(--pst-color-border);}
148 .overlay-container .pst-background {background-color: var(--pst-color-background); width: var(--width); transform: skew(-45deg); height: var(--height);}
149 .overlay-container .pst-on-background {background-color: var(--pst-color-on-background); height: var(--height); width: calc(var(--width) / 3); transform: skew(-45deg) translate(-2rem, -2rem);}
150 .overlay-container .pst-surface {background-color: var(--pst-color-surface); height: var(--height); width: calc(var(--width) / 3); transform: skew(-45deg) translate(-2rem, -2rem); left: calc(var(--width) / 3 * 2);}
151 .overlay-container .pst-on-surface {background-color: var(--pst-color-on-surface); width: calc(var(--width) / 3); height: calc(var(--height) * 0.66); transform: skew(-45deg) translate(-2rem, -4rem); left: calc(var(--width) / 3 * 2);}
152 .overlay-container .label {position: absolute; bottom: 0.5rem; left: 50%; transform: skew(45deg) translateX(-50%); white-space: nowrap;}
153 </style>
154
155 <div class="overlay-container">
156 <div class="pst-overlay pst-background">
157 <p class="label">background</p>
158 </div>
159 <div class="pst-overlay pst-on-background">
160 <p class="label">on-background</p>
161 </div>
162 <div class="pst-overlay pst-surface">
163 <p class="label">surface</p>
164 </div>
165 <div class="pst-overlay pst-on-surface">
166 <p class="label sd-bg-text-primary">on-surface</p>
167 </div>
168 </div>