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

Handling multi-levels variables? #82

Open
dtvn opened this issue Oct 16, 2019 · 3 comments
Open

Handling multi-levels variables? #82

dtvn opened this issue Oct 16, 2019 · 3 comments

Comments

@dtvn
Copy link

dtvn commented Oct 16, 2019

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 dtvn changed the title How to handle variables has multi-levels? Handling multi-levels variables? Oct 16, 2019
@cliffordp
Copy link

Yes, I want this as well.

image

@gael-boyenval
Copy link

@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
		}
	}
}

@cliffordp
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants