3.0.32 • Published 9 months ago

@pinegrow/tailwindcss-plugin v3.0.32

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Pinegrow TailwindCSS Plugin

npm version npm downloads License

Tailwind CSS plugin for Pinegrow ⚡️

Pinegrow TailwindCSS Plugin enables intellisense, visual control customization and theming in Pinegrow apps (currently only Pinegrow Web Editor & Vue Designer).

Note:

  • This plugin is generally used in conjunction with the Pinegrow Vite Plugin or with the meta-framework specific Pinegrow modules for Iles, Nuxt and Astro.
  • To use Tailwind CSS in Pinegrow apps, you require an active Tailwind Addon subscription.
  •  Learn more about Vue Designer

Features

  • 🎨  Visually live-design your Vite-powered tailwind apps (Vue, Nuxt, Iles, Astro, etc)
  • ⚙️  Smartly integrates into your Vite workflow in dev-mode only
  •   Clean code 😃, No lock-in - You are in control of your projects and development workflow ❤️

Quick Setup

  1. Install: Add @pinegrow/tailwindcss-plugin to your project
# Using npm
npm install -D @pinegrow/tailwindcss-plugin

# Using pnpm
pnpm add -D @pinegrow/tailwindcss-plugin
  1. Configure: Add tailwindcss along with configPath and cssPath as options to liveDesigner in your config.
//vite.config.[js,ts]

export default defineConfig({
	plugins: [
		liveDesigner({
			// For options, refer to https://www.npmjs.com/package/@pinegrow/vite-plugin
			//...
			tailwindcss: {
				/* PinegrowTailwindCSSModuleOptions (for more details, refer to Options section below) */
				/* Please ensure that you update the filenames and paths to accurately match those used in your project. */
				configPath: 'tailwind.config.ts',
				cssPath: '@/assets/css/tailwind.css',
				// restartOnConfigUpdate: true,
				// restartOnThemeUpdate: true,
			},
		}),
		//...
	],
	//...
})
//nuxt.config.ts

export default defineNuxtConfig({
	modules: [
		'@pinegrow/nuxt-module',
		//...
	],
	pinegrow: {
		liveDesigner: {
			// For options, refer to https://www.npmjs.com/package/@pinegrow/vite-plugin
			//...
			tailwindcss: {
				/* PinegrowTailwindCSSModuleOptions (for more details, refer to Options section below) */
				/* Please ensure that you update the filenames and paths to accurately match those used in your project. */
				configPath: 'tailwind.config.ts',
				cssPath: '@/assets/css/tailwind.css',
				// restartOnConfigUpdate: true,
				// restartOnThemeUpdate: true,
			},
		},
	},
	//...
})
//iles.config.ts

import type { LiveDesignerOptions } from '@pinegrow/vite-plugin'
export default defineConfig({
  modules: [
    [
      '@pinegrow/iles-module',
      {
        liveDesigner: {
          // For options, refer to https://www.npmjs.com/package/@pinegrow/vite-plugin
          //...
          tailwindcss: {
            /* PinegrowTailwindCSSModuleOptions (for more details, refer to Options section below) */
            /* Please ensure that you update the filenames and paths to accurately match those used in your project. */
            configPath: 'tailwind.config.ts',
            cssPath: '@/assets/css/tailwind.css',
            // restartOnConfigUpdate: true,
            // restartOnThemeUpdate: true,
          },
        } as LiveDesignerOptions,
      },
    ],
    //...
  ],
  //...
})
//astro.config.[mjs]

import { defineConfig } from 'astro/config'
import vue from '@astrojs/vue'
import Pinegrow from '@pinegrow/astro-module'

export default defineConfig({
	integrations: [
		vue(),
		Pinegrow({
			liveDesigner: {
				// For options, refer to https://www.npmjs.com/package/@pinegrow/vite-plugin
				//...
				tailwindcss: {
					/* PinegrowTailwindCSSModuleOptions (for more details, refer to Options section below) */
					/* Please ensure that you update the filenames and paths to accurately match those used in your project. */
					configPath: 'tailwind.config.ts',
					cssPath: '@/assets/css/tailwind.css',
					// restartOnConfigUpdate: true,
					// restartOnThemeUpdate: true,
				},
			},
		}),
		//...
	],
	//...
})
  1. Now, open your project in your Pinegrow app (currently only Vue Designer). ✨

  2. Theme Customization (optional) - Pinegrow Tailwind CSS addon enables easy theming based on colors, fonts and background images. Theme files are saved at the location specified by the themePath option (default: src/themes/pg-tailwindcss/tokens.cjs,mjs). To use the theme, follow the instructions in the Config Panel of your Pinegrow app (currently only Vue Designer) under @pinegrow/tailwindcss-plugin package.

Options

interface PinegrowTailwindCSSModuleOptions {
	/**
	 * Absolute or relative path of the tailwind configuration file.
	 */
	configPath: string | any

	/**
	 * Absolute or relative path of the tailwind entry css file.
	 */
	cssPath?: string | any

	/**
	 * Absolute or relative path of the tailwind theme file.
	 * @default 'src/themes/pg-tailwindcss/tokens.[cjs,mjs]'
	 * @default 'themes/pg-tailwindcss/tokens.[cjs,mjs]' // Nuxt
	 * Set to false to turn off theming via Design Panel
	 */
	themePath?: string | boolean

	/**
	 * Restart on tailwind config file updates
	 * @default false
	 */
	restartOnConfigUpdate?: boolean

	/**
	 * Restart on tailwind theme file updates
	 * @default false
	 */
	restartOnThemeUpdate?: boolean
}

interface PinegrowTailwindCSSModule {
	/**
	 * Pinegrow TailwindCSS Module Options, added within liveDesigner in vite/nuxt/iles/astro config files
	 */
	tailwindcss: PinegrowTailwindCSSModuleOptions
}

interface PinegrowTailwindCSSPluginOptions {
	colors?: {
		[key in string]?: any
	}
	fonts?: {
		[key in string]?: string[]
	}
	backgrounds?: {
		'design-image': string
		'design-image-large': string
	}
}

interface PinegrowTailwindCSSPlugin {
	/**
	 * Pinegrow TailwindCSS Plugin Options, added to the plugins array in tailwind config file
	 */
	default: PinegrowTailwindCSSPluginOptions
}

License

MIT License

Copyright (c) Pinegrow

3.0.32

9 months ago

3.0.31

9 months ago

3.0.28-beta.0

12 months ago

3.0.23

1 year ago

3.0.24

1 year ago

3.0.21

1 year ago

3.0.22

1 year ago

3.0.27

1 year ago

3.0.28

12 months ago

3.0.25

1 year ago

3.0.26

1 year ago

3.0.30

11 months ago

3.0.29

12 months ago

3.0.20

1 year ago

3.0.19

1 year ago

3.0.12

2 years ago

3.0.13

2 years ago

3.0.10

2 years ago

3.0.11

2 years ago

3.0.1

2 years ago

3.0.16

2 years ago

3.0.8

2 years ago

3.0.17

2 years ago

3.0.7

2 years ago

3.0.14

2 years ago

3.0.6

2 years ago

3.0.15

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

3.0.18

2 years ago

3.0.9

2 years ago

3.0.0-beta.61

2 years ago

3.0.0-beta.62

2 years ago

3.0.0-beta.63

2 years ago

3.0.0-beta.64

2 years ago

3.0.0-beta.65

2 years ago

3.0.0-beta.66

2 years ago

3.0.0-beta.67

2 years ago

3.0.0-beta.68

2 years ago

3.0.0-beta.69

2 years ago

3.0.0-beta.91

2 years ago

3.0.0-beta.92

2 years ago

3.0.0-beta.93

2 years ago

3.0.0-beta.90

2 years ago

3.0.0-beta.80

2 years ago

3.0.0-beta.81

2 years ago

3.0.0-beta.82

2 years ago

3.0.0-beta.83

2 years ago

3.0.0-beta.84

2 years ago

3.0.0-beta.85

2 years ago

3.0.0-beta.86

2 years ago

3.0.0-beta.87

2 years ago

3.0.0-beta.88

2 years ago

3.0.0-beta.89

2 years ago

3.0.0-beta.70

2 years ago

3.0.0-beta.71

2 years ago

3.0.0-beta.72

2 years ago

3.0.0-beta.73

2 years ago

3.0.0-beta.74

2 years ago

3.0.0-beta.75

2 years ago

3.0.0-beta.76

2 years ago

3.0.0-beta.77

2 years ago

3.0.0-beta.78

2 years ago

3.0.0-beta.79

2 years ago

3.0.0-beta.60

2 years ago

3.0.0-beta.40

2 years ago

3.0.0-beta.41

2 years ago

3.0.0-beta.42

2 years ago

3.0.0-beta.43

2 years ago

3.0.0-beta.44

2 years ago

3.0.0-beta.46

2 years ago

3.0.0-beta.47

2 years ago

3.0.0-beta.48

2 years ago

3.0.0-beta.49

2 years ago

3.0.0-beta.50

2 years ago

3.0.0-beta.51

2 years ago

3.0.0-beta.52

2 years ago

3.0.0-beta.53

2 years ago

3.0.0-beta.54

2 years ago

3.0.0-beta.55

2 years ago

3.0.0-beta.56

2 years ago

3.0.0-beta.57

2 years ago

3.0.0-beta.35

2 years ago

3.0.0-beta.58

2 years ago

3.0.0-beta.36

2 years ago

3.0.0-beta.59

2 years ago

3.0.0-beta.37

2 years ago

3.0.0-beta.38

2 years ago

3.0.0-beta.39

2 years ago

3.0.0-beta.34

2 years ago

3.0.0-beta.33

2 years ago

3.0.0-beta.32

2 years ago

3.0.0-beta.31

2 years ago

3.0.0-beta.30

2 years ago

3.0.0-beta.28

3 years ago

3.0.0-beta.27

3 years ago

3.0.0-beta.26

3 years ago

3.0.0-beta.25

3 years ago

3.0.0-beta.24

3 years ago

3.0.0-beta.23

3 years ago

3.0.0-beta.22

3 years ago

3.0.0-beta.21

3 years ago