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:
PLanCompS
2020-09-29 17:13:13 +02:00
parent 76f8f064ac
commit 59f757a790
5 changed files with 256 additions and 0 deletions

83
docs/tests/styling/dl.md Normal file
View 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

View File

@@ -0,0 +1,8 @@
---
layout: default
title: Styling
parent: Tests
has_children: true
---
# Styling

65
docs/tests/styling/ol.md Normal file
View 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
View 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