1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 02:36:11 +02:00
Files
csslayout/contents/presence-indicator.md
2022-09-21 14:31:37 +07:00

791 B

layout, title, description, keywords
layout title description keywords
layouts/post.njk Presence indicator Create a presence indicator with CSS css indicator

HTML

<div class="presence-indicator">
    <!-- Other element such as avatar -->
    ...

    <!-- The presence indicator -->
    <div class="presence-indicator__indicator"></div>
</div>

CSS

.presence-indicator {
    position: relative;
}

.presence-indicator__indicator {
    /* Shown at the bottom right corner */
    bottom: 0;
    position: absolute;
    right: 0;
    transform: translate(50%, 50%);

    /* Rounded border */
    border-radius: 9999px;
    height: 1rem;
    width: 1rem;

    /* Background color */
    background-color: #22c55e;
}

{% demo %} {% include "covers/presence-indicator.njk" %} {% enddemo %}