Saya
Saya
I'd like to mention this should also apply to the `:is` and `:has` pseudo functions. Care especially for the, somewhat experimental, `:has` pseudo which adds different syntax altogether.
As @chris-zhu said in #1695, there are another way to wait until either tokens or preflights are all processed before doing the other. Try to get access to the `UnoGenerator`...
@antfu Just with the async behavior as I commented above. With this changes the whole test file could be removed since it was added to ensure the racing behavior.
Before you continue, I'd point out there's special case for backdrop pseudo that only uses `:` because using `-` clashes with the backdrop rule https://github.com/unocss/unocss/blob/b9fb172419608098af5db9cd72932790c6f06c6b/packages/preset-mini/src/_variants/pseudo.ts#L87
My personal take for now is for the `separator` to accept `string[]` thus the regex is or-ed (ex. `(-|:)`), and modify the exception on pseudo to exclude `-` instead now...
Use case of string separator (as in multiple chars) may just be as compatibility with tailwind https://github.com/tailwindlabs/tailwindcss/blob/0b5bfc8065e928caa7cf11a7bac37fda10411b6f/tests/arbitrary-variants.test.js#L322-L324 https://github.com/tailwindlabs/tailwindcss/blob/0b5bfc8065e928caa7cf11a7bac37fda10411b6f/tests/arbitrary-variants.test.js#L348-L350 Otherwise a nice addition in term of flexibility.
@tjk If you are yet working on this PR, can I work on the updates?
Any name suggestion?
@wheatjs ping for separate implementation update.
Follow the discussion in #1013. Mostly this is due to the theme object in unocss is not the same as it might be used in tailwind, especially the `container` key.