Skip to content

Commit bccaccb

Browse files
committed
* fix violation of stylelint rule no-duplicate-selectors @ <PostNav>
* replace all usages of css unit `vh/w` with `dvh/w` @ fe
1 parent 1fa3645 commit bccaccb

4 files changed

Lines changed: 10 additions & 12 deletions

File tree

fe/src/assets/css/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ address {
2020
}
2121

2222
@media (max-width: 991.98px) {
23-
.container { /* let all .container be like .container-fluid when vw is less than md breakpoint */
23+
.container { /* let all .container be like .container-fluid when 100dvw is less than the md breakpoint */
2424
max-width: 100% !important;
2525
}
2626
}

fe/src/components/post/Nav.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,13 @@ watch(viewportTopmostPost, async (to, from) => {
196196
z-index: 1040;
197197
}
198198
.post-nav[aria-expanded=true] {
199-
/* linear regression of vw,inline-size: 456,456 768,384(50%) https://www.wolframalpha.com/input?i=y%3D-0.2308x%2B561.2 */
200-
inline-size: calc(-0.2308 * 100vw + 561.2px - v-bind(scrollBarWidth));
199+
/* linear regression of {dvw,inline-size}: {{456,456},{768,384(50%)}} https://www.wolframalpha.com/input?i=linear+regression+%7B%7B456%2C456%7D%2C%7B768%2C384%7D%7D */
200+
inline-size: calc(-0.2308 * 100dvw + 561.2px - v-bind(scrollBarWidth));
201201
}
202202
.post-nav[aria-expanded=true] + .post-nav-expand {
203203
/* merge .post-nav-expand into the scrollbar of .post-nav */
204-
inset-inline-start: min(-0.2308 * 100vw + 561.2px - v-bind(scrollBarWidth) * 2, 100vw - v-bind(scrollBarWidth) * 2);
205-
}
206-
.post-nav[aria-expanded=true] + .post-nav-expand {
207-
/* after merge narrow the block-size from 100vh to fit-content for interactive with the scrollbar */
204+
inset-inline-start: min(-0.2308 * 100dvw + 561.2px - v-bind(scrollBarWidth) * 2, 100dvw - v-bind(scrollBarWidth) * 2);
205+
/* after merge narrow the block-size from 100dvh to fit-content for interactive with the scrollbar */
208206
block-size: auto !important;
209207
/* https://stackoverflow.com/questions/28455100/how-to-center-div-vertically-inside-of-absolutely-positioned-parent-div/28456704#28456704 */
210208
inset-block-start: 50%;

fe/src/components/post/renderer/Table.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,16 @@ const subReplyColumns = ref<ColumnType[]>([
176176
}
177177
178178
:deep(.renderer-table-reply .ant-table table) {
179-
min-inline-size: calc(100vw - v-bind(scrollBarWidth) - 48px);
179+
min-inline-size: calc(100dvw - v-bind(scrollBarWidth) - 48px);
180180
}
181181
:deep(.renderer-table-reply .ant-table tbody > tr > td) {
182-
max-inline-size: calc(100vw - v-bind(scrollBarWidth) - 48px);
182+
max-inline-size: calc(100dvw - v-bind(scrollBarWidth) - 48px);
183183
}
184184
:deep(.renderer-table-sub-reply .ant-table table) {
185-
min-inline-size: calc(100vw - v-bind(scrollBarWidth) - 48px - 48px);
185+
min-inline-size: calc(100dvw - v-bind(scrollBarWidth) - 48px - 48px);
186186
}
187187
:deep(.renderer-table-sub-reply .ant-table tbody > tr > td) {
188-
max-inline-size: calc(100vw - v-bind(scrollBarWidth) - 48px - 48px);
188+
max-inline-size: calc(100dvw - v-bind(scrollBarWidth) - 48px - 48px);
189189
}
190190
191191
:deep(.renderer-table-reply thead > tr > th) {

fe/src/layouts/default.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if (import.meta.client) {
5555

5656
<style scoped>
5757
#app-wrapper {
58-
min-height: 100vh;
58+
min-height: 100dvh;
5959
pointer-events: v-bind(appPointerEvents);
6060
}
6161

0 commit comments

Comments
 (0)