Help

Re: Custom colors for field / column headers!

186 0
cancel
Showing results for 
Search instead for 
Did you mean: 
TheTimeSavingCo
18 - Pluto
18 - Pluto

TheTimeSavingCo_0-1737516008661.png

I wrote a Tampermonkey script to allow us to customize the colors of the field headers!

(Tampermonkey lets you install scripts in your browser to customize and add functionality to a site, in this case, Airtable! https://www.tampermonkey.net/)

To use it, you'll need to set up the exact field IDs and colors that you want those fields to be in this bit:

 

const colorMap = {
    "fldI5EIoOG25a85F7": { r: 255, g: 224, b: 204 },
    "fldxj4ka7M2FwkJAP": { r: 207, g: 245, b: 209 },
    "fldAPHkUW98PsaZV3": { r: 255, g: 234, b: 182 }
};

 

 

For the colors, just google 'Color Picker' and a bunch of options will show up (when I did this Google actually popped up its own Color Picker actually)

For the field IDs, right click the field header and click 'Copy URL' and then paste it somewhere, and it'll look something like this: https://airtable.com/appbvEVTtJoARHXPM/tblkT2pj3Ouz1wQRQ/viwKoIZQGVZEAfOap/fldI5EIoOG25a85F7

That last bit is what we're looking for 'fldI5EIoOG25a85F7'

---
Let me know if you have any issues installing it or could use some additonal functionality and I'll see what I can do!

I've also got a script that lets you set the entire column's colors in this other forum post

Screenshot 2025-01-28 at 11.47.17 AM.png

 

// ==UserScript==
// @name         Airtable Header Colors
// @namespace    http://thetimesaving.company
// @version      22-Jan-25
// @description  Changes the header color in Airtable views.
// @author       adam@thetimesaving.company
// @match        https://airtable.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=airtable.com
// @grant        GM_addStyle
// ==/UserScript==

//Set the field headers and colors you want them to be here

//For the colors, just google 'Color Picker' and a bunch of options will show up

//For the field IDs, right click the field header and click 'Copy URL' and then paste it somewhere
//It'll look something like this: https://airtable.com/appbvEVTtJoARHXPM/tblkT2pj3Ouz1wQRQ/viwKoIZQGVZEAfOap/fldI5EIoOG25a85F7
//That last bit is what we're looking for 'fldI5EIoOG25a85F7'

//Customization start
const colorMap = {
    "fldI5EIoOG25a85F7": { r: 255, g: 224, b: 204 },
    "fldxj4ka7M2FwkJAP": { r: 207, g: 245, b: 209 },
    "fldAPHkUW98PsaZV3": { r: 255, g: 234, b: 182 }
};
//Customization end


function applyColumnStyles() {
  let styles = '';

  Object.keys(colorMap).forEach(id => {
    const baseColor = colorMap[id];
    styles += `.cell.header[data-columnid="${id}"] { background-color: rgb(${baseColor.r}, ${baseColor.g}, ${baseColor.b}) !important; }\n`;
  });

  GM_addStyle(styles);
}

applyColumnStyles();

 

 

1 Reply 1
Mike_AutomaticN
10 - Mercury
10 - Mercury

Hey @TheTimeSavingCo! I'm giving this a shot, and I'm loving it already!!!! Nice contribution!

Mike_AutomaticN_0-1737575763956.png

I wonder what other stuff we can do with Tampermonkey... super interested to explore.

Mike, Consultant @ Automatic Nation