I’m using summary/details html gadget for show a series of events.
Here is a simplified code (removed all rails/erb logic)
.eventscreen {
display: flex;
flex-direction: column;
width: 100%;
margin: 1em;
padding: 1em;
gap: 1em;
details {
justify-self: center;
table {
display: inline;
table-layout: auto;
width: 70%;
}
td {
border-right: 1px solid;
text-align: center;
}
}
summary {
font-style: italic;
}
details[open] {
padding: 0.5em;
}
details[open] summary {
border-bottom: 1px solid #733030;
margin-bottom: 0.5em;
}
}
<div class="eventscreen">
<details class="box">
<summary>
<table>
<tr>
<th>name</th>
<td>address</td>
<td>date</td>
</tr>
</table>
</summary>
<div>
descr
</div>
</details>
<details class="box">
<summary>
<table>
<tr>
<th>name</th>
<td>address</td>
<td>date</td>
</tr>
</table>
</summary>
<div>
descr
</div>
</details>
</div>
Also I want to replace the arrow with a PNG icon. I tried removing it with this, but it has no affect (in Chrome):
summary::-webkit-details-marker {display: none;}
3
Answers
To center the arrow on the line, you can just give your tr element display:flex;
To remove the details marker in Chrome you can set the list-style to none (your definition works for safari). Or use list-style-type to replace it with a custom character.
If you want to replace the marker with an image, you can define a background-image for the summary.
In reality the marker is centered vertically to the element:
but the
display
property is not correct. Changing it toinline-block
and settingvertical-align: middle
in the same selector will make the marker centered vertically:To hide the marker and replace it with an image you can do the following:
font-size
ofmarker
. To solve the issue, you can adjust themarker
size to center the arrow relative to the surrounding text content like the below.png
file orbefore
instead of the marker.Note: To remove the default
marker
, you can uselist-style: none;