Testing Notion content blocks and styling with TailwindCSS

February 22, 2022
Testing Notion content blocks and styling with TailwindCSS

From Notion's API documentation:

"A block object represents content within Notion. Blocks can be text, lists, media, and more. A page is a type of block, too!"

So far, only text-like blocks are currently available. View the Notion API documentation for more info.

Content blocks:

Heading 1

Heading 2

Heading 3

This is a paragraph block with bold text, strikethrough text, underline text, code text, italicized text and text in a different color.

  • bulleted list 1
  • bulleted list 2
  • bulleted list 3
    1. numbered list 1
    2. numbered list 2
    3. numbered list 3

    Toggle

    hi!? Underline?

    Bookmark

    Code

    async (image: string | PropertyValueFiles): Promise<number[]> => {
    let imageSrc: string;
    if (typeof image === 'string') {
    imageSrc = image;
    } else {
    imageSrc = PropertyImage(image);
    }
    const v = vib.from(imageSrc);
    const col = await v
    .getPalette()
    .then((palette) => palette)
    .catch(() => [0, 0, 0]);
    //gets Vibrant Color
    if (Array.isArray(col)) return col as number[];
    else return col.Vibrant?.rgb as number[];
    };

    Image

    Image caption
    Image caption

    Customize

    To edit how a content block renders, change the corresponding block component in ContentBlocks.js.

    View the Notion page where the contents of this page lives.

    Codepen

    Reactions

    Share Post

    Logo

    © Andrew Dorobantu - 2022