main

mattermost/focalboard

Last updated at: 29/12/2023 09:43

multiperson.scss

TLDR

This file, multiperson.scss, is a SCSS file that contains styles for a multi-person component. It defines styles for displaying a list of person items, including their images and names. It also defines styles for a dropdown menu used in the component.

Classes

MultiPerson

The MultiPerson class represents the multi-person component. It contains styles for displaying a list of person items and a dropdown menu. Some of the notable styles defined in this class include:

  • display: flex: Configures the component to be a flex container.
  • align-items: center: Centers the items vertically within the component.
  • border-radius: 4px: Sets the border radius of the component to create rounded corners.
  • flex-wrap: wrap: Allows the items to wrap if they exceed the container's width.
  • gap: 8px: Sets the gap between the items.
  • .readonly modifier class: Adds styles for a read-only state of the component, including hiding overflow and setting the minimum width to "unset".

MultiPerson-item

The MultiPerson-item class represents a person item within the multi-person component. It contains styles for displaying the person's image and name. Some of the notable styles defined in this class include:

  • display: flex: Configures the item to be a flex container.
  • align-items: center: Centers the content vertically within the item.

END

.MultiPerson {
    display: flex;
    align-items: center;
    border-radius: 4px;
    flex-wrap: wrap;
    gap: 8px;

    &.readonly {
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: unset;
    }

    .MultiPerson-item {
        display: flex;
        align-items: center;

        img {
            border-radius: 50px;
            width: 24px;
            height: 24px;
            margin-right: 6px;
        }
    }

    .react-select__menu {
        background: rgba(var(--center-channel-bg-rgb), 1);
        box-shadow: var(--elevation-4);
        border: 1px solid rgba(var(--center-channel-color-rgb), 0.16);
        border-radius: 4px;
    }

    .react-select__single-value {
        margin: 0;
        position: relative;
        top: 0;
        max-width: 100%;
    }

    .react-select__value-container--is-multi {
        gap: 4px;
        display: inline-flex;

        .react-select__multi-value__label {
            padding-left: 4px;
        }

        .react-select__multi-value {
            background: rgba(var(--center-channel-color-rgb), 0.08);
            border-radius: 24px;
            display: inline-flex;
            color: rgb(var(--center-channel-color-rgb));
            margin: 0;
            align-items: center;

            .MultiPerson-item,
            .react-select__multi-value__label {
                color: inherit;
            }
        }
    }

    .react-select__multi-value__remove {
        font-size: 18px;
        color: rgba(var(--center-channel-color-rgb), 0.56);
        margin: 6px;
        border-radius: 100%;
        margin-left: 0;
        padding: 0;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;

        &:hover {
            background: rgba(var(--center-channel-color-rgb), 0.26);
        }
    }

    .react-select__option {
        display: flex;
        align-items: center;
        height: 40px;
        padding: 0 40px 0 20px;

        &:hover {
            background: rgba(var(--center-channel-color-rgb), 0.08);
        }

        &:active {
            background: rgba(var(--button-bg-rgb), 0.08);
        }

        &.react-select__option--is-selected {
            background: rgba(var(--button-bg-rgb), 0.08);
            color: rgba(var(--center-channel-color-rgb), 1);
        }

        .MultiPerson-item {
            img {
                margin-right: 12px;
            }
        }
    }

    .react-select__menu-list {
        border: 0;
    }
}