markdown 侧边菜单,悬停,图标

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 侧边菜单,悬停,图标相关的知识,希望对你有一定的参考价值。

with styled-component and material-ui

```tsx
import React from "react";
import { ReportablesNav } from "src/navigation/ReportablesNav";
import { PersonsNav } from "src/navigation/PersonsNav";
import { RitesNav } from "src/navigation/RitesNav";
import AssignmentIcon from "@material-ui/icons/Assignment";
import PeopleIcon from "@material-ui/icons/People";
import SpaIcon from "@material-ui/icons/Spa";
import styled, { css } from "styled-components";

const FlexCol = styled.div`
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;

  &:first-child {
    margin-top: 15px;
  }
`;

//reset Nav styles
const resetDeco = css`
  text-decoration: none;
`;

//hover effect
const effect = css`
  color: #c8d1da;
  transition: all 0.2s ease-in-out;
  :hover {
    color: #8e94f7;
    transform: scale(1.2);
  }
`;

//Wrap small Icon into bigger element. so that hover action can be reached easier.
const Wrapper = styled.div`
  /* make the clickable area bigger */
  padding: 15px;

  /* hovering effect */
  ${effect}

  /* to each Icon */
  & > * {
    ${resetDeco}
  }
`;

const SideMenu = () => {
  return (
    <FlexCol>
      <ReportablesNav>
        <Wrapper>
          <AssignmentIcon />
        </Wrapper>
      </ReportablesNav>
      <PersonsNav>
        <Wrapper>
          <PeopleIcon />
        </Wrapper>
      </PersonsNav>
      <RitesNav>
        <Wrapper>
          <SpaIcon />
        </Wrapper>
      </RitesNav>
    </FlexCol>
  );
};
export default SideMenu;
```

以上是关于markdown 侧边菜单,悬停,图标的主要内容,如果未能解决你的问题,请参考以下文章

在菜单组件中鼠标悬停时更改按钮的图标和文本颜色

Android App 侧边栏菜单的简单实现

限制 IONIC 侧边菜单自动填充大屏幕

侧边菜单中的图标有下划线/太大了?

使用变换进行悬停时裁剪下拉菜单

如何在侧边菜单中添加标题