postcss-advanced-variables icon indicating copy to clipboard operation
postcss-advanced-variables copied to clipboard

Handling multi-levels variables?

Open dtvn opened this issue 4 years ago • 3 comments

I have this vars:

const vars = {
	fontset: {
		size: '14px',
		body: '"Mali", cursive',
		head: '"Itim", cursive'
	}
}

module.exports = {
	plugins: {
		'postcss-advanced-variables': {
			variables: vars
		}
	}
}

How do I use fontset in css files? More exactly, does PAV supports this feature?

I think it's called map in SASS.

dtvn avatar Oct 16 '19 06:10 dtvn

Yes, I want this as well.

image

cliffordp avatar Mar 23 '20 06:03 cliffordp

@dtvn : did you tried to add the rest as a string or a template ?

const vars = {
	fontset: `(
		size: '14px',
		body: '"Mali", cursive',
		head: '"Itim", cursive'
	)`
}

module.exports = {
	plugins: {
		'postcss-advanced-variables': {
			variables: vars
		}
	}
}

gael-boyenval avatar May 05 '20 15:05 gael-boyenval

FYI: I used Tailwind's theme to do this instead: https://tailwindcss.com/docs/theme/

cliffordp avatar May 05 '20 16:05 cliffordp