Published on

Color Notion Formula with the style function

Use the style function in Notion formulas to add colors and format text. This lets you control how your data appears in your Notion pages.

What is the style function?

The style function in Notion formula adds formatting to text. It supports decorations, text colors, and background colors.

Syntax:

style(value, styles);
style(value, decorations, color, background_color);

Styling Options

  • Decorations:

    • Bold (b)

    • Underline (u)

    • Italics (i)

    • Code (c)

    • Strikethrough (s)

  • Text Colors:

    • gray

    • brown

    • orange

    • yellow

    • green

    • blue

    • purple

    • pink

    • red

  • Background Colors:

    • gray_background

    • brown_background

    • orange_background

    • yellow_background

    • green_background

    • blue_background

    • purple_background

    • pink_background

    • red_background

Example Usage

  • Simple String Styling

    style("Hello, Notion!", "b", "i", "blue", "yellow_background")
    // Outputs "Hello, Notion!" with bold italic blue text and a yellow background
    
  • Styling with a Formula

    style(parseDate("2025-01-01"), "b", "brown", "red_background")
    // Outputs "January 1, 2025" with bold, brown text and a red background
    
  • Conditional Styling with an If Statement

    if(
      prop("Active"),
      style("Active", "b", "blue", "blue_background"),
      style("Inactive", "s", "gray", "gray_background")
    )
    // Displays "Active" with bold blue text and a blue background if the "Active" property is true,
    // otherwise displays "Inactive" with strikethrough gray text and a gray background
    

Notion Templates

  • Get 210 Notion Templates + 50 mockups + Notion Formulas 2.0 Cheatsheet + Notion Colors Guide + 100 ideas how to make money online by selling digital products —Grab Yours Now!