Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tailwindcss-scroll-snap

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-scroll-snap

A Tailwind CSS plugin that adds `scroll-snap` utilities.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Scroll Snap

GitHub release (latest SemVer including pre-releases)   npm   npm

Introduction

tailwindcss-scroll-snap adds CSS Scroll Snap utilities to Tailwind CSS.

It makes use of CSS custom properties by default in order to make composable utilities for Scroll Snap Types, but you can override the scrollSnapType key in your Tailwind config if you don't want to use CSS custom properties.

Get started:

$ yarn add tailwindcss-scroll-snap --dev

After installing the NPM package, add it to the plugins part of tailwind.config.js.

module.exports = {
	theme: {},
	variants: {
		// Add variants as needed
		scrollSnapType: ['responsive'],
	},
	plugins: [require('tailwindcss-scroll-snap')],
};

Usage

This plugin creates utilities for scroll-snap-align, scroll-snap-type, scroll-snap-stop, scroll-margin and scroll-padding. Each of them can be used with variants.

Align

Utilities for the scroll-snap-align property.

ClassProperty
.snap-startscroll-snap-align: start;
.snap-endscroll-snap-align: end;
.snap-centerscroll-snap-align: center;

You can override scrollSnapAlign in the theme of the Tailwind configuration if you want to change them.

Type

Utilities for the scroll-snap-type property.

ClassProperty
.no-snap.scroll-snap-type: none;
.snap.scroll-snap-type: var(--scroll-snap-direction, both) var(--scroll-snap-constraint, mandatory)
.snap-x--scroll-snap-direction: x;
.snap-y--scroll-snap-direction: y;
.snap-both--scroll-snap-direction: both;
.snap-block--scroll-snap-direction: block;
.snap-inline--scroll-snap-direction: inline;
.snap-mandatory--scroll-snap-constraint: mandatory;
.snap-proximity--scroll-snap-constraint: proximity;

These utilities work with composition. Except .no-snap, you need to combine them. If you're not happy with the way it works, you can override scrollSnapType in the theme of the Tailwind configuration.

<section class="snap snap-y snap-mandatory">
	<!-- ... -->
</section>

A configuration for variable-less scroll-snap-type utilities could look like that:

{
    'no-snap': 'none',
    'snap-y-mandatory': 'y mandatory',
    'snap-y-proximity': 'y proximity',
}

It is recommended that in the case where you need to override the configuration, you only add utilities you plan on actually using.

Stop

Utilities for the scroll-snap-stop property.

ClassProperty
.always-stopscroll-snap-stop: always;

You can override scrollSnapStop in the theme of the Tailwind configuration if you want to change them.

Margin

Utilities for the scroll-margin property.

See the default list.
ClassProperty
.snap-m-0scroll-margin: 0;
.snap-m-1scroll-margin: 0.25rem;
.snap-m-2scroll-margin: 0.5rem;
.snap-m-3scroll-margin: 0.75rem;
.snap-m-4scroll-margin: 1rem;
.snap-m-5scroll-margin: 1.25rem;
.snap-m-6scroll-margin: 1.5rem;
.snap-m-8scroll-margin: 2rem;
.snap-m-10scroll-margin: 2.5rem;
.snap-m-12scroll-margin: 3rem;
.snap-m-16scroll-margin: 4rem;
.snap-m-20scroll-margin: 5rem;
.snap-m-24scroll-margin: 6rem;
.snap-m-32scroll-margin: 8rem;
.snap-m-40scroll-margin: 10rem;
.snap-m-48scroll-margin: 12rem;
.snap-m-56scroll-margin: 14rem;
.snap-m-64scroll-margin: 16rem;
.snap-m-autoscroll-margin: auto;
.snap-m-pxscroll-margin: 1px;
.-snap-m-1scroll-margin: -0.25rem;
.-snap-m-2scroll-margin: -0.5rem;
.-snap-m-3scroll-margin: -0.75rem;
.-snap-m-4scroll-margin: -1rem;
.-snap-m-5scroll-margin: -1.25rem;
.-snap-m-6scroll-margin: -1.5rem;
.-snap-m-8scroll-margin: -2rem;
.-snap-m-10scroll-margin: -2.5rem;
.-snap-m-12scroll-margin: -3rem;
.-snap-m-16scroll-margin: -4rem;
.-snap-m-20scroll-margin: -5rem;
.-snap-m-24scroll-margin: -6rem;
.-snap-m-32scroll-margin: -8rem;
.-snap-m-40scroll-margin: -10rem;
.-snap-m-48scroll-margin: -12rem;
.-snap-m-56scroll-margin: -14rem;
.-snap-m-64scroll-margin: -16rem;
.-snap-m-pxscroll-margin: -1px;
.snap-my-0scroll-margin-top: 0; scroll-margin-bottom: 0;
.snap-mx-0scroll-margin-left: 0; scroll-margin-right: 0;
.snap-my-1scroll-margin-top: 0.25rem; scroll-margin-bottom: 0.25rem;
.snap-mx-1scroll-margin-left: 0.25rem; scroll-margin-right: 0.25rem;
.snap-my-2scroll-margin-top: 0.5rem; scroll-margin-bottom: 0.5rem;
.snap-mx-2scroll-margin-left: 0.5rem; scroll-margin-right: 0.5rem;
.snap-my-3scroll-margin-top: 0.75rem; scroll-margin-bottom: 0.75rem;
.snap-mx-3scroll-margin-left: 0.75rem; scroll-margin-right: 0.75rem;
.snap-my-4scroll-margin-top: 1rem; scroll-margin-bottom: 1rem;
.snap-mx-4scroll-margin-left: 1rem; scroll-margin-right: 1rem;
.snap-my-5scroll-margin-top: 1.25rem; scroll-margin-bottom: 1.25rem;
.snap-mx-5scroll-margin-left: 1.25rem; scroll-margin-right: 1.25rem;
.snap-my-6scroll-margin-top: 1.5rem; scroll-margin-bottom: 1.5rem;
.snap-mx-6scroll-margin-left: 1.5rem; scroll-margin-right: 1.5rem;
.snap-my-8scroll-margin-top: 2rem; scroll-margin-bottom: 2rem;
.snap-mx-8scroll-margin-left: 2rem; scroll-margin-right: 2rem;
.snap-my-10scroll-margin-top: 2.5rem; scroll-margin-bottom: 2.5rem;
.snap-mx-10scroll-margin-left: 2.5rem; scroll-margin-right: 2.5rem;
.snap-my-12scroll-margin-top: 3rem; scroll-margin-bottom: 3rem;
.snap-mx-12scroll-margin-left: 3rem; scroll-margin-right: 3rem;
.snap-my-16scroll-margin-top: 4rem; scroll-margin-bottom: 4rem;
.snap-mx-16scroll-margin-left: 4rem; scroll-margin-right: 4rem;
.snap-my-20scroll-margin-top: 5rem; scroll-margin-bottom: 5rem;
.snap-mx-20scroll-margin-left: 5rem; scroll-margin-right: 5rem;
.snap-my-24scroll-margin-top: 6rem; scroll-margin-bottom: 6rem;
.snap-mx-24scroll-margin-left: 6rem; scroll-margin-right: 6rem;
.snap-my-32scroll-margin-top: 8rem; scroll-margin-bottom: 8rem;
.snap-mx-32scroll-margin-left: 8rem; scroll-margin-right: 8rem;
.snap-my-40scroll-margin-top: 10rem; scroll-margin-bottom: 10rem;
.snap-mx-40scroll-margin-left: 10rem; scroll-margin-right: 10rem;
.snap-my-48scroll-margin-top: 12rem; scroll-margin-bottom: 12rem;
.snap-mx-48scroll-margin-left: 12rem; scroll-margin-right: 12rem;
.snap-my-56scroll-margin-top: 14rem; scroll-margin-bottom: 14rem;
.snap-mx-56scroll-margin-left: 14rem; scroll-margin-right: 14rem;
.snap-my-64scroll-margin-top: 16rem; scroll-margin-bottom: 16rem;
.snap-mx-64scroll-margin-left: 16rem; scroll-margin-right: 16rem;
.snap-my-autoscroll-margin-top: auto; scroll-margin-bottom: auto;
.snap-mx-autoscroll-margin-left: auto; scroll-margin-right: auto;
.snap-my-pxscroll-margin-top: 1px; scroll-margin-bottom: 1px;
.snap-mx-pxscroll-margin-left: 1px; scroll-margin-right: 1px;
.-snap-my-1scroll-margin-top: -0.25rem; scroll-margin-bottom: -0.25rem;
.-snap-mx-1scroll-margin-left: -0.25rem; scroll-margin-right: -0.25rem;
.-snap-my-2scroll-margin-top: -0.5rem; scroll-margin-bottom: -0.5rem;
.-snap-mx-2scroll-margin-left: -0.5rem; scroll-margin-right: -0.5rem;
.-snap-my-3scroll-margin-top: -0.75rem; scroll-margin-bottom: -0.75rem;
.-snap-mx-3scroll-margin-left: -0.75rem; scroll-margin-right: -0.75rem;
.-snap-my-4scroll-margin-top: -1rem; scroll-margin-bottom: -1rem;
.-snap-mx-4scroll-margin-left: -1rem; scroll-margin-right: -1rem;
.-snap-my-5scroll-margin-top: -1.25rem; scroll-margin-bottom: -1.25rem;
.-snap-mx-5scroll-margin-left: -1.25rem; scroll-margin-right: -1.25rem;
.-snap-my-6scroll-margin-top: -1.5rem; scroll-margin-bottom: -1.5rem;
.-snap-mx-6scroll-margin-left: -1.5rem; scroll-margin-right: -1.5rem;
.-snap-my-8scroll-margin-top: -2rem; scroll-margin-bottom: -2rem;
.-snap-mx-8scroll-margin-left: -2rem; scroll-margin-right: -2rem;
.-snap-my-10scroll-margin-top: -2.5rem; scroll-margin-bottom: -2.5rem;
.-snap-mx-10scroll-margin-left: -2.5rem; scroll-margin-right: -2.5rem;
.-snap-my-12scroll-margin-top: -3rem; scroll-margin-bottom: -3rem;
.-snap-mx-12scroll-margin-left: -3rem; scroll-margin-right: -3rem;
.-snap-my-16scroll-margin-top: -4rem; scroll-margin-bottom: -4rem;
.-snap-mx-16scroll-margin-left: -4rem; scroll-margin-right: -4rem;
.-snap-my-20scroll-margin-top: -5rem; scroll-margin-bottom: -5rem;
.-snap-mx-20scroll-margin-left: -5rem; scroll-margin-right: -5rem;
.-snap-my-24scroll-margin-top: -6rem; scroll-margin-bottom: -6rem;
.-snap-mx-24scroll-margin-left: -6rem; scroll-margin-right: -6rem;
.-snap-my-32scroll-margin-top: -8rem; scroll-margin-bottom: -8rem;
.-snap-mx-32scroll-margin-left: -8rem; scroll-margin-right: -8rem;
.-snap-my-40scroll-margin-top: -10rem; scroll-margin-bottom: -10rem;
.-snap-mx-40scroll-margin-left: -10rem; scroll-margin-right: -10rem;
.-snap-my-48scroll-margin-top: -12rem; scroll-margin-bottom: -12rem;
.-snap-mx-48scroll-margin-left: -12rem; scroll-margin-right: -12rem;
.-snap-my-56scroll-margin-top: -14rem; scroll-margin-bottom: -14rem;
.-snap-mx-56scroll-margin-left: -14rem; scroll-margin-right: -14rem;
.-snap-my-64scroll-margin-top: -16rem; scroll-margin-bottom: -16rem;
.-snap-mx-64scroll-margin-left: -16rem; scroll-margin-right: -16rem;
.-snap-my-pxscroll-margin-top: -1px; scroll-margin-bottom: -1px;
.-snap-mx-pxscroll-margin-left: -1px; scroll-margin-right: -1px;
.snap-mt-0scroll-margin-top: 0;
.snap-mr-0scroll-margin-right: 0;
.snap-mb-0scroll-margin-bottom: 0;
.snap-ml-0scroll-margin-left: 0;
.snap-mt-1scroll-margin-top: 0.25rem;
.snap-mr-1scroll-margin-right: 0.25rem;
.snap-mb-1scroll-margin-bottom: 0.25rem;
.snap-ml-1scroll-margin-left: 0.25rem;
.snap-mt-2scroll-margin-top: 0.5rem;
.snap-mr-2scroll-margin-right: 0.5rem;
.snap-mb-2scroll-margin-bottom: 0.5rem;
.snap-ml-2scroll-margin-left: 0.5rem;
.snap-mt-3scroll-margin-top: 0.75rem;
.snap-mr-3scroll-margin-right: 0.75rem;
.snap-mb-3scroll-margin-bottom: 0.75rem;
.snap-ml-3scroll-margin-left: 0.75rem;
.snap-mt-4scroll-margin-top: 1rem;
.snap-mr-4scroll-margin-right: 1rem;
.snap-mb-4scroll-margin-bottom: 1rem;
.snap-ml-4scroll-margin-left: 1rem;
.snap-mt-5scroll-margin-top: 1.25rem;
.snap-mr-5scroll-margin-right: 1.25rem;
.snap-mb-5scroll-margin-bottom: 1.25rem;
.snap-ml-5scroll-margin-left: 1.25rem;
.snap-mt-6scroll-margin-top: 1.5rem;
.snap-mr-6scroll-margin-right: 1.5rem;
.snap-mb-6scroll-margin-bottom: 1.5rem;
.snap-ml-6scroll-margin-left: 1.5rem;
.snap-mt-8scroll-margin-top: 2rem;
.snap-mr-8scroll-margin-right: 2rem;
.snap-mb-8scroll-margin-bottom: 2rem;
.snap-ml-8scroll-margin-left: 2rem;
.snap-mt-10scroll-margin-top: 2.5rem;
.snap-mr-10scroll-margin-right: 2.5rem;
.snap-mb-10scroll-margin-bottom: 2.5rem;
.snap-ml-10scroll-margin-left: 2.5rem;
.snap-mt-12scroll-margin-top: 3rem;
.snap-mr-12scroll-margin-right: 3rem;
.snap-mb-12scroll-margin-bottom: 3rem;
.snap-ml-12scroll-margin-left: 3rem;
.snap-mt-16scroll-margin-top: 4rem;
.snap-mr-16scroll-margin-right: 4rem;
.snap-mb-16scroll-margin-bottom: 4rem;
.snap-ml-16scroll-margin-left: 4rem;
.snap-mt-20scroll-margin-top: 5rem;
.snap-mr-20scroll-margin-right: 5rem;
.snap-mb-20scroll-margin-bottom: 5rem;
.snap-ml-20scroll-margin-left: 5rem;
.snap-mt-24scroll-margin-top: 6rem;
.snap-mr-24scroll-margin-right: 6rem;
.snap-mb-24scroll-margin-bottom: 6rem;
.snap-ml-24scroll-margin-left: 6rem;
.snap-mt-32scroll-margin-top: 8rem;
.snap-mr-32scroll-margin-right: 8rem;
.snap-mb-32scroll-margin-bottom: 8rem;
.snap-ml-32scroll-margin-left: 8rem;
.snap-mt-40scroll-margin-top: 10rem;
.snap-mr-40scroll-margin-right: 10rem;
.snap-mb-40scroll-margin-bottom: 10rem;
.snap-ml-40scroll-margin-left: 10rem;
.snap-mt-48scroll-margin-top: 12rem;
.snap-mr-48scroll-margin-right: 12rem;
.snap-mb-48scroll-margin-bottom: 12rem;
.snap-ml-48scroll-margin-left: 12rem;
.snap-mt-56scroll-margin-top: 14rem;
.snap-mr-56scroll-margin-right: 14rem;
.snap-mb-56scroll-margin-bottom: 14rem;
.snap-ml-56scroll-margin-left: 14rem;
.snap-mt-64scroll-margin-top: 16rem;
.snap-mr-64scroll-margin-right: 16rem;
.snap-mb-64scroll-margin-bottom: 16rem;
.snap-ml-64scroll-margin-left: 16rem;
.snap-mt-autoscroll-margin-top: auto;
.snap-mr-autoscroll-margin-right: auto;
.snap-mb-autoscroll-margin-bottom: auto;
.snap-ml-autoscroll-margin-left: auto;
.snap-mt-pxscroll-margin-top: 1px;
.snap-mr-pxscroll-margin-right: 1px;
.snap-mb-pxscroll-margin-bottom: 1px;
.snap-ml-pxscroll-margin-left: 1px;
.-snap-mt-1scroll-margin-top: -0.25rem;
.-snap-mr-1scroll-margin-right: -0.25rem;
.-snap-mb-1scroll-margin-bottom: -0.25rem;
.-snap-ml-1scroll-margin-left: -0.25rem;
.-snap-mt-2scroll-margin-top: -0.5rem;
.-snap-mr-2scroll-margin-right: -0.5rem;
.-snap-mb-2scroll-margin-bottom: -0.5rem;
.-snap-ml-2scroll-margin-left: -0.5rem;
.-snap-mt-3scroll-margin-top: -0.75rem;
.-snap-mr-3scroll-margin-right: -0.75rem;
.-snap-mb-3scroll-margin-bottom: -0.75rem;
.-snap-ml-3scroll-margin-left: -0.75rem;
.-snap-mt-4scroll-margin-top: -1rem;
.-snap-mr-4scroll-margin-right: -1rem;
.-snap-mb-4scroll-margin-bottom: -1rem;
.-snap-ml-4scroll-margin-left: -1rem;
.-snap-mt-5scroll-margin-top: -1.25rem;
.-snap-mr-5scroll-margin-right: -1.25rem;
.-snap-mb-5scroll-margin-bottom: -1.25rem;
.-snap-ml-5scroll-margin-left: -1.25rem;
.-snap-mt-6scroll-margin-top: -1.5rem;
.-snap-mr-6scroll-margin-right: -1.5rem;
.-snap-mb-6scroll-margin-bottom: -1.5rem;
.-snap-ml-6scroll-margin-left: -1.5rem;
.-snap-mt-8scroll-margin-top: -2rem;
.-snap-mr-8scroll-margin-right: -2rem;
.-snap-mb-8scroll-margin-bottom: -2rem;
.-snap-ml-8scroll-margin-left: -2rem;
.-snap-mt-10scroll-margin-top: -2.5rem;
.-snap-mr-10scroll-margin-right: -2.5rem;
.-snap-mb-10scroll-margin-bottom: -2.5rem;
.-snap-ml-10scroll-margin-left: -2.5rem;
.-snap-mt-12scroll-margin-top: -3rem;
.-snap-mr-12scroll-margin-right: -3rem;
.-snap-mb-12scroll-margin-bottom: -3rem;
.-snap-ml-12scroll-margin-left: -3rem;
.-snap-mt-16scroll-margin-top: -4rem;
.-snap-mr-16scroll-margin-right: -4rem;
.-snap-mb-16scroll-margin-bottom: -4rem;
.-snap-ml-16scroll-margin-left: -4rem;
.-snap-mt-20scroll-margin-top: -5rem;
.-snap-mr-20scroll-margin-right: -5rem;
.-snap-mb-20scroll-margin-bottom: -5rem;
.-snap-ml-20scroll-margin-left: -5rem;
.-snap-mt-24scroll-margin-top: -6rem;
.-snap-mr-24scroll-margin-right: -6rem;
.-snap-mb-24scroll-margin-bottom: -6rem;
.-snap-ml-24scroll-margin-left: -6rem;
.-snap-mt-32scroll-margin-top: -8rem;
.-snap-mr-32scroll-margin-right: -8rem;
.-snap-mb-32scroll-margin-bottom: -8rem;
.-snap-ml-32scroll-margin-left: -8rem;
.-snap-mt-40scroll-margin-top: -10rem;
.-snap-mr-40scroll-margin-right: -10rem;
.-snap-mb-40scroll-margin-bottom: -10rem;
.-snap-ml-40scroll-margin-left: -10rem;
.-snap-mt-48scroll-margin-top: -12rem;
.-snap-mr-48scroll-margin-right: -12rem;
.-snap-mb-48scroll-margin-bottom: -12rem;
.-snap-ml-48scroll-margin-left: -12rem;
.-snap-mt-56scroll-margin-top: -14rem;
.-snap-mr-56scroll-margin-right: -14rem;
.-snap-mb-56scroll-margin-bottom: -14rem;
.-snap-ml-56scroll-margin-left: -14rem;
.-snap-mt-64scroll-margin-top: -16rem;
.-snap-mr-64scroll-margin-right: -16rem;
.-snap-mb-64scroll-margin-bottom: -16rem;
.-snap-ml-64scroll-margin-left: -16rem;
.-snap-mt-pxscroll-margin-top: -1px;
.-snap-mr-pxscroll-margin-right: -1px;
.-snap-mb-pxscroll-margin-bottom: -1px;
.-snap-ml-pxscroll-margin-left: -1px ;

The default values are inherited from your theme's spacing values, negative values included, just like margin.

Also like margin, you can override them your Tailwind theme configuration under the scrollMargin key.

Padding

Utilities for the scroll-padding property.

See the default list.
ClassProperty
.snap-p-0scroll-padding: 0;
.snap-p-1scroll-padding: 0.25rem;
.snap-p-2scroll-padding: 0.5rem;
.snap-p-3scroll-padding: 0.75rem;
.snap-p-4scroll-padding: 1rem;
.snap-p-5scroll-padding: 1.25rem;
.snap-p-6scroll-padding: 1.5rem;
.snap-p-8scroll-padding: 2rem;
.snap-p-10scroll-padding: 2.5rem;
.snap-p-12scroll-padding: 3rem;
.snap-p-16scroll-padding: 4rem;
.snap-p-20scroll-padding: 5rem;
.snap-p-24scroll-padding: 6rem;
.snap-p-32scroll-padding: 8rem;
.snap-p-40scroll-padding: 10rem;
.snap-p-48scroll-padding: 12rem;
.snap-p-56scroll-padding: 14rem;
.snap-p-64scroll-padding: 16rem;
.snap-p-pxscroll-padding: 1px;
.snap-py-0scroll-padding-top: 0; scroll-padding-bottom: 0;
.snap-px-0scroll-padding-left: 0; scroll-padding-right: 0;
.snap-py-1scroll-padding-top: 0.25rem; scroll-padding-bottom: 0.25rem;
.snap-px-1scroll-padding-left: 0.25rem; scroll-padding-right: 0.25rem;
.snap-py-2scroll-padding-top: 0.5rem; scroll-padding-bottom: 0.5rem;
.snap-px-2scroll-padding-left: 0.5rem; scroll-padding-right: 0.5rem;
.snap-py-3scroll-padding-top: 0.75rem; scroll-padding-bottom: 0.75rem;
.snap-px-3scroll-padding-left: 0.75rem; scroll-padding-right: 0.75rem;
.snap-py-4scroll-padding-top: 1rem; scroll-padding-bottom: 1rem;
.snap-px-4scroll-padding-left: 1rem; scroll-padding-right: 1rem;
.snap-py-5scroll-padding-top: 1.25rem; scroll-padding-bottom: 1.25rem;
.snap-px-5scroll-padding-left: 1.25rem; scroll-padding-right: 1.25rem;
.snap-py-6scroll-padding-top: 1.5rem; scroll-padding-bottom: 1.5rem;
.snap-px-6scroll-padding-left: 1.5rem; scroll-padding-right: 1.5rem;
.snap-py-8scroll-padding-top: 2rem; scroll-padding-bottom: 2rem;
.snap-px-8scroll-padding-left: 2rem; scroll-padding-right: 2rem;
.snap-py-10scroll-padding-top: 2.5rem; scroll-padding-bottom: 2.5rem;
.snap-px-10scroll-padding-left: 2.5rem; scroll-padding-right: 2.5rem;
.snap-py-12scroll-padding-top: 3rem; scroll-padding-bottom: 3rem;
.snap-px-12scroll-padding-left: 3rem; scroll-padding-right: 3rem;
.snap-py-16scroll-padding-top: 4rem; scroll-padding-bottom: 4rem;
.snap-px-16scroll-padding-left: 4rem; scroll-padding-right: 4rem;
.snap-py-20scroll-padding-top: 5rem; scroll-padding-bottom: 5rem;
.snap-px-20scroll-padding-left: 5rem; scroll-padding-right: 5rem;
.snap-py-24scroll-padding-top: 6rem; scroll-padding-bottom: 6rem;
.snap-px-24scroll-padding-left: 6rem; scroll-padding-right: 6rem;
.snap-py-32scroll-padding-top: 8rem; scroll-padding-bottom: 8rem;
.snap-px-32scroll-padding-left: 8rem; scroll-padding-right: 8rem;
.snap-py-40scroll-padding-top: 10rem; scroll-padding-bottom: 10rem;
.snap-px-40scroll-padding-left: 10rem; scroll-padding-right: 10rem;
.snap-py-48scroll-padding-top: 12rem; scroll-padding-bottom: 12rem;
.snap-px-48scroll-padding-left: 12rem; scroll-padding-right: 12rem;
.snap-py-56scroll-padding-top: 14rem; scroll-padding-bottom: 14rem;
.snap-px-56scroll-padding-left: 14rem; scroll-padding-right: 14rem;
.snap-py-64scroll-padding-top: 16rem; scroll-padding-bottom: 16rem;
.snap-px-64scroll-padding-left: 16rem; scroll-padding-right: 16rem;
.snap-py-pxscroll-padding-top: 1px; scroll-padding-bottom: 1px;
.snap-px-pxscroll-padding-left: 1px; scroll-padding-right: 1px;
.snap-pt-0scroll-padding-top: 0;
.snap-pr-0scroll-padding-right: 0;
.snap-pb-0scroll-padding-bottom: 0;
.snap-pl-0scroll-padding-left: 0;
.snap-pt-1scroll-padding-top: 0.25rem;
.snap-pr-1scroll-padding-right: 0.25rem;
.snap-pb-1scroll-padding-bottom: 0.25rem;
.snap-pl-1scroll-padding-left: 0.25rem;
.snap-pt-2scroll-padding-top: 0.5rem;
.snap-pr-2scroll-padding-right: 0.5rem;
.snap-pb-2scroll-padding-bottom: 0.5rem;
.snap-pl-2scroll-padding-left: 0.5rem;
.snap-pt-3scroll-padding-top: 0.75rem;
.snap-pr-3scroll-padding-right: 0.75rem;
.snap-pb-3scroll-padding-bottom: 0.75rem;
.snap-pl-3scroll-padding-left: 0.75rem;
.snap-pt-4scroll-padding-top: 1rem;
.snap-pr-4scroll-padding-right: 1rem;
.snap-pb-4scroll-padding-bottom: 1rem;
.snap-pl-4scroll-padding-left: 1rem;
.snap-pt-5scroll-padding-top: 1.25rem;
.snap-pr-5scroll-padding-right: 1.25rem;
.snap-pb-5scroll-padding-bottom: 1.25rem;
.snap-pl-5scroll-padding-left: 1.25rem;
.snap-pt-6scroll-padding-top: 1.5rem;
.snap-pr-6scroll-padding-right: 1.5rem;
.snap-pb-6scroll-padding-bottom: 1.5rem;
.snap-pl-6scroll-padding-left: 1.5rem;
.snap-pt-8scroll-padding-top: 2rem;
.snap-pr-8scroll-padding-right: 2rem;
.snap-pb-8scroll-padding-bottom: 2rem;
.snap-pl-8scroll-padding-left: 2rem;
.snap-pt-10scroll-padding-top: 2.5rem;
.snap-pr-10scroll-padding-right: 2.5rem;
.snap-pb-10scroll-padding-bottom: 2.5rem;
.snap-pl-10scroll-padding-left: 2.5rem;
.snap-pt-12scroll-padding-top: 3rem;
.snap-pr-12scroll-padding-right: 3rem;
.snap-pb-12scroll-padding-bottom: 3rem;
.snap-pl-12scroll-padding-left: 3rem;
.snap-pt-16scroll-padding-top: 4rem;
.snap-pr-16scroll-padding-right: 4rem;
.snap-pb-16scroll-padding-bottom: 4rem;
.snap-pl-16scroll-padding-left: 4rem;
.snap-pt-20scroll-padding-top: 5rem;
.snap-pr-20scroll-padding-right: 5rem;
.snap-pb-20scroll-padding-bottom: 5rem;
.snap-pl-20scroll-padding-left: 5rem;
.snap-pt-24scroll-padding-top: 6rem;
.snap-pr-24scroll-padding-right: 6rem;
.snap-pb-24scroll-padding-bottom: 6rem;
.snap-pl-24scroll-padding-left: 6rem;
.snap-pt-32scroll-padding-top: 8rem;
.snap-pr-32scroll-padding-right: 8rem;
.snap-pb-32scroll-padding-bottom: 8rem;
.snap-pl-32scroll-padding-left: 8rem;
.snap-pt-40scroll-padding-top: 10rem;
.snap-pr-40scroll-padding-right: 10rem;
.snap-pb-40scroll-padding-bottom: 10rem;
.snap-pl-40scroll-padding-left: 10rem;
.snap-pt-48scroll-padding-top: 12rem;
.snap-pr-48scroll-padding-right: 12rem;
.snap-pb-48scroll-padding-bottom: 12rem;
.snap-pl-48scroll-padding-left: 12rem;
.snap-pt-56scroll-padding-top: 14rem;
.snap-pr-56scroll-padding-right: 14rem;
.snap-pb-56scroll-padding-bottom: 14rem;
.snap-pl-56scroll-padding-left: 14rem;
.snap-pt-64scroll-padding-top: 16rem;
.snap-pr-64scroll-padding-right: 16rem;
.snap-pb-64scroll-padding-bottom: 16rem;
.snap-pl-64scroll-padding-left: 16rem;
.snap-pt-pxscroll-padding-top: 1px;
.snap-pr-pxscroll-padding-right: 1px;
.snap-pb-pxscroll-padding-bottom: 1px;
.snap-pl-pxscroll-padding-left: 1px ;

The default values are inherited from your theme's spacing values, negative values included, just like padding.

Also like padding, you can override them your Tailwind theme configuration under the scrollPadding key.

Compatibility

Please note that IE11 doesn't support CSS custom properties. If you have to support IE11, please override the scroll-snap-type utilities.

Keywords

FAQs

Package last updated on 13 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc