Skip to content

Commit

Permalink
Revert "fix 🐛 : fix styles (#1199)" (#1201)
Browse files Browse the repository at this point in the history
This reverts commit 172f4c8.
  • Loading branch information
Vanessa219 committed Mar 28, 2022
1 parent 172f4c8 commit 74ad443
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/assets/scss/_hint.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
}

button {
display: flex;
color: var(--toolbar-icon-color);
display: block;
padding: 3px 10px;
border: 0;
border-radius: 0;
Expand Down
39 changes: 4 additions & 35 deletions src/assets/scss/_panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,10 @@
* @version 1.0.0.0, Jan 22, 2020
*/

@-webkit-keyframes scale-in {
0% {
opacity: 0;
transform: scale(0.5);
}
100% {
opacity: 1;
transform: scale(1);
}
}

@keyframes scale-in {
0% {
opacity: 0;
transform: scale(0.5);
transform: scale(.5);
}
100% {
opacity: 1;
Expand All @@ -37,33 +26,21 @@
z-index: 3;
font-size: 14px;
display: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
max-width: 320px;
min-width: 80px;
-webkit-animation-duration: 0.15s;
animation-duration: 0.15s;
-webkit-animation-name: scale-in;
animation-duration: .15s;
animation-name: scale-in;
-webkit-animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
animation-timing-function: cubic-bezier(.2, 0, .13, 1.5);
color: var(--toolbar-icon-color);

&--none {
padding: 0;
-webkit-animation: none;
animation: none;
min-width: auto;
max-width: none;
white-space: nowrap;
opacity: 0.86;
}

&--arrow {
display: none;
flex-direction: column;
opacity: .86;
}

&--arrow:before {
Expand Down Expand Up @@ -131,11 +108,3 @@
}
}
}

.vditor[dir="rtl"] {
&-panel {
&--arrow:before {
right: 5px !important;
}
}
}
1 change: 0 additions & 1 deletion src/assets/scss/_toolbar.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.vditor {
&-toolbar {
display: flex;
background-color: var(--toolbar-background-color);
border-bottom: 1px solid var(--border-color);
padding: 0 5px;
Expand Down
6 changes: 3 additions & 3 deletions src/ts/toolbar/setToolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const showToolbar = (toolbar: { [key: string]: HTMLElement }, names: stri
return;
}
if (toolbar[name]) {
toolbar[name].style.display = "flex";
toolbar[name].style.display = "block";
}
});
};
Expand Down Expand Up @@ -102,14 +102,14 @@ export const toggleSubMenu = (vditor: IVditor, panelElement: HTMLElement, action
vditor.toolbar.element.querySelectorAll(".vditor-hint--current").forEach((item) => {
item.classList.remove("vditor-hint--current");
});
if (panelElement.style.display === "flex") {
if (panelElement.style.display === "block") {
panelElement.style.display = "none";
} else {
hidePanel(vditor, ["subToolbar", "hint", "popover"], actionBtn.parentElement.parentElement);
if (!actionBtn.classList.contains("vditor-tooltipped")) {
actionBtn.classList.add("vditor-hint--current");
}
panelElement.style.display = "flex";
panelElement.style.display = "block";
if (vditor.toolbar.element.getBoundingClientRect().right - actionBtn.getBoundingClientRect().right < 250) {
panelElement.classList.add("vditor-panel--left");
} else {
Expand Down

0 comments on commit 74ad443

Please sign in to comment.