pages-themes / cayman

Cayman is a Jekyll theme for GitHub Pages
https://pages-themes.github.io/cayman/
Creative Commons Zero v1.0 Universal
1.22k stars 3.19k forks source link

<details> <summary> tag not working #147

Open withrvr opened 2 years ago

withrvr commented 2 years ago

Example code

<details>
  <summary>⚡ GitHub Stats</summary>

1. something
2. foo
3. bar

</details>

OR

<details>
  <summary>⚡ GitHub Stats</summary>
  <br />

![GitHub Streak Stats](http://github-readme-streak-stats.herokuapp.com?user=withrvr&date_format=j%20M%5B%20Y%5D)

![withrvr GitHub Stats](https://github-readme-stats.vercel.app/api?username=withrvr&show_icons=true)

![withrvr GitHub Most Used Language Stats](https://github-readme-stats.vercel.app/api/top-langs/?username=withrvr&langs_count=10&layout=compact)

</details>

Images

image

image

YDX-2147483647 commented 2 years ago

I meet the same issue today.

Add this in your style.scss, and the small triangle will be back.

details > summary:first-of-type {
    display: list-item;
}

(If you don't have a style.scss yet, please follow the guide in Read Me.)

Besides, if you want to use markdown inside a HTML tag, markdown='1' is necessary.

<details markdown='1'>
  <summary>⚡ GitHub Stats</summary>

1. something
2. foo
3. bar

</details>

Futher information: kramdown syntax. (Search “By default, kramdown parses all block HTML tags and all XML tags as raw HTML blocks.” if the browser doesn't jump there.)

YDX-2147483647 commented 2 years ago

I think update normalize.scss would fix it forever and for all.

Revert "Upgrade normalise.css from v3.0.2 to v8.0.0.", was it an error?.

d-donne commented 2 years ago

The Details Tag

Used to create content that can collapse or expand upon the user clicking on it.

Syntax

<details>
    <summary> General Info about Content </summary>

     Your Content
     Your Content

</details>

The summary tag is nested in the details tag and it has the content that will show when collapsed.

YDX-2147483647 commented 2 years ago

Thanks for explaining the syntax, but it's not the key. The default triangle widget which indicates “you can click me to expand” is overwritten by mistake in normalise.css v3.0.2:

https://github.com/pages-themes/cayman/blob/29f8a343aad3bd9eea1173c01ab45a8a20acd7ff/_sass/normalize.scss#L45-L47

(The widget is a kind of list-style, so it appears when display: list-item but not when display: block;)