grantmcdermott / quarto-revealjs-clean

A minimalist and elegant presentation theme for Quarto Reveal.js
https://grantmcdermott.com/quarto-revealjs-clean-demo/template.html
MIT License
230 stars 37 forks source link

Display of loose #15

Open harrysw1729 opened 2 days ago

harrysw1729 commented 2 days ago

Currently, there is a line break between a nested list's marker and the item.

To illustrate the issue, install the extension to the project directory and consider the following .qmd document:

## Slide

::: {.columns}

:::: {.column}

### Tight

- 1
  - 1.1
  - 1.2
- 2
  - 2.1
  - 2.2

::::

:::: {.column}

### Loose

- 1

  - 1.1

  - 1.2

- 2

  - 2.1

  - 2.2

::::

:::

For contrast, we create two Quarto profiles, one for the default revealjs, and the other for the clean theme.

# for the default theme
format:
  revealjs: default
output-file: foo.html
# for the clean theme
format:
  clean-revealjs: default
output-file: foo_clean.html

If we render the document with the two profiles, we get the following output for the default theme:

image

In contrast, the clean theme has the following display:

image

For the clean theme, in the loose list, there is a line break between item 1.1 and its marker; the line break does not exist for the tihgt list. In contrast, for the default theme, there is no line break between item 1.1 and its marker for tight or loose lists.

Thank you very much for your help.

harrysw1729 commented 2 days ago

The issue appears to be that in a loose list, the content of a list item is put within a p element. However, the current styling directly styles li:before (here] in ul ul, which leads to the line break when the p tag is inserted.

A quick workaround is to style li::marker rather than li::before, where the content and color attributes will still work. However, other fields such as width do not seem to work with ::marker.