-
Notifications
You must be signed in to change notification settings - Fork 9
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(accordion): styles #1834
fix(accordion): styles #1834
Changes from 1 commit
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 | ||
---|---|---|---|---|
|
@@ -17,25 +17,31 @@ export const IsomerDetailGroupView = ({ | |||
const selected = activePos >= startPos && activePos <= endPos | ||||
|
||||
const { onDrawerOpen } = useEditorDrawerContext() | ||||
|
||||
// todo: get drawer reviewed in staging | ||||
const isProd = process.env.REACT_APP_ENV === "production" | ||||
|
||||
const otherButtons = ( | ||||
<> | ||||
<Box | ||||
display={selected ? "block" : "none"} | ||||
display={selected ? "flex" : "none"} | ||||
position="absolute" | ||||
width="100%" | ||||
justifyContent="end" | ||||
> | ||||
<HStack | ||||
bgColor="interaction.mainLight.default" | ||||
borderRadius="0.25rem" | ||||
border="1px solid" | ||||
borderColor="base.divider.medium" | ||||
display="flex" | ||||
justifyContent="flex-end" | ||||
boxShadow="0px 8px 12px 0px rgba(187, 187, 187, 0.50)" | ||||
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. could we use a token for this? boxShadow: `0 0 0 1px var(--chakra-colors-gray-400)` 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. @sehyunidaaa may i get token for this please? 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. 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. hmmm can we use this but we've been using the same bespoke shadow for other bubble menus btw
|
||||
px="0.5rem" | ||||
py="0.25rem" | ||||
mr="-0.5rem" | ||||
mt="-1.5rem" | ||||
Comment on lines
+33
to
+34
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. could we need to use negative margins to remove padding? wouldn't this cause accordion to be out of alignment with the other elements 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. 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. hmm i get that - but the odd thing is i couldn't find negative margins being used in card grid ._. i'm ok with this for now ba but if there's time, please try to figure out why card grids doesn't require the negative margin |
||||
> | ||||
<Box | ||||
backgroundColor={selected ? "white" : "transparent"} | ||||
marginTop="-0.25rem" | ||||
boxShadow="0px 0px 4px 0px rgba(0, 0, 0, 0.8)" | ||||
borderRadius="4px" | ||||
> | ||||
<Tooltip label="Edit accordion grid" hasArrow placement="top"> | ||||
{!isProd && ( | ||||
<Tooltip label="Edit accordion block" hasArrow placement="top"> | ||||
seaerchin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
<IconButton | ||||
_hover={{ bg: "gray.100" }} | ||||
_active={{ bg: "gray.200" }} | ||||
|
@@ -56,30 +62,31 @@ export const IsomerDetailGroupView = ({ | |||
/> | ||||
</IconButton> | ||||
</Tooltip> | ||||
<Tooltip label="Delete accordion " hasArrow placement="top"> | ||||
<IconButton | ||||
_hover={{ bg: "gray.100" }} | ||||
_active={{ bg: "gray.200" }} | ||||
onClick={() => { | ||||
editor.chain().focus().unsetDetailsGroup().run() | ||||
}} | ||||
bgColor="transparent" | ||||
border="none" | ||||
h="1.75rem" | ||||
w="1.75rem" | ||||
minH="1.75rem" | ||||
minW="1.75rem" | ||||
p="0.25rem" | ||||
aria-label="delete accordion block" | ||||
> | ||||
<Icon | ||||
as={BiTrash} | ||||
fontSize="1.25rem" | ||||
color="interaction.critical.default" | ||||
/> | ||||
</IconButton> | ||||
</Tooltip> | ||||
</Box> | ||||
)} | ||||
|
||||
<Tooltip label="Delete accordion block" hasArrow placement="top"> | ||||
<IconButton | ||||
_hover={{ bg: "gray.100" }} | ||||
_active={{ bg: "gray.200" }} | ||||
onClick={() => { | ||||
editor.chain().focus().unsetDetailsGroup().run() | ||||
}} | ||||
bgColor="transparent" | ||||
border="none" | ||||
h="1.75rem" | ||||
w="1.75rem" | ||||
minH="1.75rem" | ||||
minW="1.75rem" | ||||
p="0.25rem" | ||||
aria-label="delete accordion block" | ||||
> | ||||
<Icon | ||||
as={BiTrash} | ||||
fontSize="1.25rem" | ||||
color="interaction.critical.default" | ||||
/> | ||||
</IconButton> | ||||
</Tooltip> | ||||
</HStack> | ||||
</Box> | ||||
<Box | ||||
|
@@ -112,18 +119,18 @@ export const IsomerDetailGroupView = ({ | |||
) | ||||
return ( | ||||
<BlockWrapper | ||||
name="Accordion grid" | ||||
name="Accordion" | ||||
isSelected={selected} | ||||
childButtons={otherButtons} | ||||
padding-top="0.5rem" | ||||
padding-bottom="0.5rem" | ||||
> | ||||
<Box | ||||
borderColor="base.divider.strong" | ||||
borderWidth="1px" | ||||
mt="1rem" | ||||
h="100%" | ||||
w="100%" | ||||
borderTop="1px solid #d4d4d4" | ||||
borderBottom="1px solid #d4d4d4" | ||||
Comment on lines
+117
to
+118
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. should we use colour tokens here 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. sadly we dont have a token for this yet. 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. ahh this is cos i used the colors from the template. my bad! can use |
||||
> | ||||
<NodeViewContent /> | ||||
</Box> | ||||
|
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's this required? from the review, this seems like accordion should have a
0.75rem
gap, not that the gap between elements should be reduced by0.75rem
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.
hey this crit from design was outdated (look at the Se Hyun's comments)
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.
on why this is needed,
before:
after: