Is there some setting or workaround for Gmail to highlight an entire line if the email is both unread and from certain people without changing the sort order?


My company is switching from Microsoft Office to Google. This includes establishing Chrome as the company standard. I'm very used to Outlook and haven't used Gmail in years. I have searched the Chrome Store, SuperUser, WebApps, and the web in general without finding an answer to this.

I rely heavily on conditional formatting in Microsoft Outlook. Any unread emails from my management are shown in a larger-than-normal, bold, red font. Unread emails from purchasing are in a blue font and our receiving inspection group is green. They key points I really like about this approach are:

  1. Important emails call attention to themselves by changing the entire line they appear on instead of just a small icon
  2. Emails remain in order by date received
  3. The color-coding / resizing is automatically applied when it is received
  4. The color-coding / resizing is automatically removed after I read the message

My Own Efforts:

Here's what I have tried in Gmail to recreate this and why each falls short: (My company will no longer use a desktop client so the solution must work in Chrome.)

  • Use filters to apply label "MANAGEMENT" and make it big and red.
    • It's fairly easy to see but not across the entire line. I could live with this, though.
    • It sticks around even after I've read the email which is explicitly not what I want.
    • UPDATE 2017-09-08: This is the solution I have been using thus far. Since Gmail turns the line grey when the message is read, I have somewhat managed to train myself to notice the label + white background. However, they're still much easier to overlook than when the entire line is in bold red text.
  • Use filters to mark them as Important or some star
    • Marking as important gives the same importance for all groups, which won't work.
    • Marking then with stars et al. are not distinctive enough for them to "pop" like I want
  • Use Priority Inbox to show unread messages from management first
    • It throws the emails out of order. If the email chain goes coworker-coworker-boss-coworker, I want to read all those emails to put the boss's in context and also make sure I don't look stupid by repeating things that others said.

Related points that may matter:

  • I don't use Conversation View. For what I want to do, that may make it worse, right? If the boss sends an email and someone else replies to it, it would show up as them in my inbox instead of boss, right?
  • I have Tampermonkey and am comfortable using a script to solve the problem.

UPDATE 2017-09-08

  • As stated above, I've been using filters to apply a preset label "Management" which is bright red. It's been partially effective.
  • Based on a commented suggestion, I tried writing a script to periodically scan my messages and format them. It was unsuccessful because:
    • There doesn't seem to be any way - through a script or otherwise - to change the formatting of an entry in your Gmail inbox.
    • I tried using the script to create a label called "MANAGEMENT UNREAD" plus the subject line of the message. The idea was to create a long, red label that would take up more space on the line and act like a formatted text. However:
      • There doesn't seem to be a way to change the color of a label via Google Script so I can't make it bright red or any other color besides its default.
      • Very long label names are truncated so they can't take up too much space on the line.
  • My next plan is as follows:
    • Create a "Mgt" label and color it gray. This will be short and unobtrusive.
    • Create a "♒♒ MANAGEMENT UNREAD ♒♒" label and color it red. This will be long and more eye-catching. To avoid cluttering this text, I'll refer to it as "MU" label.
    • The filter will label all new messages from management as both "Mgt." and "MU".
    • Write a Google Script with a one minute Installable Trigger that will perform the following:
      • Find all read messages with the label "MU" and remove that label.
      • Find all unread messages with the label "Mgt" and apply the "MU" label. (In case I go back and mark a message as unread to keep it flagged.)
  • This method is currently in place and running. If it proves to be sufficient, I'll migrate this section to an answer (with the code) and accept it just to "close" the question.

It's the dawning of the age of aquarius. U+2652 chosen purely based on appearance.

  • Did you know that you could continue using Outlook as you email client for your Gmail account? I you are using G Suite, you could use Google Apps Sync for MS Outlook to think mail, contacts, calendar tasks... Oct 17, 2016 at 15:54
  • 1
    @Rubén I would do that except the company will be uninstalling Outlook - along with most of the Office Suite - come January. Oct 17, 2016 at 16:43
  • 1
    @freginold I'd be interested in a cross-browsing solution just to know if it's possible, but my company established Chrome as the standard browser and do not support any others. In my particular case, therefore, a Chrome-only solution would be sufficient. I have updated the question to reflect this. Sep 8, 2017 at 12:01
  • 1
    @EngineerToast I'm not terribly familiar with Google App Scripts, but it seems like you should be able to configure that. You can use the Gmail API to listen for when an email is "read" and then remove whatever formatting you'd applied, then refresh the email.
    – freginold
    Sep 8, 2017 at 14:28
  • 1
    @freginold Google doesn't allow scripts to run continuously in the background so it can't actively monitor Gmail. Sheets, Docs, Forms can be scripts which contain Simple Triggers that fire whenever a certain event occurs but Gmail cannot fire a script whenever an email is received or read. However, a script could be setup to run once a minute using Installable Triggers and that could scan the inbox, formatting as it goes. This is a very interesting idea... Sep 8, 2017 at 15:08

2 Answers 2


I now have a workaround that solves my particular use case. However, it does not address the overall question of conditionally formatting Gmail. As far as I can tell, there is no direct means to do that without editing the source code for the page and that stuff is a mess. I presume an addon could do it but it's way beyond my scope of knowledge.

In order to achieve the effect I wanted, I followed these steps:

  1. Setup a label in Gmail called "Mgt" and color it gray.

    • The text makes it a tiny label and the color makes it inconspicuous.
    • Its purpose is so I can keep track of all management emails whether they're read or not.
    • It looks like this: Mgt Label
  2. Set Gmail Filters to automatically apply the Mgt Label label to all emails from certain people.

  3. Setup a label in Gmail called "♒♒ Management Unread ♒♒" and color it red.

    • The long text makes it a large label and the color makes it conspicuous.
    • If the text is too long, it is truncated. This length was the max (on my system, at least).
    • The squiggly lines are U+2652 Aquarius, chosen purely on appearance.
    • Its purpose is to make the unread email from management "pop" visually.
    • It looks like this: Unread Label
  4. Write Google Apps Script that searches my Gmail

    • The script is saved on Drive for the same account that's using Gmail
    • It performs the following two actions:
      1. Find all unread messages in Mgt Label and add the label Unread Label.
      2. Find all read messages in Unread Label and remove that label.
    • The code is:
function addRemoveManagementLabelsInGmail() {

  // These labels MUST be setup in Gmail before running this script
  var basicLabelName = 'Mgt';
  var unreadLabelName = '♒♒ MANAGEMENT UNREAD ♒♒';

  // Get the label object
  var unreadLabel = GmailApp.getUserLabelByName(unreadLabelName);

  // Add the label to unread messages
  // You can't change more than 100 labels at a time so, if there are that many, we use the slower method
  var unreadThreads = GmailApp.search('label:' + basicLabelName + ' is:unread');
  if (unreadThreads.length < 100) {
  } else {
    for (i=0; i<unreadThreads.length; i++) {

  // Remove the label from read messages
  // You can't change more than 100 labels at a time so, if there are that many, we use the slower method
  var readThreads = GmailApp.search('label:' + unreadLabelName + ' is:read');
  if (readThreads.length < 100) {
  } else {
    for (i=0; i<readThreads.length; i++) {

  1. Setup an installable trigger on that script so that it runs once a minute.

This is not a perfect system but it does create an obvious visual for me and has, thus far, been effective. My original attempt was just a long "MANAGEMENT" label on all of them but I quickly fatigued since the read messages had just as much apparent importance as the read messages.


I know this is from pretty long ago, but here's a couple of ideas that might help people with the same question. These are workarounds. Rather than highlighting the matching emails in place, they display them in their own list.

You could do a search for any unread emails from management, and save the URL as a bookmark. Keep that URL open all the time in its own tab in Chrome, and check it regularly. It seems to occasionally refresh the page to see new matching emails and to remove emails you've read, not sure how often.

You can also set the Inbox Type to Multiple Inboxes. That lets you display several views of the Inbox that match custom search queries. If you include the query above, you'll see a list of your unread management emails. It can make the screen a bit cluttered though, and you lose your reading pane.

A problem with most ways of dealing with the problem is that they don't work well on a phone.

  • Welcome to Web Applications. It looks that this answer isn't attemptimg to answer to the question. Was your intention to post this content as answer to this question? if so, please explain how it answer the question. Mar 9, 2023 at 18:33
  • The question is about conditional formatting like Outlook's. These two workarounds can do the conditional part, but the formatting is placement rather than colour or highlighting like in Outlook.
    – ppss
    Mar 10, 2023 at 23:38
  • Please edit the answer to clarfify how it answer whats is being asked, particularly mention if it address in anyway the question in bold at the top of the question body or if it refers to a different thing. Mar 10, 2023 at 23:46
  • Done. How's that now?
    – ppss
    Mar 12, 2023 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.