css-doodle / css-doodle

🎨 A web component for drawing patterns with CSS.

Home Page:https://css-doodle.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Pick a value contains ','

jiangyijie27 opened this issue · comments

// pick a rgb, then give a random alpha
--color: @p((0, 0, 0), (255, 255, 255));
color: rgba(var(--color), @r(0, 1));

(Edit: The above code actually works. Here's how to read variables with @p which may have ',' )

Does this help?

--color: @p((0, 0, 0), (255, 255, 255));
color: rgba(@p((--color)), @r(0, 1));

Example:

--color: 0, 0, 0;

color: @p(--color);
/*  == @p(0, 0, 0); 
    == 0; */

color: @p((--color));
/*  == @p((0, 0, 0));
    == 0, 0, 0; */