Skip to content

Commit 6f01ad2

Browse files
authored
docs: added content about an alternative way to establish style. (#1356)
Added content about an alternative way to establish style.
1 parent 3cbe75d commit 6f01ad2

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/THEMING.md

+29
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,35 @@ for some ideas.
3333

3434
- You can now make changes that will show up when you generate your docs using your theme. Example `package.json` `scripts` entry: `"documentation build index.js -f html -o docs --theme node_modules/docjs-theme"`
3535

36+
#### Changes to Default Theme Via documentation.yml
37+
If a documentation.yml file is used to establish a table of contents for your documentation, small changes to the default style can be made via a <style> element in the documentation.yml file.
38+
39+
For example, if you have you have a section header and text to describe the section, you can put it at the same level of the text as shown below:
40+
41+
```
42+
- name: Section Header Name
43+
description: |
44+
<head>
45+
<style>
46+
h2{
47+
color:black;
48+
}
49+
code.black{
50+
background-color: #295377;
51+
overflow: hidden;
52+
padding: 0.5rem;
53+
color: white;
54+
font: 0.8rem Inconsolata, monospace;
55+
width:100%;
56+
}
57+
</style>
58+
</head>
59+
60+
### Sub Section header
61+
Text that describes the section and sub-section here.
62+
```
63+
Any changes to elements and classes that also exist in the standard theme will be overwridden by what is in the documentation.yml. This opens up the possiblitity of the same CSS being defined twice, which can be confusing and is not best practice. However, it is easy to change HTML style this way. Recommend only using classes defined this way that do not exist in the standard documentation.js theme.
64+
3665
### Theming Markdown
3766

3867
The default Markdown generator for documentation.js isn't customizable - instead

0 commit comments

Comments
 (0)