Skip to content

Commit

Permalink
fix(scrollbar): fix robot plugin scrollbar hide almost all scrollbar …
Browse files Browse the repository at this point in the history
…bug (#340)

* fix(scrollbar): fix robot plugin scrollbar hide almost all scrollbar bug

* fix(scrollbar): change by review comment

* fix(theme-scrollbar): change by review comment

* fix(theme-base): apply default scrollbar style to body * children
  • Loading branch information
chilingling committed Apr 7, 2024
1 parent e961e06 commit 6c92ffe
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 72 deletions.
7 changes: 1 addition & 6 deletions packages/plugins/robot/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</template>
</tiny-dropdown>
</header>
<article class="chat-window" id="chatgpt-window">
<article class="chat-window lowcode-scrollbar-hide" id="chatgpt-window">
<tiny-layout>
<tiny-row
v-for="(item, index) in activeMessages"
Expand Down Expand Up @@ -390,8 +390,6 @@ export default {
.chat-window {
max-height: 400px;
overflow: scroll;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
.chat-avatar-wrap {
width: 46px;
.chat-avatar {
Expand Down Expand Up @@ -437,9 +435,6 @@ export default {
color: var(--ti-lowcode-chat-model-ai-fail-text);
}
::-webkit-scrollbar {
display: none; /* Chrome Safari */
}
.chat-tips {
text-align: right;
font-size: 12px;
Expand Down
9 changes: 7 additions & 2 deletions packages/settings/design/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,17 @@ body {
--base-top-panel-height: 35px;
--base-bottom-panel-height: 30px;
--base-nav-panel-width: 40px;
scrollbar-color: rgba(0, 0, 0, 0.1) #fff;
scrollbar-width: thin;
-webkit-font-smoothing: subpixel-antialiased;
background: #f9f9f9;
}
@supports not selector(::webkit-scrollbar) {
body {
scrollbar-color: rgba(0, 0, 0, 0.1) #fff;
scrollbar-width: thin;
}
}
ol,
ul {
list-style: none;
Expand Down
56 changes: 56 additions & 0 deletions packages/theme/common/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,59 @@ td {
-webkit-line-clamp: var(--ellipsis-line, 2);
-webkit-box-orient: vertical;
}

body {
*,
.lowcode-scrollbar,
.lowcode-scrollbar-thin {
&::-webkit-scrollbar-track,
&::-webkit-scrollbar-track-piece,
&::-webkit-scrollbar-corner {
background-color: transparent;
}

&::-webkit-scrollbar-thumb {
background-color: #dbdbdb;

&:hover {
background-color: #c2c2c2;
}
}
}
*,
.lowcode-scrollbar {
&::-webkit-scrollbar {
width: 8px;
height: 8px;
}
}
.lowcode-scrollbar-thin {
&::-webkit-scrollbar {
width: 4px;
height: 4px;
}
}
}

// support for not webkit browser and won't override ::webkit-scrollbar-* selector
@supports not selector(::-webkit-scrollbar) {
body {
* {
scrollbar-width: thin;
scrollbar-color: #dbdbdb transparent;
}
}
}

// hide scrollbar
@supports not selector(::-webkit-scrollbar) {
.lowcode-scrollbar-hide {
scrollbar-width: none;
}
}

.lowcode-scrollbar-hide {
&::-webkit-scrollbar {
display: none;
}
}
1 change: 0 additions & 1 deletion packages/theme/dark/index.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import '../common/base.less';
@import '../common/global.less';
@import './base.less';
@import './scrollbar.less';
// 主题配置优先于公共配置
@import './variable.less';
@import './block.less';
Expand Down
30 changes: 0 additions & 30 deletions packages/theme/dark/scrollbar.less

This file was deleted.

1 change: 0 additions & 1 deletion packages/theme/light/index.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import '../common/base.less';
@import '../common/global.less';
@import './base.less';
@import './scrollbar.less';
// 主题配置优先于公共配置
@import './variable.less';
@import './tutorial.less';
Expand Down
32 changes: 0 additions & 32 deletions packages/theme/light/scrollbar.less

This file was deleted.

0 comments on commit 6c92ffe

Please sign in to comment.