Socket
Socket
Sign inDemoInstall

laravel-mix-tweemotional

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    laravel-mix-tweemotional

Laravel mix extension that combines the best of Emotion and Tailwind.


Version published
Maintainers
1
Install size
2.84 kB
Created

Readme

Source

Tweemotional

Zero-config Laravel Mix extension that allows you to combine Tailwind utilities with Emotion styled components.

It's beautiful 😭

Installation

  1. yarn add -D laravel-mix-tweemotional

  2. Add require('laravel-mix-tweemotional') to your webpack.mix.js config file. Once the extension is included you initialize it using mix.tweemotional().

Basic usage

Creating a <Backsplash /> styled component using Tailwind classes generated by your tailwind.config.js file:

import tw from 'tailwind.macro'

const Backsplash = tw.div`bg-black w-full`

Creating a styled component that takes a combination of preset Tailwind utilities and props (example: <Backsplash color={hotpink} />):

import tw from 'tailwind.macro'

const Backsplash = styled.div(
  tw`relative w-100 h-100`,
  props => ({
    backgroundColor: `${props.color ? props.color : null}`,
  })
)

Options

Tweemotional takes two configuration paramters which are passed when initializing the extension: tailwindConfig allows you to specify the path to your tailwind.config.js file (if it is in a non-standard location, for example). emotionFormat allows you to specify formatting instructions for Emotion generated classnames.

mix.tweemotional({
  tailwindConfig: 'non/standard/tailwind.config.js',
  emotionFormat: '[local]',
})

Keywords

FAQs

Last updated on 18 Jan 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc