Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v5 style overhaul #2469

Merged
merged 211 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
599d706
Replace stylus var with custom properties
jhildenbiddle May 31, 2024
e61ea9d
Add CSS theme source and postcss scripts
jhildenbiddle May 31, 2024
88a461a
Convert CSS to nested syntax
jhildenbiddle Jun 1, 2024
6e05987
Add custom props. Update styles. Refactor themes.
jhildenbiddle Jun 4, 2024
3db118f
Fix incorrect tip/warn class names
jhildenbiddle Jun 13, 2024
71b9de8
Add UI Kit page
jhildenbiddle Jun 13, 2024
e12da08
Fix typos
jhildenbiddle Jun 13, 2024
f5eac1f
Add loading spinner. Other minor updates.
jhildenbiddle Jun 13, 2024
27c0499
Fix screen flicker on theme change + minor updates
jhildenbiddle Jun 13, 2024
85f2e0b
Fix lint issues
jhildenbiddle Jun 13, 2024
af2c39c
Style updates. Other minor updates.
jhildenbiddle Jun 14, 2024
079443a
Fix app nav always visible on mobile
jhildenbiddle Jun 14, 2024
901f678
Update nav bar styles (full width, configurable)
jhildenbiddle Jun 14, 2024
a5212e2
Move edit link to footer
jhildenbiddle Jun 14, 2024
273d913
Add configurable max-width. Style updates.
jhildenbiddle Jun 14, 2024
14c2a1e
Fix sidebar link border color on active
jhildenbiddle Jun 14, 2024
709e4ac
Fix incorrect heading level
jhildenbiddle Jun 15, 2024
5201fe5
Fix navbar scroll behavior on mobile
jhildenbiddle Jun 15, 2024
15c4659
Mark private css vars with underscore
jhildenbiddle Jun 15, 2024
8c95c03
Update merged navbar style to match sidebar links
jhildenbiddle Jun 15, 2024
c60fe7c
Refactor bold sidebar navigation headings
jhildenbiddle Jun 17, 2024
ea5c3b7
Update coverpage with custom props
jhildenbiddle Jun 17, 2024
90343c3
Fix iOS text text adjustment
jhildenbiddle Jun 17, 2024
333763c
Fix safe area inset margins on mobile
jhildenbiddle Jun 17, 2024
2624d13
Update coverpage with custom props (missed files)
jhildenbiddle Jun 17, 2024
35302e9
Create CSS partials. Add core theme.
jhildenbiddle Jun 17, 2024
7ff100a
Update Google Font imports
jhildenbiddle Jun 17, 2024
b68185b
Remove unnecessary ignore file
jhildenbiddle Jun 17, 2024
d3f713a
Update skip-to-content button with shared style
jhildenbiddle Jun 17, 2024
73ce1eb
Fix method and docs type (docisfy => docsify)
jhildenbiddle Jun 18, 2024
09218cf
Update cover page and themes docs
jhildenbiddle Jun 19, 2024
857fa5f
Add details and summary styies. Move callouts.
jhildenbiddle Jun 19, 2024
3274928
Add Prism theme support
jhildenbiddle Jun 19, 2024
afe056f
Fix callout charm line height
jhildenbiddle Jun 19, 2024
c7ea4fd
Swap color-primary prop for theme-color
jhildenbiddle Jun 19, 2024
8ab26fb
Update themeColor documentation
jhildenbiddle Jun 19, 2024
5568224
Update topMargin documentation (deprecated)
jhildenbiddle Jun 19, 2024
8aad5c5
Minor UI Kit updates
jhildenbiddle Jun 19, 2024
abe4f55
Update color properties and docs
jhildenbiddle Jun 19, 2024
a2275c4
Refactor vars
jhildenbiddle Jun 19, 2024
0976608
Add light/dark mode support
jhildenbiddle Jun 20, 2024
dc1b7c5
Rename color-mono- and theme-coloar variants
jhildenbiddle Jun 20, 2024
31c83e0
Separate themes into core and add-ons
jhildenbiddle Jun 20, 2024
e68205f
Fix theme preview function
jhildenbiddle Jun 20, 2024
4f4179f
Isolate element style from markdown styles
jhildenbiddle Jun 20, 2024
f6294dc
Update cover backgrounds
jhildenbiddle Jun 20, 2024
68892b9
Add covepage oklch gradient
jhildenbiddle Jun 21, 2024
46a63ef
Add duration props and reduced motion mq
jhildenbiddle Jun 21, 2024
8876d29
Update button styles
jhildenbiddle Jun 21, 2024
fbc7fb3
Update headng styles
jhildenbiddle Jun 21, 2024
f47da30
Update search plugin and kbd styles
jhildenbiddle Jun 21, 2024
281344d
Fix select element style in Safari
jhildenbiddle Jun 21, 2024
fc94626
Update search plugin button
jhildenbiddle Jun 21, 2024
a386de8
Update sidebar block margins
jhildenbiddle Jun 21, 2024
59edb17
Update results display & hideOtherSidebarContent
jhildenbiddle Jun 21, 2024
c56bd6c
Fix carbonads margin
jhildenbiddle Jun 21, 2024
794d90b
Add styles for mark element
jhildenbiddle Jun 21, 2024
454d5d9
Update quickstart to accommodate style updates
jhildenbiddle Jun 22, 2024
a5ced86
Fix cover gradient on navigate back to cover
jhildenbiddle Jun 22, 2024
10f1d98
Fix missing merged navbar on resize
jhildenbiddle Jun 22, 2024
dead48b
Fix marking of active navbar item
jhildenbiddle Jun 22, 2024
db976e1
Merge branch 'develop' into v5-style-overhaul
jhildenbiddle Jun 22, 2024
998e44e
Update e2e tests
jhildenbiddle Jun 22, 2024
12b4535
Add fix for Jest 29 and Prettier 3
jhildenbiddle Jun 22, 2024
d7097d0
Fix potential reference errors
jhildenbiddle Jun 22, 2024
21c457a
Update integration tests
jhildenbiddle Jun 22, 2024
dca2445
Add util.css with clamp classes
jhildenbiddle Jun 22, 2024
d4ea8de
Fix hidden clear search button text in Safari
jhildenbiddle Jun 22, 2024
6fef2ee
Remove accent color style
jhildenbiddle Jun 22, 2024
f404d7a
Update mono and theme color names
jhildenbiddle Jun 22, 2024
5f30d25
Move mono and theme palettes to basic vars
jhildenbiddle Jun 22, 2024
3671a2b
Fix bold font weight declarations
jhildenbiddle Jun 28, 2024
8dde425
Update base font weights
jhildenbiddle Jun 28, 2024
696df7b
Fix rendering of headers
jhildenbiddle Jul 1, 2024
75646bf
Add sidebar chevron support + nested collapsable
jhildenbiddle Jul 1, 2024
f0dcfc6
Update theme dirs and docs
jhildenbiddle Jul 4, 2024
c663533
Update theme-related documentation
jhildenbiddle Jul 5, 2024
85ce620
Add sidebar pagelink and group classes
jhildenbiddle Jul 5, 2024
93cf296
Add sidebar group theme properties
jhildenbiddle Jul 5, 2024
58fa58f
Add toggle elements. Update UI kit and theme docs.
jhildenbiddle Jul 6, 2024
643dd8a
Update tests
jhildenbiddle Jul 6, 2024
f65d158
Merge branch 'develop' into v5-style-overhaul
jhildenbiddle Jul 6, 2024
c71bb19
Toggle active theme previews on load
jhildenbiddle Jul 6, 2024
d7de7cd
Fix theme switching (part of last commit)
jhildenbiddle Jul 6, 2024
9d5aad8
Update disabled style
jhildenbiddle Jul 6, 2024
90885f2
Added core-dark.css and updated docs
jhildenbiddle Jul 6, 2024
81fe5c3
Fix label styles
jhildenbiddle Jul 6, 2024
0a12050
Move legacy addons
jhildenbiddle Jul 6, 2024
da3de66
Fix select font in Safari
jhildenbiddle Jul 6, 2024
7d7b430
Update heading and border styles
jhildenbiddle Jul 6, 2024
50932c8
Fix sidebar styles
jhildenbiddle Jul 6, 2024
ded64f8
Detect use of light/dark cover gradient
jhildenbiddle Jul 6, 2024
1ba9630
Update common margin-block
jhildenbiddle Jul 6, 2024
cafa268
Minor docs update
jhildenbiddle Jul 6, 2024
21404bb
Update sidebar item margins
jhildenbiddle Jul 6, 2024
8a5c749
Fix merged app nav margin
jhildenbiddle Jul 7, 2024
2126642
Fix cover subblock quote heading line height
jhildenbiddle Jul 7, 2024
c97ab6e
Remove heading font weight properties
jhildenbiddle Jul 7, 2024
3d11fb5
Remove heading font size properties
jhildenbiddle Jul 7, 2024
9db6529
Remove stylus dependency and scripts
jhildenbiddle Jul 7, 2024
36d921d
Updated mark element border radius
jhildenbiddle Jul 7, 2024
4f3f46e
Update samp styles
jhildenbiddle Jul 7, 2024
710c7ef
Fix H2 heading margin
jhildenbiddle Jul 7, 2024
fea5104
Fix markdown top margin
jhildenbiddle Jul 7, 2024
ca10a23
Fix mobile/desktop inverted sidebar “close” class
jhildenbiddle Jul 8, 2024
3798f53
Update legacy transform declarations
jhildenbiddle Jul 8, 2024
1cf5c34
Normalize transition timings
jhildenbiddle Jul 9, 2024
2be8fec
Moved reduced motion media query
jhildenbiddle Jul 9, 2024
49c8bc6
Fix mobile breakpoint behavior
jhildenbiddle Jul 9, 2024
d75dba8
Remove inBrowser var (SSR cruft)
jhildenbiddle Jul 9, 2024
3444e9a
Prevent render sidebar when hideSidebar is true
jhildenbiddle Jul 9, 2024
dc8f3eb
Fix sidebar chevron rendering
jhildenbiddle Jul 9, 2024
50a205e
Fix navbar sizing, wrapping, and margins
jhildenbiddle Jul 9, 2024
cfcac53
Add group-title class and theme properties
jhildenbiddle Jul 9, 2024
3c9ad99
Update chevron-right inset
jhildenbiddle Jul 9, 2024
376f1fe
Add sidebar-group add-ons
jhildenbiddle Jul 9, 2024
11dddac
Fix horizontal scroll on mobile
jhildenbiddle Jul 9, 2024
2fb4590
Rename blockquote-text prop to blockquote-color
jhildenbiddle Jul 9, 2024
d8c89fa
Fix improper marking of sidebar groups
jhildenbiddle Jul 9, 2024
75235b0
Fix line-height of small, sub, and sup elements
jhildenbiddle Jul 9, 2024
bffe26a
Fix handling of text elemetns in sidebar
jhildenbiddle Jul 9, 2024
334ff4d
Update output border style
jhildenbiddle Jul 9, 2024
522cf25
Add px comment next to font-size theme prop
jhildenbiddle Jul 10, 2024
0149e45
Move postcss config to config file
jhildenbiddle Jul 10, 2024
0d5b060
Add link theme properties
jhildenbiddle Jul 10, 2024
ef1c681
Fix sidebar first item indentation
jhildenbiddle Jul 10, 2024
76e409f
Fix search result hover style
jhildenbiddle Jul 10, 2024
a6455ff
Add insertAfter/Before search plugin options
jhildenbiddle Jul 10, 2024
86200f4
Fix cover title link style
jhildenbiddle Jul 10, 2024
6469b83
Add syntax highlighting theme properties
jhildenbiddle Jul 11, 2024
ef1ecb3
Update sidebar and search border styles
jhildenbiddle Jul 11, 2024
dacdf7d
Fix content scrolling bug (mobile + cover)
jhildenbiddle Jul 11, 2024
80987b8
Make first cover button primary
jhildenbiddle Jul 11, 2024
40b6b89
Update cover button styles in dark mode
jhildenbiddle Jul 11, 2024
a0dc789
Fix coverpage margins
jhildenbiddle Jul 11, 2024
fb863c5
Lock sidebar toggle size to markdown inset
jhildenbiddle Jul 11, 2024
a47fb20
Update strong and heading colors
jhildenbiddle Jul 11, 2024
51147a0
Add no-chevron class to sidebar-chevron addons
jhildenbiddle Jul 11, 2024
cba5a36
Fix sidebar scrollable before body.sticky
jhildenbiddle Jul 11, 2024
3a26f5a
Hide menu toggle w/ cover (consistent w/ desktop)
jhildenbiddle Jul 11, 2024
c4e19b0
Fix sidebar toggle tab index (show focus)
jhildenbiddle Jul 11, 2024
aa8a1f7
Disable broswersync ghost mode
jhildenbiddle Jul 13, 2024
c96e227
Replace 100% height declaration to 100vh
jhildenbiddle Jul 13, 2024
82338dd
Implement nww sidebar toggle
jhildenbiddle Jul 14, 2024
35dbd00
Clean up navbar styles (consistent w/ sidebar-nav)
jhildenbiddle Jul 14, 2024
5dcb821
Fix sidebar link active hover color
jhildenbiddle Jul 14, 2024
074314d
Restore focus on content on sidebar hide
jhildenbiddle Jul 14, 2024
70c937f
Fix sidebar visible when navigating to root
jhildenbiddle Jul 14, 2024
1583300
Fix focus on sidebar toggle
jhildenbiddle Jul 14, 2024
fb8c119
Update new sidebar toggle (always show toggle)
jhildenbiddle Jul 14, 2024
2bb1116
Fix markdown content overflow
jhildenbiddle Jul 14, 2024
0fceec3
Fix navbar when sidebar visible
jhildenbiddle Jul 14, 2024
acd7f74
Fix merged nav bar group margin
jhildenbiddle Jul 14, 2024
a02b3e8
Fix sidebar app name line height
jhildenbiddle Jul 14, 2024
3078281
Fix content overflow w/o breaking focus ring
jhildenbiddle Jul 14, 2024
ae2f4f3
Add Safari hack comment
jhildenbiddle Jul 14, 2024
e085f51
Fix focus trip (mobile only)
jhildenbiddle Jul 14, 2024
e91a861
Fix content focus ring clipping in Safari
jhildenbiddle Jul 14, 2024
0ab4be4
Allow sidebar links to wrap
jhildenbiddle Jul 15, 2024
1e542d0
Remove unnecessary padding and scroll margin
jhildenbiddle Jul 15, 2024
9c882d5
Prevent long sidebar link overflow
jhildenbiddle Jul 15, 2024
c66ab67
Add block margin to buttons
jhildenbiddle Jul 15, 2024
57a2d7f
Add theme classes
jhildenbiddle Jul 15, 2024
4e9399c
Add light and dark core variations
jhildenbiddle Jul 15, 2024
4be0637
Rename data-theme prop to data-sheet
jhildenbiddle Jul 15, 2024
5c1b3f9
Remove docsify-themeable endorsement
jhildenbiddle Jul 15, 2024
62b2b07
Fix sidebar nav left indentation
jhildenbiddle Jul 16, 2024
38f7b5f
Fix sidebar link and group margins
jhildenbiddle Jul 16, 2024
dfe256b
Fix markdown container and long heading overflow
jhildenbiddle Jul 16, 2024
89f4a19
Add loading class to docs and index
jhildenbiddle Jul 16, 2024
9040430
Restore site settings
jhildenbiddle Jul 16, 2024
afb793e
Remove link-line-height prop
jhildenbiddle Jul 16, 2024
4734d5d
Add info about creating section headers
jhildenbiddle Jul 16, 2024
940c25e
Add info about creating drop-down menus
jhildenbiddle Jul 16, 2024
7c60ac4
Add content-margin-inline theme prop
jhildenbiddle Jul 16, 2024
3d47ba3
Rename max-width to content-max-width
jhildenbiddle Jul 16, 2024
d356676
Set default scroll-padding-top value
jhildenbiddle Jul 16, 2024
094bf16
Disable prettier on _vars theme files
jhildenbiddle Jul 16, 2024
8c4a09a
Refactor callout styles
jhildenbiddle Jul 16, 2024
c479bea
Fix codeblock font size
jhildenbiddle Jul 16, 2024
89a6be6
Update themes docs
jhildenbiddle Jul 16, 2024
0f50c78
Update sidebar toggle contrast (dark mode)
jhildenbiddle Jul 16, 2024
ca5d043
Add color-mono-9 to docs. Adjust mono-6.
jhildenbiddle Jul 16, 2024
4e76fc2
Align callout props
jhildenbiddle Jul 16, 2024
1f80f05
Fix group borders (only child, single group)
jhildenbiddle Jul 16, 2024
a8c661d
Fix group borders (again)
jhildenbiddle Jul 16, 2024
cadeb98
Fix dark mode cover brightness w/ brigthness prop.
jhildenbiddle Jul 17, 2024
9b5d5eb
Adjust strong color in dark mode, weight in name.
jhildenbiddle Jul 17, 2024
9bdb630
Add sidebar-toggle-kebab class
jhildenbiddle Jul 17, 2024
fd75d61
Fix inconsistent button hover style
jhildenbiddle Jul 17, 2024
9268421
Default to kebab toggle style. Add hamb class.
jhildenbiddle Jul 17, 2024
cb26599
Rever to core dark as addon
jhildenbiddle Jul 17, 2024
5e8e8fd
Rever to core dark as addon (fix)
jhildenbiddle Jul 17, 2024
128c677
Fix sidebar toggle aria-hidden attr
jhildenbiddle Jul 18, 2024
a752057
Fix sidebar-chevron-left indentation
jhildenbiddle Jul 18, 2024
34a241c
Adjust sidebar-link-spacing
jhildenbiddle Jul 18, 2024
66f126a
Add --navbar-drop-link-spacing
jhildenbiddle Jul 18, 2024
312d0a4
Fix search kbd vertical alignment
jhildenbiddle Jul 18, 2024
c9ffaf8
Fix skip-to-content behavior
jhildenbiddle Jul 18, 2024
3b8fcfb
Merge branch 'develop' into v5-style-overhaul
jhildenbiddle Jul 18, 2024
548fadd
Increase content margin. Reduce toggle width.
jhildenbiddle Jul 18, 2024
767545e
Increase touch-only tap target width
jhildenbiddle Jul 18, 2024
44144a8
Add theme prop includes (awaiting merge)
jhildenbiddle Jul 18, 2024
1ef355c
Move UI Kit page in sidebar
jhildenbiddle Jul 18, 2024
9eb3a8f
Update page titles
jhildenbiddle Jul 18, 2024
11f9443
Restore site config
jhildenbiddle Jul 18, 2024
8f10799
Fix nested CSS syntax in search plugin
jhildenbiddle Jul 18, 2024
099c041
Update snapshots
jhildenbiddle Jul 18, 2024
282c15b
Prevent matchMedia from breaking Jest (unit & int)
jhildenbiddle Jul 18, 2024
95cf10b
Update sidebar toggle test
jhildenbiddle Jul 18, 2024
662d571
Remove legacy theme addons
jhildenbiddle Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.eslintignore
.eslintrc.cjs
.github
.gitignore
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ dist
lib

# Files
_vars.css
_vars-advanced.css
CHANGELOG.md
emoji-data.*
HISTORY.md
HISTORY.md
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## docsify
# docsify

> A magical documentation site generator.

Expand Down
11 changes: 8 additions & 3 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<!-- markdownlint-disable first-line-h1 -->

![logo](_media/icon.svg)

# docsify <small>4.13.0</small>

> A magical documentation site generator.
> A magical documentation site generator

- Simple and lightweight
- No statically built html files
- No statically built HTML files
jhildenbiddle marked this conversation as resolved.
Show resolved Hide resolved
- Multiple themes

[Get Started](#docsify)
[GitHub](https://github.com/docsifyjs/docsify/)
[Getting Started](#docsify)

<!-- ![color](#f0f0f0) -->
<!-- ![](/_media/icon.svg) -->
32 changes: 31 additions & 1 deletion docs/_media/example.html
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
<h1>To infinity and Beyond!</h1>
<style>
html,
body {
margin: 0;
padding: 0;
min-height: 100%;
}

body {
background-color: #4158d0;
background-image: linear-gradient(
43deg,
#4158d0 0%,
#c850c0 46%,
#ffcc70 100%
);
color: #fff;
font-family: sans-serif;
}

main {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>

<main>
<p>Example HTML Page</p>
</main>
1 change: 1 addition & 0 deletions docs/_media/moon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/_media/sun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<!-- markdownlint-disable first-line-h1 -->

- Translations

- [:uk: English](/)
- [:cn: 简体中文](/zh-cn/)
- [:de: Deutsch](/de-de/)
Expand Down
7 changes: 5 additions & 2 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<!-- markdownlint-disable first-line-h1 -->

- Getting started

- [Quick start](quickstart.md)
- [Writing more pages](more-pages.md)
- [Custom navbar](custom-navbar.md)
- [Adding pages](adding-pages.md)
- [Cover page](cover.md)
- [Custom navbar](custom-navbar.md)

- Customization

Expand All @@ -23,6 +25,7 @@
- [CDN](cdn.md)
- [Offline Mode (PWA)](pwa.md)
- [Embed Files](embed-files.md)
- [UI Kit](ui-kit.md)

- [Awesome docsify](awesome.md)
- [Changelog](changelog.md)
20 changes: 18 additions & 2 deletions docs/more-pages.md → docs/adding-pages.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# More pages
# Adding pages

If you need more pages, you can simply create more markdown files in your docsify directory. If you create a file named `guide.md`, then it is accessible via `/#/guide`.

Expand Down Expand Up @@ -46,7 +46,23 @@ Create the `_sidebar.md`:
<!-- docs/_sidebar.md -->

- [Home](/)
- [Guide](guide.md)
- [Page 1](page-1.md)
```

To create section headers:

```markdown
<!-- docs/_sidebar.md -->

- Section Header 1

- [Home](/)
- [Page 1](page-1.md)

- Section Header 2

- [Page 2](page-2.md)
- [Page 3](page-3.md)
```

You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
Expand Down
24 changes: 9 additions & 15 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ window.$docsify = {

Website logo as it appears in the sidebar. You can resize it using CSS.

!> Logo will only bee visible if `name` prop is also set. See [name](#name) configuration.
!> Logo will only be visible if `name` prop is also set. See [name](#name) configuration.

```js
window.$docsify = {
Expand Down Expand Up @@ -917,17 +917,9 @@ If you have a link to the homepage in the sidebar and want it to be shown as act

For more details, see [#1131](https://github.com/docsifyjs/docsify/issues/1131).

## themeColor (_deprecated_)
## themeColor ⚠️

> **Warning** Deprecated. Use the CSS var `--theme-color` in your `<style>` sheet. Example:
>
> ```html
> <style>
> :root {
> --theme-color: deeppink;
> }
> </style>
> ```
!> Deprecated as of v5. Use the `--theme-color` [theme property](themes#theme-properties) to [customize](themes#customization) your theme color.

- Type: `String`

Expand All @@ -939,16 +931,18 @@ window.$docsify = {
};
```

## topMargin
## topMargin ⚠️

- Type: `Number`
!> Deprecated as of v5. Use the `--scroll-padding-top` [theme property](themes#theme-properties) to specify a scroll margin when using a sticky navbar.

- Type: `Number|String`
- Default: `0`

Adds a space on top when scrolling the content page to reach the selected section. This is useful in case you have a _sticky-header_ layout and you want to align anchors to the end of your header.
Adds scroll padding to the top of the viewport. This is useful when you have added a sticky or "fixed" element and would like auto scrolling to align with the bottom of your element.

```js
window.$docsify = {
topMargin: 90, // default: 0
topMargin: 90, // 90, '90px', '2rem', etc.
};
```

Expand Down
51 changes: 27 additions & 24 deletions docs/cover.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,61 @@ Activate the cover feature by setting `coverpage` to **true**. See [coverpage co

Set `coverpage` to **true**, and create a `_coverpage.md`:

```html
<!-- index.html -->

<script>
window.$docsify = {
coverpage: true,
};
</script>
<script src="//cdn.jsdelivr.net/npm/docsify@5/dist/docsify.min.js"></script>
```js
window.$docsify = {
coverpage: true,
};
```

```markdown
<!-- _coverpage.md -->

![logo](_media/icon.svg)

# docsify <small>3.5</small>
# docsify

> A magical documentation site generator.
> A magical documentation site generator

- Simple and lightweight
- No statically built html files
- No statically built HTML files
- Multiple themes

[GitHub](https://github.com/docsifyjs/docsify/)
[Get Started](#docsify)
```

## Custom background
## Customization

The background color is generated randomly by default. You can customize the background color or a background image:
The cover page can be customized using [theme properties](themes#theme-properties):

```markdown
<!-- _coverpage.md -->
<!-- prettier-ignore -->
```css
:root {
--cover-bg : url('path/to/image.png');
--cover-bg-overlay : rgba(0, 0, 0, 0.5);
--cover-color : #fff;
--cover-title-color: var(--theme-color);
--cover-title-font : 600 var(--font-size-xxxl) var(--font-family);
}
```

# docsify <small>3.5</small>
Alternatively, a background color or image can be specified in the cover page markdown.

[GitHub](https://github.com/docsifyjs/docsify/)
[Get Started](#quick-start)
```markdown
<!-- background color -->

![color](#f0f0f0)
```

```markdown
<!-- background image -->

![](_media/bg.png)

<!-- background color -->

![color](#f0f0f0)
```

## Coverpage as homepage

Normally, the coverpage and the homepage appear at the same time. Of course, you can also separate the coverpage by [onlyCover option](configuration.md#onlycover).
Normally, the coverpage and the homepage appear at the same time. Of course, you can also separate the coverpage by [`onlyCover`](configuration.md#onlycover) option.

## Multiple covers

Expand Down
12 changes: 12 additions & 0 deletions docs/custom-navbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ Alternatively, you can create a custom markdown-based navigation file by setting
- [chinese](/zh-cn/)
```

To create drop-down menus:

```markdown
<!-- _navbar.md -->

- Translations

- [En](/)
- [chinese](/zh-cn/)
```

!> You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.

`_navbar.md` is loaded from each level directory. If the current directory doesn't have `_navbar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_navbar.md` will be loaded from `/guide/_navbar.md`.
Expand All @@ -59,6 +70,7 @@ You can create sub-lists by indenting items that are under a certain parent.
- [Cover page](cover.md)

- Configuration

- [Configuration](configuration.md)
- [Themes](themes.md)
- [Using plugins](plugins.md)
Expand Down
Loading
Loading