Interactivity

Scroll Padding

Utilities for controlling an element’s scroll offset within a snap container.

Quick reference

Class
Properties
scroll-p-0scroll-padding: 0px;
scroll-px-0scroll-padding-left: 0px; scroll-padding-right: 0px;
scroll-py-0scroll-padding-top: 0px; scroll-padding-bottom: 0px;
scroll-ps-0scroll-padding-inline-start: 0px;
scroll-pe-0scroll-padding-inline-end: 0px;
scroll-pt-0scroll-padding-top: 0px;
scroll-pr-0scroll-padding-right: 0px;
scroll-pb-0scroll-padding-bottom: 0px;
scroll-pl-0scroll-padding-left: 0px;
scroll-p-pxscroll-padding: 1px;
scroll-px-pxscroll-padding-left: 1px; scroll-padding-right: 1px;
scroll-py-pxscroll-padding-top: 1px; scroll-padding-bottom: 1px;
scroll-ps-pxscroll-padding-inline-start: 1px;
scroll-pe-pxscroll-padding-inline-end: 1px;
scroll-pt-pxscroll-padding-top: 1px;
scroll-pr-pxscroll-padding-right: 1px;
scroll-pb-pxscroll-padding-bottom: 1px;
scroll-pl-pxscroll-padding-left: 1px;
scroll-p-0.5scroll-padding: 0.125rem; / 2px /
scroll-px-0.5scroll-padding-left: 0.125rem; / 2px / scroll-padding-right: 0.125rem; / 2px /
scroll-py-0.5scroll-padding-top: 0.125rem; / 2px / scroll-padding-bottom: 0.125rem; / 2px /
scroll-ps-0.5scroll-padding-inline-start: 0.125rem; / 2px /
scroll-pe-0.5scroll-padding-inline-end: 0.125rem; / 2px /
scroll-pt-0.5scroll-padding-top: 0.125rem; / 2px /
scroll-pr-0.5scroll-padding-right: 0.125rem; / 2px /
scroll-pb-0.5scroll-padding-bottom: 0.125rem; / 2px /
scroll-pl-0.5scroll-padding-left: 0.125rem; / 2px /
scroll-p-1scroll-padding: 0.25rem; / 4px /
scroll-px-1scroll-padding-left: 0.25rem; / 4px / scroll-padding-right: 0.25rem; / 4px /
scroll-py-1scroll-padding-top: 0.25rem; / 4px / scroll-padding-bottom: 0.25rem; / 4px /
scroll-ps-1scroll-padding-inline-start: 0.25rem; / 4px /
scroll-pe-1scroll-padding-inline-end: 0.25rem; / 4px /
scroll-pt-1scroll-padding-top: 0.25rem; / 4px /
scroll-pr-1scroll-padding-right: 0.25rem; / 4px /
scroll-pb-1scroll-padding-bottom: 0.25rem; / 4px /
scroll-pl-1scroll-padding-left: 0.25rem; / 4px /
scroll-p-1.5scroll-padding: 0.375rem; / 6px /
scroll-px-1.5scroll-padding-left: 0.375rem; / 6px / scroll-padding-right: 0.375rem; / 6px /
scroll-py-1.5scroll-padding-top: 0.375rem; / 6px / scroll-padding-bottom: 0.375rem; / 6px /
scroll-ps-1.5scroll-padding-inline-start: 0.375rem; / 6px /
scroll-pe-1.5scroll-padding-inline-end: 0.375rem; / 6px /
scroll-pt-1.5scroll-padding-top: 0.375rem; / 6px /
scroll-pr-1.5scroll-padding-right: 0.375rem; / 6px /
scroll-pb-1.5scroll-padding-bottom: 0.375rem; / 6px /
scroll-pl-1.5scroll-padding-left: 0.375rem; / 6px /
scroll-p-2scroll-padding: 0.5rem; / 8px /
scroll-px-2scroll-padding-left: 0.5rem; / 8px / scroll-padding-right: 0.5rem; / 8px /
scroll-py-2scroll-padding-top: 0.5rem; / 8px / scroll-padding-bottom: 0.5rem; / 8px /
scroll-ps-2scroll-padding-inline-start: 0.5rem; / 8px /
scroll-pe-2scroll-padding-inline-end: 0.5rem; / 8px /
scroll-pt-2scroll-padding-top: 0.5rem; / 8px /
scroll-pr-2scroll-padding-right: 0.5rem; / 8px /
scroll-pb-2scroll-padding-bottom: 0.5rem; / 8px /
scroll-pl-2scroll-padding-left: 0.5rem; / 8px /
scroll-p-2.5scroll-padding: 0.625rem; / 10px /
scroll-px-2.5scroll-padding-left: 0.625rem; / 10px / scroll-padding-right: 0.625rem; / 10px /
scroll-py-2.5scroll-padding-top: 0.625rem; / 10px / scroll-padding-bottom: 0.625rem; / 10px /
scroll-ps-2.5scroll-padding-inline-start: 0.625rem; / 10px /
scroll-pe-2.5scroll-padding-inline-end: 0.625rem; / 10px /
scroll-pt-2.5scroll-padding-top: 0.625rem; / 10px /
scroll-pr-2.5scroll-padding-right: 0.625rem; / 10px /
scroll-pb-2.5scroll-padding-bottom: 0.625rem; / 10px /
scroll-pl-2.5scroll-padding-left: 0.625rem; / 10px /
scroll-p-3scroll-padding: 0.75rem; / 12px /
scroll-px-3scroll-padding-left: 0.75rem; / 12px / scroll-padding-right: 0.75rem; / 12px /
scroll-py-3scroll-padding-top: 0.75rem; / 12px / scroll-padding-bottom: 0.75rem; / 12px /
scroll-ps-3scroll-padding-inline-start: 0.75rem; / 12px /
scroll-pe-3scroll-padding-inline-end: 0.75rem; / 12px /
scroll-pt-3scroll-padding-top: 0.75rem; / 12px /
scroll-pr-3scroll-padding-right: 0.75rem; / 12px /
scroll-pb-3scroll-padding-bottom: 0.75rem; / 12px /
scroll-pl-3scroll-padding-left: 0.75rem; / 12px /
scroll-p-3.5scroll-padding: 0.875rem; / 14px /
scroll-px-3.5scroll-padding-left: 0.875rem; / 14px / scroll-padding-right: 0.875rem; / 14px /
scroll-py-3.5scroll-padding-top: 0.875rem; / 14px / scroll-padding-bottom: 0.875rem; / 14px /
scroll-ps-3.5scroll-padding-inline-start: 0.875rem; / 14px /
scroll-pe-3.5scroll-padding-inline-end: 0.875rem; / 14px /
scroll-pt-3.5scroll-padding-top: 0.875rem; / 14px /
scroll-pr-3.5scroll-padding-right: 0.875rem; / 14px /
scroll-pb-3.5scroll-padding-bottom: 0.875rem; / 14px /
scroll-pl-3.5scroll-padding-left: 0.875rem; / 14px /
scroll-p-4scroll-padding: 1rem; / 16px /
scroll-px-4scroll-padding-left: 1rem; / 16px / scroll-padding-right: 1rem; / 16px /
scroll-py-4scroll-padding-top: 1rem; / 16px / scroll-padding-bottom: 1rem; / 16px /
scroll-ps-4scroll-padding-inline-start: 1rem; / 16px /
scroll-pe-4scroll-padding-inline-end: 1rem; / 16px /
scroll-pt-4scroll-padding-top: 1rem; / 16px /
scroll-pr-4scroll-padding-right: 1rem; / 16px /
scroll-pb-4scroll-padding-bottom: 1rem; / 16px /
scroll-pl-4scroll-padding-left: 1rem; / 16px /
scroll-p-5scroll-padding: 1.25rem; / 20px /
scroll-px-5scroll-padding-left: 1.25rem; / 20px / scroll-padding-right: 1.25rem; / 20px /
scroll-py-5scroll-padding-top: 1.25rem; / 20px / scroll-padding-bottom: 1.25rem; / 20px /
scroll-ps-5scroll-padding-inline-start: 1.25rem; / 20px /
scroll-pe-5scroll-padding-inline-end: 1.25rem; / 20px /
scroll-pt-5scroll-padding-top: 1.25rem; / 20px /
scroll-pr-5scroll-padding-right: 1.25rem; / 20px /
scroll-pb-5scroll-padding-bottom: 1.25rem; / 20px /
scroll-pl-5scroll-padding-left: 1.25rem; / 20px /
scroll-p-6scroll-padding: 1.5rem; / 24px /
scroll-px-6scroll-padding-left: 1.5rem; / 24px / scroll-padding-right: 1.5rem; / 24px /
scroll-py-6scroll-padding-top: 1.5rem; / 24px / scroll-padding-bottom: 1.5rem; / 24px /
scroll-ps-6scroll-padding-inline-start: 1.5rem; / 24px /
scroll-pe-6scroll-padding-inline-end: 1.5rem; / 24px /
scroll-pt-6scroll-padding-top: 1.5rem; / 24px /
scroll-pr-6scroll-padding-right: 1.5rem; / 24px /
scroll-pb-6scroll-padding-bottom: 1.5rem; / 24px /
scroll-pl-6scroll-padding-left: 1.5rem; / 24px /
scroll-p-7scroll-padding: 1.75rem; / 28px /
scroll-px-7scroll-padding-left: 1.75rem; / 28px / scroll-padding-right: 1.75rem; / 28px /
scroll-py-7scroll-padding-top: 1.75rem; / 28px / scroll-padding-bottom: 1.75rem; / 28px /
scroll-ps-7scroll-padding-inline-start: 1.75rem; / 28px /
scroll-pe-7scroll-padding-inline-end: 1.75rem; / 28px /
scroll-pt-7scroll-padding-top: 1.75rem; / 28px /
scroll-pr-7scroll-padding-right: 1.75rem; / 28px /
scroll-pb-7scroll-padding-bottom: 1.75rem; / 28px /
scroll-pl-7scroll-padding-left: 1.75rem; / 28px /
scroll-p-8scroll-padding: 2rem; / 32px /
scroll-px-8scroll-padding-left: 2rem; / 32px / scroll-padding-right: 2rem; / 32px /
scroll-py-8scroll-padding-top: 2rem; / 32px / scroll-padding-bottom: 2rem; / 32px /
scroll-ps-8scroll-padding-inline-start: 2rem; / 32px /
scroll-pe-8scroll-padding-inline-end: 2rem; / 32px /
scroll-pt-8scroll-padding-top: 2rem; / 32px /
scroll-pr-8scroll-padding-right: 2rem; / 32px /
scroll-pb-8scroll-padding-bottom: 2rem; / 32px /
scroll-pl-8scroll-padding-left: 2rem; / 32px /
scroll-p-9scroll-padding: 2.25rem; / 36px /
scroll-px-9scroll-padding-left: 2.25rem; / 36px / scroll-padding-right: 2.25rem; / 36px /
scroll-py-9scroll-padding-top: 2.25rem; / 36px / scroll-padding-bottom: 2.25rem; / 36px /
scroll-ps-9scroll-padding-inline-start: 2.25rem; / 36px /
scroll-pe-9scroll-padding-inline-end: 2.25rem; / 36px /
scroll-pt-9scroll-padding-top: 2.25rem; / 36px /
scroll-pr-9scroll-padding-right: 2.25rem; / 36px /
scroll-pb-9scroll-padding-bottom: 2.25rem; / 36px /
scroll-pl-9scroll-padding-left: 2.25rem; / 36px /
scroll-p-10scroll-padding: 2.5rem; / 40px /
scroll-px-10scroll-padding-left: 2.5rem; / 40px / scroll-padding-right: 2.5rem; / 40px /
scroll-py-10scroll-padding-top: 2.5rem; / 40px / scroll-padding-bottom: 2.5rem; / 40px /
scroll-ps-10scroll-padding-inline-start: 2.5rem; / 40px /
scroll-pe-10scroll-padding-inline-end: 2.5rem; / 40px /
scroll-pt-10scroll-padding-top: 2.5rem; / 40px /
scroll-pr-10scroll-padding-right: 2.5rem; / 40px /
scroll-pb-10scroll-padding-bottom: 2.5rem; / 40px /
scroll-pl-10scroll-padding-left: 2.5rem; / 40px /
scroll-p-11scroll-padding: 2.75rem; / 44px /
scroll-px-11scroll-padding-left: 2.75rem; / 44px / scroll-padding-right: 2.75rem; / 44px /
scroll-py-11scroll-padding-top: 2.75rem; / 44px / scroll-padding-bottom: 2.75rem; / 44px /
scroll-ps-11scroll-padding-inline-start: 2.75rem; / 44px /
scroll-pe-11scroll-padding-inline-end: 2.75rem; / 44px /
scroll-pt-11scroll-padding-top: 2.75rem; / 44px /
scroll-pr-11scroll-padding-right: 2.75rem; / 44px /
scroll-pb-11scroll-padding-bottom: 2.75rem; / 44px /
scroll-pl-11scroll-padding-left: 2.75rem; / 44px /
scroll-p-12scroll-padding: 3rem; / 48px /
scroll-px-12scroll-padding-left: 3rem; / 48px / scroll-padding-right: 3rem; / 48px /
scroll-py-12scroll-padding-top: 3rem; / 48px / scroll-padding-bottom: 3rem; / 48px /
scroll-ps-12scroll-padding-inline-start: 3rem; / 48px /
scroll-pe-12scroll-padding-inline-end: 3rem; / 48px /
scroll-pt-12scroll-padding-top: 3rem; / 48px /
scroll-pr-12scroll-padding-right: 3rem; / 48px /
scroll-pb-12scroll-padding-bottom: 3rem; / 48px /
scroll-pl-12scroll-padding-left: 3rem; / 48px /
scroll-p-14scroll-padding: 3.5rem; / 56px /
scroll-px-14scroll-padding-left: 3.5rem; / 56px / scroll-padding-right: 3.5rem; / 56px /
scroll-py-14scroll-padding-top: 3.5rem; / 56px / scroll-padding-bottom: 3.5rem; / 56px /
scroll-ps-14scroll-padding-inline-start: 3.5rem; / 56px /
scroll-pe-14scroll-padding-inline-end: 3.5rem; / 56px /
scroll-pt-14scroll-padding-top: 3.5rem; / 56px /
scroll-pr-14scroll-padding-right: 3.5rem; / 56px /
scroll-pb-14scroll-padding-bottom: 3.5rem; / 56px /
scroll-pl-14scroll-padding-left: 3.5rem; / 56px /
scroll-p-16scroll-padding: 4rem; / 64px /
scroll-px-16scroll-padding-left: 4rem; / 64px / scroll-padding-right: 4rem; / 64px /
scroll-py-16scroll-padding-top: 4rem; / 64px / scroll-padding-bottom: 4rem; / 64px /
scroll-ps-16scroll-padding-inline-start: 4rem; / 64px /
scroll-pe-16scroll-padding-inline-end: 4rem; / 64px /
scroll-pt-16scroll-padding-top: 4rem; / 64px /
scroll-pr-16scroll-padding-right: 4rem; / 64px /
scroll-pb-16scroll-padding-bottom: 4rem; / 64px /
scroll-pl-16scroll-padding-left: 4rem; / 64px /
scroll-p-20scroll-padding: 5rem; / 80px /
scroll-px-20scroll-padding-left: 5rem; / 80px / scroll-padding-right: 5rem; / 80px /
scroll-py-20scroll-padding-top: 5rem; / 80px / scroll-padding-bottom: 5rem; / 80px /
scroll-ps-20scroll-padding-inline-start: 5rem; / 80px /
scroll-pe-20scroll-padding-inline-end: 5rem; / 80px /
scroll-pt-20scroll-padding-top: 5rem; / 80px /
scroll-pr-20scroll-padding-right: 5rem; / 80px /
scroll-pb-20scroll-padding-bottom: 5rem; / 80px /
scroll-pl-20scroll-padding-left: 5rem; / 80px /
scroll-p-24scroll-padding: 6rem; / 96px /
scroll-px-24scroll-padding-left: 6rem; / 96px / scroll-padding-right: 6rem; / 96px /
scroll-py-24scroll-padding-top: 6rem; / 96px / scroll-padding-bottom: 6rem; / 96px /
scroll-ps-24scroll-padding-inline-start: 6rem; / 96px /
scroll-pe-24scroll-padding-inline-end: 6rem; / 96px /
scroll-pt-24scroll-padding-top: 6rem; / 96px /
scroll-pr-24scroll-padding-right: 6rem; / 96px /
scroll-pb-24scroll-padding-bottom: 6rem; / 96px /
scroll-pl-24scroll-padding-left: 6rem; / 96px /
scroll-p-28scroll-padding: 7rem; / 112px /
scroll-px-28scroll-padding-left: 7rem; / 112px / scroll-padding-right: 7rem; / 112px /
scroll-py-28scroll-padding-top: 7rem; / 112px / scroll-padding-bottom: 7rem; / 112px /
scroll-ps-28scroll-padding-inline-start: 7rem; / 112px /
scroll-pe-28scroll-padding-inline-end: 7rem; / 112px /
scroll-pt-28scroll-padding-top: 7rem; / 112px /
scroll-pr-28scroll-padding-right: 7rem; / 112px /
scroll-pb-28scroll-padding-bottom: 7rem; / 112px /
scroll-pl-28scroll-padding-left: 7rem; / 112px /
scroll-p-32scroll-padding: 8rem; / 128px /
scroll-px-32scroll-padding-left: 8rem; / 128px / scroll-padding-right: 8rem; / 128px /
scroll-py-32scroll-padding-top: 8rem; / 128px / scroll-padding-bottom: 8rem; / 128px /
scroll-ps-32scroll-padding-inline-start: 8rem; / 128px /
scroll-pe-32scroll-padding-inline-end: 8rem; / 128px /
scroll-pt-32scroll-padding-top: 8rem; / 128px /
scroll-pr-32scroll-padding-right: 8rem; / 128px /
scroll-pb-32scroll-padding-bottom: 8rem; / 128px /
scroll-pl-32scroll-padding-left: 8rem; / 128px /
scroll-p-36scroll-padding: 9rem; / 144px /
scroll-px-36scroll-padding-left: 9rem; / 144px / scroll-padding-right: 9rem; / 144px /
scroll-py-36scroll-padding-top: 9rem; / 144px / scroll-padding-bottom: 9rem; / 144px /
scroll-ps-36scroll-padding-inline-start: 9rem; / 144px /
scroll-pe-36scroll-padding-inline-end: 9rem; / 144px /
scroll-pt-36scroll-padding-top: 9rem; / 144px /
scroll-pr-36scroll-padding-right: 9rem; / 144px /
scroll-pb-36scroll-padding-bottom: 9rem; / 144px /
scroll-pl-36scroll-padding-left: 9rem; / 144px /
scroll-p-40scroll-padding: 10rem; / 160px /
scroll-px-40scroll-padding-left: 10rem; / 160px / scroll-padding-right: 10rem; / 160px /
scroll-py-40scroll-padding-top: 10rem; / 160px / scroll-padding-bottom: 10rem; / 160px /
scroll-ps-40scroll-padding-inline-start: 10rem; / 160px /
scroll-pe-40scroll-padding-inline-end: 10rem; / 160px /
scroll-pt-40scroll-padding-top: 10rem; / 160px /
scroll-pr-40scroll-padding-right: 10rem; / 160px /
scroll-pb-40scroll-padding-bottom: 10rem; / 160px /
scroll-pl-40scroll-padding-left: 10rem; / 160px /
scroll-p-44scroll-padding: 11rem; / 176px /
scroll-px-44scroll-padding-left: 11rem; / 176px / scroll-padding-right: 11rem; / 176px /
scroll-py-44scroll-padding-top: 11rem; / 176px / scroll-padding-bottom: 11rem; / 176px /
scroll-ps-44scroll-padding-inline-start: 11rem; / 176px /
scroll-pe-44scroll-padding-inline-end: 11rem; / 176px /
scroll-pt-44scroll-padding-top: 11rem; / 176px /
scroll-pr-44scroll-padding-right: 11rem; / 176px /
scroll-pb-44scroll-padding-bottom: 11rem; / 176px /
scroll-pl-44scroll-padding-left: 11rem; / 176px /
scroll-p-48scroll-padding: 12rem; / 192px /
scroll-px-48scroll-padding-left: 12rem; / 192px / scroll-padding-right: 12rem; / 192px /
scroll-py-48scroll-padding-top: 12rem; / 192px / scroll-padding-bottom: 12rem; / 192px /
scroll-ps-48scroll-padding-inline-start: 12rem; / 192px /
scroll-pe-48scroll-padding-inline-end: 12rem; / 192px /
scroll-pt-48scroll-padding-top: 12rem; / 192px /
scroll-pr-48scroll-padding-right: 12rem; / 192px /
scroll-pb-48scroll-padding-bottom: 12rem; / 192px /
scroll-pl-48scroll-padding-left: 12rem; / 192px /
scroll-p-52scroll-padding: 13rem; / 208px /
scroll-px-52scroll-padding-left: 13rem; / 208px / scroll-padding-right: 13rem; / 208px /
scroll-py-52scroll-padding-top: 13rem; / 208px / scroll-padding-bottom: 13rem; / 208px /
scroll-ps-52scroll-padding-inline-start: 13rem; / 208px /
scroll-pe-52scroll-padding-inline-end: 13rem; / 208px /
scroll-pt-52scroll-padding-top: 13rem; / 208px /
scroll-pr-52scroll-padding-right: 13rem; / 208px /
scroll-pb-52scroll-padding-bottom: 13rem; / 208px /
scroll-pl-52scroll-padding-left: 13rem; / 208px /
scroll-p-56scroll-padding: 14rem; / 224px /
scroll-px-56scroll-padding-left: 14rem; / 224px / scroll-padding-right: 14rem; / 224px /
scroll-py-56scroll-padding-top: 14rem; / 224px / scroll-padding-bottom: 14rem; / 224px /
scroll-ps-56scroll-padding-inline-start: 14rem; / 224px /
scroll-pe-56scroll-padding-inline-end: 14rem; / 224px /
scroll-pt-56scroll-padding-top: 14rem; / 224px /
scroll-pr-56scroll-padding-right: 14rem; / 224px /
scroll-pb-56scroll-padding-bottom: 14rem; / 224px /
scroll-pl-56scroll-padding-left: 14rem; / 224px /
scroll-p-60scroll-padding: 15rem; / 240px /
scroll-px-60scroll-padding-left: 15rem; / 240px / scroll-padding-right: 15rem; / 240px /
scroll-py-60scroll-padding-top: 15rem; / 240px / scroll-padding-bottom: 15rem; / 240px /
scroll-ps-60scroll-padding-inline-start: 15rem; / 240px /
scroll-pe-60scroll-padding-inline-end: 15rem; / 240px /
scroll-pt-60scroll-padding-top: 15rem; / 240px /
scroll-pr-60scroll-padding-right: 15rem; / 240px /
scroll-pb-60scroll-padding-bottom: 15rem; / 240px /
scroll-pl-60scroll-padding-left: 15rem; / 240px /
scroll-p-64scroll-padding: 16rem; / 256px /
scroll-px-64scroll-padding-left: 16rem; / 256px / scroll-padding-right: 16rem; / 256px /
scroll-py-64scroll-padding-top: 16rem; / 256px / scroll-padding-bottom: 16rem; / 256px /
scroll-ps-64scroll-padding-inline-start: 16rem; / 256px /
scroll-pe-64scroll-padding-inline-end: 16rem; / 256px /
scroll-pt-64scroll-padding-top: 16rem; / 256px /
scroll-pr-64scroll-padding-right: 16rem; / 256px /
scroll-pb-64scroll-padding-bottom: 16rem; / 256px /
scroll-pl-64scroll-padding-left: 16rem; / 256px /
scroll-p-72scroll-padding: 18rem; / 288px /
scroll-px-72scroll-padding-left: 18rem; / 288px / scroll-padding-right: 18rem; / 288px /
scroll-py-72scroll-padding-top: 18rem; / 288px / scroll-padding-bottom: 18rem; / 288px /
scroll-ps-72scroll-padding-inline-start: 18rem; / 288px /
scroll-pe-72scroll-padding-inline-end: 18rem; / 288px /
scroll-pt-72scroll-padding-top: 18rem; / 288px /
scroll-pr-72scroll-padding-right: 18rem; / 288px /
scroll-pb-72scroll-padding-bottom: 18rem; / 288px /
scroll-pl-72scroll-padding-left: 18rem; / 288px /
scroll-p-80scroll-padding: 20rem; / 320px /
scroll-px-80scroll-padding-left: 20rem; / 320px / scroll-padding-right: 20rem; / 320px /
scroll-py-80scroll-padding-top: 20rem; / 320px / scroll-padding-bottom: 20rem; / 320px /
scroll-ps-80scroll-padding-inline-start: 20rem; / 320px /
scroll-pe-80scroll-padding-inline-end: 20rem; / 320px /
scroll-pt-80scroll-padding-top: 20rem; / 320px /
scroll-pr-80scroll-padding-right: 20rem; / 320px /
scroll-pb-80scroll-padding-bottom: 20rem; / 320px /
scroll-pl-80scroll-padding-left: 20rem; / 320px /
scroll-p-96scroll-padding: 24rem; / 384px /
scroll-px-96scroll-padding-left: 24rem; / 384px / scroll-padding-right: 24rem; / 384px /
scroll-py-96scroll-padding-top: 24rem; / 384px / scroll-padding-bottom: 24rem; / 384px /
scroll-ps-96scroll-padding-inline-start: 24rem; / 384px /
scroll-pe-96scroll-padding-inline-end: 24rem; / 384px /
scroll-pt-96scroll-padding-top: 24rem; / 384px /
scroll-pr-96scroll-padding-right: 24rem; / 384px /
scroll-pb-96scroll-padding-bottom: 24rem; / 384px /
scroll-pl-96scroll-padding-left: 24rem; / 384px /

Show all classes

Basic usage

Setting the scroll padding

Use the scroll-p{side}-{size} utilities to set the scroll offset of an element within a snap container.

Scroll Padding - 图1

Scroll in the grid of images to see the expected behaviour

Scroll Padding - 图2

  1. <div class="scroll-pl-6 snap-x ...">
  2. <div class="snap-start ...">
  3. <img src="https://images.unsplash.com/photo-1604999565976-8913ad2ddb7c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=320&h=160&q=80" />
  4. </div>
  5. <div class="snap-start ...">
  6. <img src="https://images.unsplash.com/photo-1540206351-d6465b3ac5c1?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=320&h=160&q=80" />
  7. </div>
  8. <div class="snap-start ...">
  9. <img src="https://images.unsplash.com/photo-1622890806166-111d7f6c7c97?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=320&h=160&q=80" />
  10. </div>
  11. <div class="snap-start ...">
  12. <img src="https://images.unsplash.com/photo-1590523277543-a94d2e4eb00b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=320&h=160&q=80" />
  13. </div>
  14. <div class="snap-start ...">
  15. <img src="https://images.unsplash.com/photo-1575424909138-46b05e5919ec?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=320&h=160&q=80" />
  16. </div>
  17. </div>

Using logical properties

Use the scroll-ps-* and scroll-pe-* utilities to set the scroll-padding-inline-start and scroll-padding-inline-end logical properties, which map to either the left or right side based on the text direction.

Scroll Padding - 图3

Scroll in the grid of images to see the expected behaviour

Scroll Padding - 图4

  1. <div dir="ltr">
  2. <div class="scroll-ps-6 snap-x ...">
  3. <!-- ... -->
  4. </div>
  5. </div>
  6. <div dir="rtl">
  7. <div class="scroll-ps-6 snap-x ...">
  8. <!-- ... -->
  9. </div>
  10. </div>

For more control, you can also use the LTR and RTL modifiers to conditionally apply specific styles depending on the current text direction.


Applying conditionally

Hover, focus, and other states

Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:scroll-p-0 to only apply the scroll-p-0 utility on hover.

  1. <div class="scroll-p-8 hover:scroll-p-0">
  2. <!-- ... -->
  3. </div>

For a complete list of all available state modifiers, check out the Hover, Focus, & Other States documentation.

Breakpoints and media queries

You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:scroll-p-0 to apply the scroll-p-0 utility at only medium screen sizes and above.

  1. <div class="scroll-p-8 md:scroll-p-0">
  2. <!-- ... -->
  3. </div>

To learn more, check out the documentation on Responsive Design, Dark Mode and other media query modifiers.


Using custom values

Customizing your theme

By default, Tailwind’s scroll padding scale uses the default spacing scale. You can customize your spacing scale by editing theme.spacing or theme.extend.spacing in your tailwind.config.js file.

tailwind.config.js

  1. module.exports = {
  2. theme: {
  3. extend: {
  4. spacing: {
  5. '96': '24rem',
  6. }
  7. }
  8. }
  9. }

Alternatively, you can customize just the scroll padding scale by editing theme.scrollPadding or theme.extend.scrollPadding in your tailwind.config.js file.

tailwind.config.js

  1. module.exports = {
  2. theme: {
  3. extend: {
  4. scrollPadding: {
  5. '96': '24rem',
  6. },
  7. }
  8. }
  9. }

Learn more about customizing the default theme in the theme customization documentation.

Arbitrary values

If you need to use a one-off scroll-padding value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value.

  1. <div class="scroll-p-[24rem]">
  2. <!-- ... -->
  3. </div>

Learn more about arbitrary value support in the arbitrary values documentation.