Skip to main content

IMPERSONATION_BANNER_CSS

Constant IMPERSONATION_BANNER_CSS 

Source
pub const IMPERSONATION_BANNER_CSS: &str = "
    .autumn-impersonation-banner {
        position: sticky;
        top: 0;
        z-index: 1000;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
        justify-content: space-between;
        padding: 0.6rem 1rem;
        background: #b45309;
        color: #fff;
        font: 500 0.9rem/1.4 system-ui, -apple-system, sans-serif;
        box-shadow: 0 1px 3px rgb(0 0 0 / 25%);
    }
    .autumn-impersonation-banner__text { margin: 0; }
    .autumn-impersonation-banner__who { font-weight: 700; }
    .autumn-impersonation-banner__form { margin: 0; }
    .autumn-impersonation-banner__stop {
        padding: 0.35rem 0.85rem;
        border: 1px solid rgb(255 255 255 / 60%);
        border-radius: 4px;
        background: transparent;
        color: inherit;
        font: inherit;
        cursor: pointer;
    }
    .autumn-impersonation-banner__stop:hover { background: rgb(255 255 255 / 15%); }
    .autumn-impersonation-banner__stop:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }
";
Expand description

Styles for the impersonation banner (impersonation_banner).

The admin layout already includes these. An application that embeds the banner in its own layout — the surface an operator actually sees while impersonating a non-admin user — should drop this into its stylesheet or a <style> block. Deliberately class-based rather than inline style attributes, so it survives a nonce-based style-src CSP.