DocSpace-buildtools/packages/asc-web-components/submenu/styled-submenu.js

106 lines
2.0 KiB
JavaScript
Raw Normal View History

import styled, { css } from "styled-components";
import Base from "../themes/base";
2022-02-07 11:47:21 +00:00
import { tablet } from "../utils/device";
import { isMobileOnly } from "react-device-detect";
2022-02-07 11:47:21 +00:00
2022-02-04 10:21:10 +00:00
export const StyledSubmenu = styled.div`
display: flex;
flex-direction: column;
.scrollbar {
width: 100%;
height: auto;
}
.text {
width: auto;
display: inline-block;
position: absolute;
}
.sticky {
position: sticky;
top: 0;
background: ${(props) => props.theme.submenu.backgroundColor};
z-index: 1;
}
${isMobileOnly &&
css`
.sticky {
top: 52px;
}
`}
.sticky-indent {
height: 15px;
}
2022-02-04 10:21:10 +00:00
`;
StyledSubmenu.defaultProps = { theme: Base };
2022-02-04 10:21:10 +00:00
export const StyledSubmenuBottomLine = styled.div`
height: 1px;
width: 100%;
margin-top: -1px;
2022-03-30 18:14:53 +00:00
background: ${(props) => props.theme.submenu.lineColor};
2022-02-04 10:21:10 +00:00
`;
StyledSubmenuBottomLine.defaultProps = { theme: Base };
2022-02-04 10:21:10 +00:00
export const StyledSubmenuContentWrapper = styled.div`
width: 100%;
display: flex;
align-items: center;
`;
export const StyledSubmenuItems = styled.div`
overflow: scroll;
2022-02-04 10:21:10 +00:00
display: flex;
flex-direction: row;
gap: 4px;
2022-03-30 18:05:29 +00:00
overflow: hidden;
&::-webkit-scrollbar {
display: none;
}
2022-02-04 10:21:10 +00:00
`;
2022-02-07 09:39:57 +00:00
export const StyledSubmenuItem = styled.div.attrs((props) => ({
2022-02-28 14:15:05 +00:00
id: props.id,
2022-02-07 09:39:57 +00:00
}))`
2022-02-17 22:59:46 +00:00
scroll-behavior: smooth;
2022-02-07 09:39:57 +00:00
cursor: pointer;
2022-02-04 10:21:10 +00:00
display: flex;
2022-03-01 11:45:14 +00:00
gap: 4px;
2022-02-04 10:21:10 +00:00
flex-direction: column;
2022-03-01 11:45:14 +00:00
padding: 4px 14px 0;
2022-02-04 10:21:10 +00:00
line-height: 20px;
`;
export const StyledSubmenuItemText = styled.div`
width: 100%;
display: flex;
.item-text {
color: ${(props) =>
props.isActive ? props.theme.submenu.textColor : "#657077"};
}
2022-02-04 10:21:10 +00:00
`;
StyledSubmenuItemText.defaultProps = { theme: Base };
2022-02-04 10:21:10 +00:00
export const StyledSubmenuItemLabel = styled.div`
2022-03-01 11:45:14 +00:00
z-index: 1;
width: calc(100% + 28px);
margin-left: -14px;
2022-02-04 10:21:10 +00:00
height: 4px;
bottom: 0px;
border-radius: 4px 4px 0 0;
background-color: ${(props) =>
props.isActive ? props.theme.submenu.bottomLineColor : "none"};
2022-02-04 10:21:10 +00:00
`;
StyledSubmenuItemLabel.defaultProps = { theme: Base };