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

@adeira/babel-plugin-transform-sx-tailwind

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adeira/babel-plugin-transform-sx-tailwind

Babel transformation plugin for SX Tailwind

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-52.94%
Maintainers
3
Weekly downloads
 
Created
Source

Transformation of SX Tailwind helpers into direct SX calls.

This has a positive impact on the final bundle size because the huge Tailwind definitions file can be omitted.

How does it work

import React from 'react';
- import { tailwind } from '@adeira/sx-tailwind';
+ import * as sx from '@adeira/sx';

export default function Example() {
  return (
    <button
-      className={tailwind('bg-blue-500 text-white font-bold')}
+      className={__styles('bg-blue-500', 'text-white', 'font-bold')}
      type="button"
    >
      Button
    </button>
  );
}

+ const __styles = sx.create({
+   'bg-blue-500': {
+     backgroundColor: '#4299e1',
+   },
+   'text-white': {
+     color: '#fff',
+   },
+   'font-bold': {
+     fontWeight: 700,
+   },
+ });

Install

yarn add --dev @adeira/babel-plugin-transform-sx-tailwind

Register in your Babel config (e.g. .babelrc):

{
  "plugins": ["@adeira/babel-plugin-transform-sx-tailwind"]
}

FAQs

Package last updated on 19 Oct 2020

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