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

Style parser doesn't pick up values in array #6418

Closed
aliveli186 opened this issue Dec 12, 2021 · 1 comment
Closed

Style parser doesn't pick up values in array #6418

aliveli186 opened this issue Dec 12, 2021 · 1 comment

Comments

@aliveli186
Copy link

If values are in an array ["text-[10px]", "lg:text-[14px]"] they are not picked up by the parser. Probably due to square brackets used in the array notation which cause the regex parser to fail.
They need to be converted to string and back to array "text-[10px] lg:text-[14px]".split(" ") to be picked up by the parser.

Fails:

export function getDetailSize(size, count) {
    return formatSizes([
        ["text-[10px]", "lg:text-[14px]"],
        ["text-[12px]", "lg:text-[16px]"]
    ], size, count);
}

Works:

export function getDetailSize(size, count) {
    const s0 = "text-[10px] lg:text-[14px]".split(" ");
    const s1 = "text-[12px] lg:text-[16px]".split(" ");

    return formatSizes([s0, s1], size, count);
}
@thecrypticace
Copy link
Contributor

Fixed in #6590

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

2 participants