Skip to content

Handling multi-levels variables? #82

Open
@dtvn

Description

@dtvn

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.

Activity

changed the title [-]How to handle variables has multi-levels?[/-] [+]Handling multi-levels variables?[/+] on Oct 16, 2019
cliffordp

cliffordp commented on Mar 23, 2020

@cliffordp

Yes, I want this as well.

image

gael-boyenval

gael-boyenval commented on May 5, 2020

@gael-boyenval

@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

cliffordp commented on May 5, 2020

@cliffordp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cliffordp@gael-boyenval@dtvn

        Issue actions

          Handling multi-levels variables? · Issue #82 · csstools/postcss-advanced-variables