chore: update sidebar styles in mobile view (#285)

* 添加移动端点击自动关闭侧边栏

* 添加移动端点击自动关闭侧边栏

* 添加移动端点击自动关闭侧边栏

* move closeSidebar function to utils

* move closeSidebar function to utils

* 侧边栏优化

* 移动端侧边栏优化

* 移动端侧边栏优化

* 移动端侧边栏优化
This commit is contained in:
h2o2o
2022-10-13 22:56:42 +08:00
committed by GitHub
parent 246851fdbe
commit ce5a6fa3ac
6 changed files with 94 additions and 33 deletions

View File

@ -134,3 +134,10 @@ export const parseHTMLToRawText = (htmlStr: string): string => {
const text = tempEl.innerText;
return text;
};
export function closeSidebar() {
const sidebarEl = document.body.querySelector(".sidebar-wrapper") as HTMLDivElement;
const maskEl = document.body.querySelector(".mask") as HTMLDivElement;
sidebarEl.classList.replace("open-sidebar", "close-sidebar");
maskEl.classList.replace("show-mask", "hide-mask");
}