-
Notifications
You must be signed in to change notification settings - Fork 715
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
Remove default styling for Tooltip #650
Comments
Inline |
This component is quite simple so I'm curious about the benefits of this versus creating your own component? if you are using Alternatively we could update the component such that these current
I think in this case we should export the default styles so if you want to e.g., override 1 style, you don't have to define all of them and could do I don't have a ton of bandwidth right now and am focusing on improved docs, but would happily review a PR! |
I can make a PR to do this, What do you guys think about using CSS for the default styles? |
Historically, vx has avoided shipping CSS. I would prefer the defaultStyles export because it is lower friction. As @williaster highlights, extension is easy: <Tooltip style={{ ...defaultStyles, color: 'magenta' }} ... /> But in terms of API how do folks feel about opting out of the default inline styles? Option A) Pass empty object <Tooltip style={{}} ... /> Option B) Prop flag <Tooltip unstyled /> For option b, the code becomes: export default function Tooltip({
className,
top,
left,
unstyled = false,
style = defaultStyles,
children,
...restProps
}: TooltipProps & JSX.IntrinsicElements['div']) {
return (
<div
className={cx('vx-tooltip-portal', className)}
style={!unstyled ? style : undefined}
{...restProps}
>
{children}
</div>
);
} |
Would you be open to remove these default styles for
Tooltip
?https://github.com/hshoff/vx/blob/ac76afad960c4715a1f339b395e5b1e6a4e7de9c/packages/vx-tooltip/src/tooltips/Tooltip.tsx#L25-L32
It seems like most of VX doesn't assume much styling, but for
Tooltip
I need to override all of these with!important
in my CSS modules. I know one could just replaceTooltip
with adiv
, butTooltipWithBounds
is harder to replace.The text was updated successfully, but these errors were encountered: