mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-08 04:51:23 -06:00
Fix list alignment
Resolve #420 - Remove `margin-top` for the first child in various list items, to improve alignment. - Add examples of lists to `docs/tests/styling`.
This commit is contained in:
parent
76f8f064ac
commit
59f757a790
@ -154,6 +154,41 @@
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
blockquote,
|
||||||
|
div,
|
||||||
|
dl,
|
||||||
|
dt,
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6,
|
||||||
|
li,
|
||||||
|
ol,
|
||||||
|
p,
|
||||||
|
pre,
|
||||||
|
table,
|
||||||
|
ul,
|
||||||
|
.table-wrapper {
|
||||||
|
&:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dd,
|
||||||
|
ol,
|
||||||
|
ul {
|
||||||
|
dl:first-child {
|
||||||
|
dt:first-child,
|
||||||
|
dd:nth-child(2) {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.anchor-heading:hover,
|
.anchor-heading:hover,
|
||||||
h1:hover > .anchor-heading,
|
h1:hover > .anchor-heading,
|
||||||
|
83
docs/tests/styling/dl.md
Normal file
83
docs/tests/styling/dl.md
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Description lists
|
||||||
|
parent: Styling
|
||||||
|
grand_parent: Tests
|
||||||
|
---
|
||||||
|
|
||||||
|
# Description lists
|
||||||
|
|
||||||
|
The first child element of each `dd` element in a `dl` list should be aligned with the preceding `dt` element in the following examples.
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: paragraph text
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: ### Header
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: > block quote
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: ```sh
|
||||||
|
fenced code block
|
||||||
|
```
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: + unordered list item
|
||||||
|
+ unordered list item
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: 1. ordered list item
|
||||||
|
2. ordered list item
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: sub-term
|
||||||
|
: sub-description
|
||||||
|
|
||||||
|
sub-term
|
||||||
|
: sub-description
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: |-----------------+------------+-----------------+----------------|
|
||||||
|
| Default aligned |Left aligned| Center aligned | Right aligned |
|
||||||
|
|-----------------|:-----------|:---------------:|---------------:|
|
||||||
|
| First body part |Second cell | Third cell | fourth cell |
|
||||||
|
| Second line |foo | **strong** | baz |
|
||||||
|
| Third line |quux | baz | bar |
|
||||||
|
|-----------------+------------+-----------------+----------------|
|
||||||
|
| Second body | | | |
|
||||||
|
| 2 line | | | |
|
||||||
|
|=================+============+=================+================|
|
||||||
|
| Footer row | | | |
|
||||||
|
|-----------------+------------+-----------------+----------------|
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
term
|
||||||
|
|
||||||
|
: ***
|
||||||
|
|
||||||
|
paragraph text
|
8
docs/tests/styling/index.md
Normal file
8
docs/tests/styling/index.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Styling
|
||||||
|
parent: Tests
|
||||||
|
has_children: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Styling
|
65
docs/tests/styling/ol.md
Normal file
65
docs/tests/styling/ol.md
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Ordered lists
|
||||||
|
parent: Styling
|
||||||
|
grand_parent: Tests
|
||||||
|
---
|
||||||
|
|
||||||
|
# Ordered lists
|
||||||
|
|
||||||
|
The first child element of each `li` element in an `ol` list should be aligned with the preceding label in the following examples.
|
||||||
|
|
||||||
|
1. paragraph text
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
1. ### Header
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
1. > block quote
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
1. ```sh
|
||||||
|
fenced code block
|
||||||
|
```
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
1. + unordered list item
|
||||||
|
+ unordered list item
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
1. 1. ordered list item
|
||||||
|
2. ordered list item
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
1. term
|
||||||
|
: description
|
||||||
|
|
||||||
|
term
|
||||||
|
: description
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
1. |-----------------+------------+-----------------+----------------|
|
||||||
|
| Default aligned |Left aligned| Center aligned | Right aligned |
|
||||||
|
|-----------------|:-----------|:---------------:|---------------:|
|
||||||
|
| First body part |Second cell | Third cell | fourth cell |
|
||||||
|
| Second line |foo | **strong** | baz |
|
||||||
|
| Third line |quux | baz | bar |
|
||||||
|
|-----------------+------------+-----------------+----------------|
|
||||||
|
| Second body | | | |
|
||||||
|
| 2 line | | | |
|
||||||
|
|=================+============+=================+================|
|
||||||
|
| Footer row | | | |
|
||||||
|
|-----------------+------------+-----------------+----------------|
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
1. ***
|
||||||
|
|
||||||
|
paragraph text
|
65
docs/tests/styling/ul.md
Normal file
65
docs/tests/styling/ul.md
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Unordered lists
|
||||||
|
parent: Styling
|
||||||
|
grand_parent: Tests
|
||||||
|
---
|
||||||
|
|
||||||
|
# Unordered lists
|
||||||
|
|
||||||
|
The first child element of each `li` element in a `ul` list should be aligned with the preceding bullet in the following examples.
|
||||||
|
|
||||||
|
- paragraph text
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
- ### Header
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
- > block quote
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
- ```sh
|
||||||
|
fenced code block
|
||||||
|
```
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
- + unordered list item
|
||||||
|
+ unordered list item
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
- 1. ordered list item
|
||||||
|
2. ordered list item
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
- term
|
||||||
|
: description
|
||||||
|
|
||||||
|
term
|
||||||
|
: description
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
- |-----------------+------------+-----------------+----------------|
|
||||||
|
| Default aligned |Left aligned| Center aligned | Right aligned |
|
||||||
|
|-----------------|:-----------|:---------------:|---------------:|
|
||||||
|
| First body part |Second cell | Third cell | fourth cell |
|
||||||
|
| Second line |foo | **strong** | baz |
|
||||||
|
| Third line |quux | baz | bar |
|
||||||
|
|-----------------+------------+-----------------+----------------|
|
||||||
|
| Second body | | | |
|
||||||
|
| 2 line | | | |
|
||||||
|
|=================+============+=================+================|
|
||||||
|
| Footer row | | | |
|
||||||
|
|-----------------+------------+-----------------+----------------|
|
||||||
|
|
||||||
|
paragraph text
|
||||||
|
|
||||||
|
- ***
|
||||||
|
|
||||||
|
paragraph text
|
Loading…
x
Reference in New Issue
Block a user