-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
I’m trying to achieve variant composition as shown in the example below, but the styled function’s defaultVariant option only accepts a single value. Since the Button component can take an array of variants <Button variant={["solid", "md"]} />, I’m wondering why defaultVariant doesn’t accept an array as well.
import { makeTheme } from "dripsy";
import { Pressable, styled, Text } from "dripsy";
const theme = makeTheme({
buttons: {
solid: {
color: "white",
backgroundColor: "primary",
},
md: {
fontSize: "p",
paddingX: 16,
paddingY: 8,
},
},
});
const Button = styled(Pressable, {
themeKey: "buttons",
defaultVariant: ["solid", "md"], // <- accept a single value only
})();
const ButtonText = styled(Text)({
color: "inherit",
fontFamily: "inherit",
fontSize: "inherit",
textDecorationLine: "inherit",
});
function UsageExample() {
return (
<Button>
<ButtonText>Change privacy settings</ButtonText>
</Button>
);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels