Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

4.2 KB
Raw Blame
.message-edit-history-container {
    .header-body {
        display: flex;
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        gap: 5px;

        @media (width < $lg_min) {
            display: block;
        }
    }

    .message_edit_history_content {
        .highlight_text_inserted {
            color: var(--color-message-edit-history-text-inserted);
            background-color: var(
                --color-message-edit-history-background-inserted
            );
        }

        .highlight_text_deleted {
            color: var(--color-message-edit-history-text-deleted);
            background-color: var(
                --color-message-edit-history-background-deleted
            );
            text-decoration: line-through;
            word-break: break-all;
        }
    }

    .messagebox-content {
        display: block !important;

        .message_content {
            cursor: default !important;
        }
    }

    #message-history-error {
        /*
        styles are based on .model_content
        see web/styles/modal.css
        */
        font-size: 1rem;
        display: none;
        margin: 10px;
    }

    .overlay_loading_indicator_style {
        width: 100% !important;
        height: 100% !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

#message-history-overlay
    .message-edit-history-container
    .message_edit_history_content {
    /* We need to use different color for links to distinguish
       them from normal text and have enough contrast so that they
       are visible clearly. */
    .highlight_text_inserted,
    .highlight_text_deleted {
        > a {
            color: light-dark(
                var(--color-markdown-link),
                hsl(200.27deg 100% 85.49%)
            );
        }
    }

    /* A link that was added or removed outright is wrapped by the
       highlight, so its own underline takes the diff color. */
    .highlight_text_inserted > a {
        --color-message-edit-history-diff-text: var(
            --color-message-edit-history-text-inserted
        );
    }

    .highlight_text_deleted > a {
        --color-message-edit-history-diff-text: var(
            --color-message-edit-history-text-deleted
        );
    }

    .highlight_text_inserted > a,
    .highlight_text_deleted > a {
        text-decoration-color: color-mix(
            in oklch,
            var(--color-message-edit-history-diff-text) 30%,
            transparent
        );

        &:hover,
        &:focus {
            text-decoration-color: color-mix(
                in oklch,
                var(--color-message-edit-history-diff-text) 70%,
                transparent
            );
        }

        &:active {
            text-decoration-color: var(--color-message-edit-history-diff-text);
        }
    }

    /* When only part of a link changed, the highlights sit inside
       the link, which keeps its own underline under the unchanged
       text. Each changed run underlines itself in its own color,
       drawn over the link's underline. */
    a > .highlight_text_inserted,
    a > .highlight_text_deleted {
        text-decoration-thickness: 1px;
        /* 3px at 14px em */
        text-underline-offset: 0.2143em;
    }

    a > .highlight_text_inserted {
        text-decoration-line: underline;
    }

    /* This run is already struck through, and both lines share one
       color, so leaving the color alone keeps the strikethrough as
       it was. */
    a > .highlight_text_deleted {
        text-decoration-line: underline line-through;
    }

    /* Show `Link:` text of media beside it
       to clarify click area for opening media
       in new tab vs in lightbox. */
    .highlight_text_inserted:has(.media-anchor-element .media-image-element),
    .highlight_text_deleted:has(.media-anchor-element .media-image-element) {
        > .media-anchor-element {
            display: flex;
            overflow-wrap: anywhere;

            > .media-image-element {
                flex-grow: 1;
                flex-shrink: 0;
            }
        }

        @media (width < $sm_min) {
            > .media-anchor-element {
                flex-direction: column;
            }
        }
    }
}