Make the "Masquerade as" link more visible

Created on 24 June 2025, 3 months ago

Problem/Motivation

Currently, it's very easy to miss the "Masquerade as this user" link, since it easily blends in with all the other content.

Steps to reproduce

Install the module, and easily miss that Masquerade is now available.

Proposed resolution

Make it pop!

Also, the link gets inserted at the bottom of the page. Perhaps placing the link at the top of the page, under "Status messages" or at the very top of "Main page content" could be worth considering?

Currently

Better?

CSS

a.masquerade-button {
  background-color: #0876c0;
  color: white;
  display: inline-block;
  font-size: 18px;
  padding-right: 10px;
}

.masquerade-button img {
  height: 25px;
  width: 25px;
}

HTML

<a href="#" class="masquerade-button">
  <img src="https://git.drupalcode.org/project/masquerade/-/avatar.png">
  Masquerade as This User
</a>

Remaining tasks

  • Update the mark up
  • Add the CSS (inline, or as a file?)

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

2.0

Component

User interface

Created by

🇩🇰Denmark ressa Copenhagen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ressa
  • 🇩🇰Denmark ressa Copenhagen

    Fix formatting.

  • Assigned to anirudhsingh19
  • 🇮🇳India anirudhsingh19

    working on this

  • Pipeline finished with Failed
    4 days ago
    Total: 159s
    #593874
  • Pipeline finished with Failed
    4 days ago
    Total: 158s
    #593881
  • Pipeline finished with Failed
    4 days ago
    Total: 162s
    #593903
  • 🇮🇳India anirudhsingh19

    I have implemented the proposed style for the link. Please review!

  • 🇩🇰Denmark ressa Copenhagen

    Thanks @anirudhsingh19, that looks great!

    Though, the .masquerade-as-user-link:hover CSS class doesn't seem to be in effect ... Perhaps the change could be that the white text turns slightly light-grey, to acknowledge the hovering?

    Also, what do you think about my suggestion about placing the button at the top? Would that be difficult?

    Also, the link gets inserted at the bottom of the page. Perhaps placing the link at the top of the page, under "Status messages" or at the very top of "Main page content" could be worth considering?

    As an extra thing I didn't mention, the "Unmasquerade" is also a bit hidden, as a regular link in the menu. I wonder if that could be shown as a button as well, like "Masquerade"? If it's too difficult, it's not super important.
    Thanks!

  • Pipeline finished with Failed
    3 days ago
    Total: 207s
    #594607
Production build 0.71.5 2024