-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add rounded corners to all components #5938
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,11 +107,11 @@ export default function AutocompleteList<Item>({ | |
)} | ||
data-testid="autocomplete-list-container" | ||
> | ||
<Card width="auto"> | ||
<Card width="auto" classes="overflow-hidden"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<ul tabIndex={-1} aria-label="Suggestions" role="listbox" {...props}> | ||
{items} | ||
</ul> | ||
<MenuArrow direction="up" classes="top-[-8px] left-[3px]" /> | ||
<MenuArrow direction="up" classes="top-[-8px] left-2" /> | ||
</Card> | ||
</div> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,19 +232,21 @@ export default function Menu({ | |
direction="up" | ||
classes={classnames( | ||
// Position menu-arrow caret near bottom right of menu label/toggle control | ||
'right-0 top-[calc(100%-3px)] w-[15px]', | ||
'right-1 top-[calc(100%-3px)] w-[15px]', | ||
arrowClass, | ||
)} | ||
/> | ||
<div | ||
className={classnames( | ||
'focus-visible-ring', | ||
// Position menu content near bottom of menu label/toggle control | ||
'absolute top-[calc(100%+5px)] z-1 border shadow', | ||
'bg-white text-md', | ||
'absolute top-[calc(100%+5px)] z-1', | ||
'border shadow rounded-lg overflow-hidden bg-white text-md', | ||
{ | ||
'left-0': align === 'left', | ||
'right-0': align === 'right', | ||
// Adding negative right distance so that the menu arrow does | ||
// not overlap with the top-right corner when it's rounded | ||
'-right-1': align === 'right', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering whether we should remove the up arrow for menus where the up-arrow was previously aligned with either the right or left edge of its toggle button. This seems to be the pattern that several web properties (eg. GitHub) use. |
||
}, | ||
contentClass, | ||
)} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,7 +239,7 @@ export default function MenuItem({ | |
const wrapperClasses = classnames( | ||
'focus-visible-ring ring-inset', | ||
'w-full min-w-[150px] flex items-center select-none', | ||
'border-b', | ||
'border-b rounded-none cursor-pointer', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This addresses inconsistencies in which link menu items were being rendered with rounded corners on hover, while non-links were not rounded. I took the opportunity to address other inconsistencies between link vs non-link menu items, like hover color and cursor type. |
||
// Set this container as a "group" so that children may style based on its | ||
// layout state. | ||
// See https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-state | ||
|
@@ -263,7 +263,7 @@ export default function MenuItem({ | |
'border-b-grey-3': isExpanded, | ||
'border-b-transparent': !isExpanded, | ||
'text-color-text-light': isDisabled, | ||
'text-color-text': !isDisabled, | ||
'text-color-text hover:text-color-text': !isDisabled, | ||
}, | ||
); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ function ToastBadge({ | |
return ( | ||
<div | ||
className={classnames( | ||
'flex items-center gap-x-1 py-1 px-2 rounded-[4px]', | ||
'flex items-center gap-x-1 py-1 px-2 rounded', | ||
'bg-green-success/10 animate-pulse-fade-out', | ||
classes, | ||
)} | ||
|
@@ -97,13 +97,13 @@ export default function ProfileView() { | |
|
||
// Render save-success message after each successful save, but do not render | ||
// it when a "request is in flight". This removal and re-adding across a | ||
// sequence of saves ensures that the browser sees the message as newly- added | ||
// to the accessiblity DOM and screen readers should announce it at the | ||
// sequence of saves ensures that the browser sees the message as newly-added | ||
// to the accessibility DOM and screen readers should announce it at the | ||
// appropriate times. | ||
const withSaveMessage = saveCount > 0 && !loading; | ||
|
||
return ( | ||
<Card data-testid="profile-container"> | ||
<Card data-testid="profile-container" classes="overflow-hidden"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<div | ||
className={classnames( | ||
// Ensure there is enough height to clear both the heading text and the | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,7 @@ export default function SidebarPanel({ | |
onClose={closePanel} | ||
transitionComponent={Slider} | ||
variant={variant} | ||
scrollable={false} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to check why, but making the Dialog scrollable messes with the bottom corners and makes them non-rounded. This specific Dialog does not have a fixed height, so the scroll does not add any value here and we can just disable it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would fix it hypothesis/frontend-shared#1352 |
||
> | ||
{children} | ||
</Dialog> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,14 @@ export default { | |
// This module references `sidebar-frame` and related classes | ||
'./src/annotator/sidebar.{js,ts,tsx}', | ||
], | ||
theme: { | ||
extend: { | ||
borderRadius: { | ||
// Equivalent to tailwind defaults, but overriding values from frontend-shared preset | ||
// Once the preset stops defining borderRadius, we can remove this | ||
DEFAULT: '0.25rem', | ||
lg: '0.5rem', | ||
}, | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes annotator components be always rounded. This was their behavior already, but it was set via hardcoded border radius Those classes have been replaced by |
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,6 @@ export default { | |
'pulse-fade-out': 'pulse-fade-out 5s ease-in-out forwards', | ||
'slide-in-from-right': 'slide-in-from-right 0.3s forwards ease-in-out', | ||
}, | ||
borderRadius: { | ||
// Equivalent to tailwind default `rounded-sm` size | ||
DEFAULT: '0.125rem', | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now use the config defined in frontend-shared's tailwind preset. |
||
boxShadow: { | ||
'adder-toolbar': '0px 2px 10px 0px rgba(0, 0, 0, 0.25)', | ||
focus: `0 0 0 2px ${focusBlue}`, | ||
|
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.
See hypothesis/frontend-shared#1352