Skip to content

Commit 14550d5

Browse files
committed
📚 DOCS: Add CSS variables guide
1 parent ddd83ea commit 14550d5

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ paragraph and tab-set in grid-item
9090

9191
rtd PRs not working
9292

93+
size octicons to 1rem etc
94+
9395
[github-ci]: https://github.com/executablebooks/sphinx-design/workflows/continuous-integration/badge.svg?branch=main
9496
[github-link]: https://github.com/executablebooks/sphinx-design
9597
[codecov-badge]: https://codecov.io/gh/executablebooks/sphinx-design/branch/main/graph/badge.svg

docs/css.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
The defaults are:
12+
13+
```css
14+
:root {
15+
--sd-color-primary: #007bff;
16+
--sd-color-secondary: #6c757d;
17+
--sd-color-success: #28a745;
18+
--sd-color-info: #17a2b8;
19+
--sd-color-warning: #f0b37e;
20+
--sd-color-danger: #dc3545;
21+
--sd-color-light: #f8f9fa;
22+
--sd-color-muted: #6c757d;
23+
--sd-color-dark: #212529;
24+
--sd-color-primary-highlight: #0069d9;
25+
--sd-color-secondary-highlight: #5c636a;
26+
--sd-color-success-highlight: #228e3b;
27+
--sd-color-info-highlight: #148a9c;
28+
--sd-color-warning-highlight: #cc986b;
29+
--sd-color-danger-highlight: #bb2d3b;
30+
--sd-color-light-highlight: #d3d4d5;
31+
--sd-color-muted-highlight: #5c636a;
32+
--sd-color-dark-highlight: #1c1f23;
33+
--sd-color-primary-text: #fff;
34+
--sd-color-secondary-text: #fff;
35+
--sd-color-success-text: #fff;
36+
--sd-color-info-text: #fff;
37+
--sd-color-warning-text: #212529;
38+
--sd-color-danger-text: #fff;
39+
--sd-color-light-text: #212529;
40+
--sd-color-muted-text: #fff;
41+
--sd-color-dark-text: #fff;
42+
--sd-color-shadow: rgba(0, 0, 0, 0.15);
43+
--sd-color-card-border: rgba(0, 0, 0, 0.125);
44+
--sd-color-card-border-hover: hsla(231, 99%, 66%, 1);
45+
--sd-color-card-background: transparent;
46+
--sd-color-card-text: inherit;
47+
--sd-color-card-header: transparent;
48+
--sd-color-card-footer: transparent;
49+
--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);
50+
--sd-color-tabs-label-inactive: rgba(178, 206, 245, 0.62);
51+
--sd-color-tabs-overline: rgb(207, 236, 238);
52+
--sd-color-tabs-underline: rgb(207, 236, 238);
53+
--sd-fontsize-tabs-label: 1rem
54+
}
55+
```

docs/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ badges_buttons
3434
additional
3535
```
3636

37+
```{toctree}
38+
:caption: Styling
39+
:hidden:
40+
41+
css
42+
```
43+
3744
```{toctree}
3845
:caption: Themes
3946
:hidden:
@@ -84,6 +91,13 @@ Synchronisable, tabbed content sets.
8491
Roles and directives for {bdg-primary}`badges` and other components.
8592
:::
8693

94+
:::{grid-item-card} {octicon-16}`image` CSS Styling
95+
:link: css
96+
:link-type: doc
97+
98+
Change the default colors and other CSS.
99+
:::
100+
87101
::::
88102

89103
Created with inspiration from [Bootstrap](https://getbootstrap.com/) (v5), [Material Design](https://material.io) and [Material-UI](https://material-ui.com/) design frameworks.

0 commit comments

Comments
 (0)