DocSpace-buildtools/packages/asc-web-components/toggle-content/styled-toggle-content.js

67 lines
1.5 KiB
JavaScript
Raw Normal View History

import styled, { css } from "styled-components";
2021-02-25 21:19:45 +00:00
import Base from "../themes/base";
const StyledContainer = styled.div`
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
.span-toggle-content {
cursor: pointer;
user-select: none;
2022-03-18 09:11:43 +00:00
display: grid;
grid-template-columns: 16px 1fr;
grid-column-gap: 9px;
max-width: 660px;
svg {
${(props) =>
!props.enableToggle &&
css`
display: none;
`}
path {
fill: ${(props) => props.theme.toggleContent.iconColor};
}
}
}
.arrow-toggle-content {
2022-03-18 09:11:43 +00:00
margin: auto 0;
transform: ${(props) =>
props.isOpen && props.theme.toggleContent.transform};
}
.heading-toggle-content {
height: ${(props) => props.theme.toggleContent.headingHeight};
line-height: ${(props) => props.theme.toggleContent.headingHeight};
box-sizing: border-box;
font-style: normal;
${(props) =>
props.enableToggle
? css`
&:hover {
border-bottom: ${(props) =>
props.theme.toggleContent.hoverBorderBottom};
}
`
: css`
cursor: default;
`}
}
`;
StyledContainer.defaultProps = { theme: Base };
const StyledContent = styled.div`
color: ${(props) => props.theme.toggleContent.childrenContent.color};
padding-top: ${(props) =>
props.theme.toggleContent.childrenContent.paddingTop};
display: ${(props) => (props.isOpen ? "block" : "none")};
`;
StyledContent.defaultProps = { theme: Base };
export { StyledContent, StyledContainer };