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

@storefront-ui/tw-plugin-peer-next

Package Overview
Dependencies
Maintainers
6
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storefront-ui/tw-plugin-peer-next

SFUI peer-next plugin for Tailwind

  • 2.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.1K
increased by3.34%
Maintainers
6
Weekly downloads
 
Created
Source

Storefront UI

`peer-next` class for first next sibling.

GitHub Repository Stars Count Follow Us on Twitter Subscribe on our Youtube Channel Chat with us on Discord

npm Commitizen friendly License PRs Welcome


#TechForUkraine

Russia’s military aggression against Ukraine.

How can you support Ukrainian civil society?

All help is needed. If you are not able to help locally, by sheltering a fellow Ukrainian, you can also:

SF Typography

Extend of peer tailwind class but with + (first next sibling). Original peer class is for ~ (every following sibling).

Made with ❤️ by Alokai team and contributors.

Why?

Targeting next siblings with ~ is not suitable for HTML structure when pairing input and label, every label after changed input will also change. Of course we can wrap such groups but having in mind how browser works, nesting and making deeper HTML structure does affect performance of rendering HTML by browser.

Installation

npm install --save-dev @storefront-ui/tw-plugin-peer-next
// tailwind.config.ts

import sfPeerNext from '@storefront-ui/tw-plugin-peer-next';

export default {
  content: ['your-components-source-directory/*.ts'],
  plugins: [sfPeerNext]
};

How to use it

Plugin extends Tailwindcss peer class and allows to use it as an adjacent sibling combinator.

<form>
  <label class="block">
    <span class="block text-sm font-medium text-slate-700">Email</span>
    <input type="email" class="peer-next ..."/>
    <p class="invisible mt-2 text-sm text-pink-600 peer-next-invalid:visible">
      Please provide a valid email address.
    </p>
  </label>
</form>

Looking for a library to accelerate your ecommerce development?

Make sure to check out StorefrontUI! Read the documentation at https://docs.storefrontui.io/v2/ 🚀

FAQs

Package last updated on 08 May 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

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