Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tailwindcss plugin add but null #584

Closed
productdevbook opened this issue Dec 27, 2022 · 6 comments
Closed

tailwindcss plugin add but null #584

productdevbook opened this issue Dec 27, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@productdevbook
Copy link

image

tailwindcss.config.js

/** @type {import('tailwindcss').Config} */
// @tailwindcss/typography
const tailwindTypography = require('@tailwindcss/typography')
module.exports = {
  theme: {
    extend: {},
  },
  plugins: [tailwindTypography],
}

nuxt.config.ts

  tailwindcss: {
    configPath: './tailwind.config.js',
    viewer: false,
  },
@productdevbook productdevbook added the bug Something isn't working label Dec 27, 2022
@productdevbook
Copy link
Author

productdevbook commented Dec 27, 2022

or config change only nuxt.config in add same problem

image

@productdevbook
Copy link
Author

same -> #565

@BayBreezy
Copy link

BayBreezy commented Jan 3, 2023

Having this same issue but only on macOS

@NnicanBuak
Copy link

NnicanBuak commented Apr 12, 2023

Windows 11, Nuxt 3.3.1

My plugins are also ignored (maybe I still wrote them down wrong, but I don't have any way to debug the config. More precisely, no settings from tailwind.config.js are applied at all, I've been trying to solve this for hours and decided to extend config)
image

import { plugin } from 'tailwindcss/plugin'
import tailwindTypography from '@tailwindcss/typography'
import tailwindForms from '@tailwindcss/forms'

export default {
	content: ['content/**/*.md'],
	theme: {
		container: {
			center: true,
			padding: {
				DEFAULT: 'calc(8vw + 24px)',
			},
		},
		fontFamily: {
			sans: ['Montserrat', 'sans-serif'],
			serif: ['EB Garamond', 'serif'],
		},
		extend: {
			colors: {
				primary: '#BFD400',
				primary2: '#BB66A5',
				secondary: '#4F501D',
				secondary2: '#56184A',
			},
			backgroundPosition: {
				'left-59%-bottom': 'left 59% bottom',
				'left-62%-bottom': 'left 62% bottom',
			},
			backgroundSize: {
				'250%': '250%',
			},
		},
	},
	plugins: [
		tailwindTypography,
		tailwindForms,
		plugin({ theme, addBase, addComponents, addUtilities, addVariant }) => {
			const hStyle = {
				fontWeight: theme('fontWeight.bold'),
				fontFamily: theme('fontFamily.serif'),
				color: theme('colors.primary'),
			}

			addBase({
				hr: {
					marginTop: theme('margin.1'),
					marginBottom: theme('margin.3'),
					borderRadius: theme('borderRadius.full'),
					borderStyle: 'none',
				},
				p: {
					fontSize: theme('fontSize.base'),
					fontFamily: theme('fontFamily.sans'),
					color: theme('colors.secondary'),
				},
				h1: { ...hStyle, fontSize: theme('fontSize.4xl') },
				h2: { ...hStyle, fontSize: theme('fontSize.3xl') },
				h3: { ...hStyle, fontSize: theme('fontSize.2xl') },
				h4: { ...hStyle, fontSize: theme('fontSize.xl') },
				h5: { ...hStyle, fontSize: theme('fontSize.lg') },
				h6: { ...hStyle, fontSize: theme('fontSize.base') },
			})

			addComponents({
				'.card': {
					backgroundColor: theme('colors.primary'),
					borderRadius: theme('borderRadius.xl'),
					padding: theme('spacing.6'),
				},
			})

			addVariant({
				interact: 'lg:hover|focus-visible',
			})
		}),
	],
}

Although I noticed something for debugging image I think this will help.

@ineshbose
Copy link
Collaborator

Plugins can't be serialised by the module and hence are just set to empty array!
Tailwindcss v3.3 supports ESM/TS configurations so we are considering not generating a resolved template anymore - do you have thoughts on this?

@ineshbose
Copy link
Collaborator

#565 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants