A small overlay that opens to reveal additional actions.
Example link: https://polaris.shopify.com/components/overlays/popover#navigation
I've made this awhile ago. https://codepen.io/mrkhdly/pen/eBXVxy Might be useful
I've made an example, having in mind the following:
<input type="checked" class="toggle-sibling clip" /> is used to keep track of the element state;~ selector is used to target the sibling popover element;toggle-sibling and sibling<div class="relative">
<!-- visual trigger -->
<label for="listUniqueName" class="ma0 bg-silver br2 pa1 dib link hover-bg-moon-gray pointer">
Items ...
</label>
<!-- state trigger element -->
<input class="toggle-sibling clip" type="checkbox" id="listUniqueName" />
<!-- popover element -->
<dl class="sibling mt0 absolute bg-black-80 br1 pa2 white mt1">
<dt class="green">Fruits</dt>
<dd class="ma0">Banana</dd>
<dd class="ma0">Apple</dd>
<dd class="ma0">Orange</dd>
<dt class="green">Vegetables</dt>
<dd class="ma0">Carrot</dd>
<dd class="ma0">Tomato</dd>
<dd class="ma0">Garlic</dd>
</dl>
</div>
.sibling {
opacity: 0;
transition: opacity .15s ease-in;
visibility: hidden; /* Make it hidden */
}
.toggle-sibling:checked ~ .sibling {
opacity: 1;
transition: opacity .15s ease-in;
visibility: visible; /* Make it visible */
}
<button>
<span>Items</span>
<dl> ... </dl>
</button>
id and label's for attributes;
Most helpful comment
motivation
I've made an example, having in mind the following:
implementation
<input type="checked" class="toggle-sibling clip" />is used to keep track of the element state;~selector is used to target the sibling popover element;toggle-siblingandsiblingcode
demo
flems link
pros
cons
idand label'sforattributes;