Debian Codegraph @

docs/css_variables.md

raw
1 # CSS Variables
2
3 All colors used by sphinx-design are defined as [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties).
4 Therefore they can be overriden by adding a `.css` file in a `_static` folder in your projects source folder (see [the sphinx documentation](https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_css_files)):
5
6 ```python
7 html_static_path = ['_static']
8 html_css_files = ['custom.css']
9 ```
10
11 For colors, there are nine semantic colors that can be defined.
12 For each of these colors you should define:
13
14 - `--sd-color-{name}` as the actual color
15 - `--sd-color-{name}-highlight` as the color used when the component is highlighted
16 (e.g. if hovering over a button). By default, this is a 15% darker version of the original color.
17 - `--sd-color-{name}-text` as the color to use for text displayed on top of the color.
18 By default, this is dark grey for light colors and white for dark colors.
19
20 The defaults are:
21
22 ```css
23 :root {
24 --sd-color-primary: #007bff;
25 --sd-color-secondary: #6c757d;
26 --sd-color-success: #28a745;
27 --sd-color-info: #17a2b8;
28 --sd-color-warning: #f0b37e;
29 --sd-color-danger: #dc3545;
30 --sd-color-light: #f8f9fa;
31 --sd-color-muted: #6c757d;
32 --sd-color-dark: #212529;
33 --sd-color-primary-highlight: #0069d9;
34 --sd-color-secondary-highlight: #5c636a;
35 --sd-color-success-highlight: #228e3b;
36 --sd-color-info-highlight: #148a9c;
37 --sd-color-warning-highlight: #cc986b;
38 --sd-color-danger-highlight: #bb2d3b;
39 --sd-color-light-highlight: #d3d4d5;
40 --sd-color-muted-highlight: #5c636a;
41 --sd-color-dark-highlight: #1c1f23;
42 --sd-color-primary-text: #fff;
43 --sd-color-secondary-text: #fff;
44 --sd-color-success-text: #fff;
45 --sd-color-info-text: #fff;
46 --sd-color-warning-text: #212529;
47 --sd-color-danger-text: #fff;
48 --sd-color-light-text: #212529;
49 --sd-color-muted-text: #fff;
50 --sd-color-dark-text: #fff;
51 --sd-color-shadow: rgba(0, 0, 0, 0.15);
52 --sd-color-card-border: rgba(0, 0, 0, 0.125);
53 --sd-color-card-border-hover: hsla(231, 99%, 66%, 1);
54 --sd-color-card-background: transparent;
55 --sd-color-card-text: inherit;
56 --sd-color-card-header: transparent;
57 --sd-color-card-footer: transparent;
58 --sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);
59 --sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);
60 --sd-color-tabs-label-inactive: hsl(0, 0%, 66%);
61 --sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);
62 --sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);
63 --sd-color-tabs-underline-inactive: transparent;
64 --sd-color-tabs-overline: rgb(222, 222, 222);
65 --sd-color-tabs-underline: rgb(222, 222, 222);
66 --sd-fontsize-tabs-label: 1rem;
67 --sd-fontsize-dropdown-title: 1rem;
68 --sd-fontweight-dropdown-title: 700;
69 }
70 ```