mozilla / multi-account-containers

Firefox Multi-Account Containers lets you keep parts of your online life separated into color-coded tabs that preserve your privacy. Cookies are separated by container, allowing you to use the web with multiple identities or accounts simultaneously.
https://addons.mozilla.org/firefox/addon/multi-account-containers/
Mozilla Public License 2.0
2.73k stars 341 forks source link

[UI Enhancement] Colorize the address bar color based on container color #2202

Open basings opened 2 years ago

basings commented 2 years ago

This might be heavily based on preference, but if the whole address bar is colorized it's unambiguous that the website is open in a specific container.

screenshot s1 s2

basings commented 2 years ago

MrOtherGuy has written a first draft for a working solution here

/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/urlbar_container_color_border.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */

/* Draws a border around urlbar using the color of the current container. */

#urlbar:not([open]) > #urlbar-input-container{
  border-width: 0 !important;
  padding: 2px !important;
}

#userContext-icons::before{
  box-sizing: border-box;
  display: block;
  position: absolute;
  content: "";
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  outline: 1px solid var(--identity-icon-color);
  border-radius: var(--toolbarbutton-border-radius);
  outline-offset: -1px;
  pointer-events: none;
}

#urlbar[focused] #userContext-icons::before{
  outline-width: 2px;
  outline-offset: -2px
}

/* These might potentially cause some issues, but are needed to make the border extend the border to the full popup when urlabar popup is open */
#urlbar[open] > #urlbar-input-container{ position: static !important; }
#urlbar[open] > #urlbar-background{ z-index: -1 !important; }

/* OPTIONAL FEATURES */

/* Hide container label in urlbar */
/* #userContext-label{ display: none } */

/* Hide container icon in urlbar */
/* #userContext-indicator{ display: none } */

/* Hide the container line above tabs */
/* .tab-context-line{ display: none } */