-
Notifications
You must be signed in to change notification settings - Fork 68
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
(fix): responsive variants for base when slots are present #202
base: main
Are you sure you want to change the base?
Conversation
@@ -235,7 +235,10 @@ export const tv = (options, configProp) => { | |||
if (screenValues.length > 0) { | |||
screenValues.push(value); | |||
|
|||
return screenValues; | |||
if (slotKey === "base") { | |||
return screenValues.join(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures line 266 is evaluated and returns the variantValue
as a string
Note for context the issue is related to the logic here: for (const variant in variants) {
const variantValue = getVariantValue(variant, variants, slotKey, slotProps);
const value =
slotKey === "base" && typeof variantValue === "string"
? variantValue
: variantValue && variantValue[slotKey];
if (value) {
result[result.length] = value;
}
} The return value of getVaraintValue when |
@tianenpang please check this |
Hi @jrgarciadev LGTM 🚀 also test case added 🧪 and thanks to @w0ofy for the fix 🙏 |
👋 Just checking in, when can we expect this to be merged and released? |
Description
cc @codecaaron
While trying to use
responsiveVariants
withslots
present, any responsive props passed were not output in the component's classname.What is the purpose of this pull request?
Ensure that responsive classnames are applied to
base
correctly when slots are also used.Here's a minimal code example of the issue: