eschutho commented on code in PR #36010:
URL: https://github.com/apache/superset/pull/36010#discussion_r2496693324
##########
superset-frontend/src/features/home/Menu.tsx:
##########
@@ -41,110 +41,163 @@ interface MenuProps {
}
const StyledHeader = styled.header`
- ${({ theme }) => `
- background-color: ${theme.colorBgContainer};
- border-bottom: 1px solid ${theme.colorBorderSecondary};
- z-index: 10;
+ ${({ theme }) => css`
+ background-color: ${theme.colorBgContainer};
+ border-bottom: 1px solid ${theme.colorBorderSecondary};
+ padding: 0 ${theme.sizeUnit * 4}px;
+ z-index: 10;
+
+ &:nth-last-of-type(2) nav {
+ margin-bottom: 2px;
+ }
+
+ .caret {
+ display: none;
+ }
+ `}
+`;
- &:nth-last-of-type(2) nav {
- margin-bottom: 2px;
+const StyledBrandText = styled.div`
+ ${({ theme }) => css`
+ border-left: 1px solid ${theme.colorBorderSecondary};
+ border-right: 1px solid ${theme.colorBorderSecondary};
+ height: 100%;
+ color: ${theme.colorText};
+ padding-left: ${theme.sizeUnit * 4}px;
+ padding-right: ${theme.sizeUnit * 4}px;
+ margin-right: ${theme.sizeUnit * 6}px;
+ font-size: ${theme.fontSizeLG}px;
+ float: left;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+
+ span {
+ max-width: ${theme.sizeUnit * 58}px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ @media (max-width: 1127px) {
+ display: none;
+ }
+ `}
+`;
+
+const StyledMainNav = styled(MainNav)`
+ ${({ theme }) => css`
+ .ant-menu-item .ant-menu-item-icon + span,
+ .ant-menu-submenu-title .ant-menu-item-icon + span,
+ .ant-menu-item .anticon + span,
+ .ant-menu-submenu-title .anticon + span {
+ margin-inline-start: 0;
+ }
+
+ @media (max-width: 767px) {
+ .ant-menu-item {
+ padding: 0 ${theme.sizeUnit * 6}px 0 ${theme.sizeUnit * 3}px
!important;
}
- .caret {
- display: none;
+
+ .ant-menu > .ant-menu-item > span > a {
+ padding: 0;
}
- & .ant-image{
- display: contents;
- height: 100%;
- padding: ${theme.sizeUnit}px
- ${theme.sizeUnit * 2}px
- ${theme.sizeUnit}px
- ${theme.sizeUnit * 4}px;
+
+ &.main-nav .ant-menu-submenu-title > svg:nth-of-type(1) {
+ display: none;
}
- .navbar-brand {
+ }
+ `}
+`;
+
+const { SubMenu } = MainNav;
+
+const StyledSubMenu = styled(SubMenu)`
+ ${({ theme }) => css`
+ &.ant-menu-submenu.ant-menu-submenu-horizontal {
+ display: flex;
+ align-items: center;
+ height: 100%;
+ padding: 0;
+
+ .ant-menu-submenu-title {
display: flex;
- flex-direction: column;
- justify-content: center;
- /* must be exactly the height of the Antd navbar */
- min-height: 50px;
- padding: ${theme.sizeUnit}px
- ${theme.sizeUnit * 2}px
- ${theme.sizeUnit}px
- ${theme.sizeUnit * 4}px;
- max-width: ${theme.sizeUnit * theme.brandIconMaxWidth}px;
- img {
- height: 100%;
- object-fit: contain;
- }
- &:focus {
- border-color: transparent;
- }
- &:focus-visible {
- border-color: ${theme.colorPrimaryText};
- }
- }
- .navbar-brand-text {
- border-left: 1px solid ${theme.colorBorderSecondary};
- border-right: 1px solid ${theme.colorBorderSecondary};
+ gap: ${theme.sizeUnit * 2}px;
+ flex-direction: row-reverse;
+ align-items: center;
height: 100%;
- color: ${theme.colorText};
- padding-left: ${theme.sizeUnit * 4}px;
- padding-right: ${theme.sizeUnit * 4}px;
- margin-right: ${theme.sizeUnit * 6}px;
- font-size: ${theme.fontSizeLG}px;
- float: left;
- display: flex;
- flex-direction: column;
- justify-content: center;
-
- span {
- max-width: ${theme.sizeUnit * 58}px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- @media (max-width: 1127px) {
- display: none;
- }
+ padding: 0 ${theme.sizeUnit * 4}px;
}
- @media (max-width: 767px) {
- .navbar-brand {
- float: none;
+
+ &:hover,
+ &.ant-menu-submenu-active {
+ .ant-menu-title-content {
+ color: ${theme.colorPrimary};
}
}
- @media (max-width: 767px) {
- .ant-menu-item {
- padding: 0 ${theme.sizeUnit * 6}px 0
- ${theme.sizeUnit * 3}px !important;
- }
- .ant-menu > .ant-menu-item > span > a {
- padding: 0px;
- }
- .main-nav .ant-menu-submenu-title > svg:nth-of-type(1) {
- display: none;
- }
+
+ &::after {
+ content: '';
+ position: absolute;
+ width: 98%;
+ height: 2px;
+ background-color: ${theme.colorPrimaryBorderHover};
+ bottom: ${theme.sizeUnit / 8}px;
+ left: 1%;
+ right: auto;
+ inset-inline-start: 1%;
+ inset-inline-end: auto;
+ transform: scale(0);
+ transition: 0.2s all ease-out;
Review Comment:
Love the transitions!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]