-
Notifications
You must be signed in to change notification settings - Fork 36
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(react-keytips): address issues after bug bash #301
fix(react-keytips): address issues after bug bash #301
Conversation
bea7ae1
to
60fb46b
Compare
import { addons } from '@storybook/manager-api'; | ||
|
||
addons.setConfig({ | ||
enableShortcuts: false, |
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.
disabled the shortcuts, as some of them were conflicting with keytips hotkeys. For instance, if invokeEvent
is keyup
, digit 1 is not captured at all.
textAlign: 'center', | ||
cursor: 'default', | ||
fontFamily: tokens.fontFamilyBase, | ||
fontSize: tokens.fontSizeBase200, | ||
lineHeight: tokens.lineHeightBase200, | ||
borderRadius: tokens.borderRadiusMedium, | ||
padding: tokens.spacingHorizontalXS, | ||
border: `1px solid ${tokens.colorTransparentStroke}`, | ||
padding: `calc(${tokens.spacingHorizontalXS} - 1px)`, |
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.
Why do we need the -1px
? Is the box-sizing: border-box
not enough?
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.
box-sizing is already applied. I add this calc in order to keep the correct token and avoid setting height, just rely on border and padding sizes. The size should be 24x24, which becomes 24x26 with padding token from Figma spec and 1px border, because border is not taking into account in Figma, but we need it, so we could set padding 3px (no token), use fixed height, or this approach.
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.
It should probably use tokens.strokeWidthThin
instead of -1px
, e.g.:
calc(${tokens.spacingHorizontalXS} - ${tokens.strokeWidthThin})
packages/react-keytips/src/components/Keytip/useKeytipStyles.styles.ts
Outdated
Show resolved
Hide resolved
60fb46b
to
77dca7a
Compare
77bcaad
to
62479a0
Compare
62479a0
to
f6e563d
Compare
Fixing the issues spotted during the bug bash session: 1, 2, 3, 4, 7