🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

tailwindcss-center

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-center

A TailwindCSS plugin that adds centering utilities.

0.1.2
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

tailwindcss-center

A TailwindCSS plugin that adds centering utilities.

Install

npm install --save-dev tailwindcss-center
Other Package Managers
yarn add --dev tailwindcss-center

Add the plugin to your Tailwind config:

import tailwindPluginCenter from "tailwindcss-center";

export default {
	theme: {
		// ...
	},
	plugins: [
		tailwindPluginCenter,
	],
};
CommonJS Configs
module.exports = {
	theme: {
		// ...
	},
	plugins: [
		require("tailwindcss-center"),
	],
};

Usage

Utilities are provided for centering with Flexbox, CSS Grid, absolute positioning, and auto margins:

<div class="center-flex">
	<!-- ... -->
</div>

Centering can also be applied individually to a specific axis:

<div class="center-flex-x">
	<!-- ... -->
</div>

<div class="center-flex-y">
	<!-- ... -->
</div>

Provided Utilities

Flex

  • center-flex
  • center-flex-x
  • center-flex-y

Grid

  • center-grid
  • center-grid-x
  • center-grid-y

Absolute

  • center-absolute
  • center-absolute-x
  • center-absolute-y

Margin

  • center-margin
  • center-margin-x
  • center-margin-y
  • @marcoguidara/tailwind-quick-center - A plugin that provides utilities for centering an element on x/y axis.

Keywords

tailwind

FAQs

Package last updated on 16 Feb 2024

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