{ "cells": [ { "cell_type": "markdown", "id": "ce15239f", "metadata": {}, "source": [ "# Padding & Margin & Spacing, Oh my! (MonsterUI Spacing Guide)\n", "\n", "This guide will cover some essentials about how to properly space apps and what the differences are between:\n", "\n", "- Padding\n", "- Margin\n", "- Spacing\n", "- Gap\n", "\n", "Manipulating the space between components can make a huge difference to the percieved quality of the page. Being able to tweak the spacing can have a big impact!\n", "\n", "> Tip: I find it works best to get everything on the page without adjusting spacing much, and adjusting spacing at the end. \n", "\n", "## Abreviations:\n", "\n", "First a few abbreviations that are helpful to know with tailwind (and a convention we follow in `MonsterUI`).\n", "\n", "- `t`, `b`, `l`, `r` = top, bottom, left, right\n", "- `p`, `m` = padding, margin\n", "- `x`, `y` = horizontal, vertical\n", "\n", "That means:\n", "\n", "- `mt` means margin on top of the element\n", "- `px` means padding on the x axis (both left and right)\n", "- `space-y` means apply spacing on the y axis (both top and bottom)\n", "\n", "## Padding vs Margin\n", "\n", "Margin applies space to the left of the component, and padding applies space on the left inside of the component. \n", "\n", "Please reference the example with cards below:\n", "\n", "- `ml-20` applies space to the left of the card (outside the card)\n", "- `pl-20` applies space on the left inside of the card (inside the card)\n", "\n", "This means that if you want to move the whole thing but keep the actual container unchanged, use margin. If you want to change the container by adding space inside of it, use padding." ] }, { "cell_type": "code", "execution_count": 2, "id": "aef6844a", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/markdown": [ "```html\n", "