Skip to content

Commit a41145d

Browse files
committed
Update landscape breakpoint to 450px and refine component layouts
- the button should not overlap border bottom - in landscape, middle column should have margin right: -10px; - rename 'is landscape' mixin to 'landscape' - move [Fragment] into top level const ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ ├── Main │ │ └── MainView │ │ ├── MainView.module.scss │ │ ├── MainView.tsx │ │ └── components │ │ └── Header │ │ └── Header.module.scss │ └── hooks │ └── use-is-landscape.ts └── packages └── ui └── src ├── components │ └── editor │ └── prompt │ └── Tabs │ ├── Tabs.module.scss │ ├── Tabs.tsx │ └── index.ts └── styles └── foundation └── _mixins.scss
1 parent 93d913d commit a41145d

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎apps/editor/src/views/prompt/frontend/Main/MainView/MainView.module.scss‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
flex-shrink: 0;
1919
}
2020

21-
@include is-landscape {
21+
@include landscape {
2222
height: auto;
2323
}
2424
}
@@ -41,6 +41,9 @@
4141

4242
&--prompt {
4343
flex: 1.5;
44+
@include modern-ui {
45+
margin-right: -10px;
46+
}
4447

4548
.content {
4649
padding-bottom: 8px;

‎apps/editor/src/views/prompt/frontend/Main/MainView/components/Header/Header.module.scss‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
padding: 0 10px;
1212
}
1313

14-
@include is-landscape {
14+
@include landscape {
1515
height: auto;
1616
align-items: flex-start;
1717
padding: unset;
18-
margin: 12px 0 0 12px;
18+
margin: 6px 0 0 12px;
1919

2020
@include modern-ui {
21-
margin: 10px 0 0 10px;
21+
padding: unset;
22+
margin: 6px 0 0 10px;
2223
}
2324
}
2425

@@ -28,7 +29,7 @@
2829
padding: 4px 0;
2930
gap: 4px;
3031

31-
@include is-landscape {
32+
@include landscape {
3233
flex-direction: column;
3334
align-items: flex-start;
3435
padding: 0;

‎apps/editor/src/views/prompt/frontend/hooks/use-is-landscape.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { useState, useEffect } from 'react'
22

3+
const MIN_WIDTH = 450
4+
35
export const use_is_landscape = () => {
46
const [is_landscape, set_is_landscape] = useState(
5-
window.innerWidth > window.innerHeight && window.innerWidth >= 400
7+
window.innerWidth > window.innerHeight && window.innerWidth >= MIN_WIDTH
68
)
79

810
useEffect(() => {
911
const handle_resize = () => {
1012
set_is_landscape(
11-
window.innerWidth > window.innerHeight && window.innerWidth >= 400
13+
window.innerWidth > window.innerHeight && window.innerWidth >= MIN_WIDTH
1214
)
1315
}
1416

‎packages/ui/src/components/editor/prompt/Tabs/Tabs.module.scss‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
justify-content: space-between;
44
align-items: center;
55
gap: 14px;
6-
margin: 0 12px;
6+
padding: 0 12px;
77
border-bottom: 1px solid var(--cwc-red-background);
88

99
@include modern-ui {
10+
padding: 0;
1011
margin: 0 10px;
1112
}
1213

1314
&__list {
1415
display: flex;
1516
align-items: center;
1617
gap: 4px;
17-
margin-bottom: -1px;
1818
}
1919

2020
&__tab {
2121
@include accent-font;
2222
font-size: 16px;
23-
padding: 4px 8px 3px 8px;
23+
padding: 4px 8px 2px 8px;
2424
display: flex;
2525
align-items: center;
2626
text-transform: none;
@@ -35,14 +35,8 @@
3535
color: var(--cwc-text-color);
3636
}
3737

38-
&:focus-visible {
39-
outline: 1px solid var(--vscode-focusBorder);
40-
outline-offset: -1px;
41-
}
42-
4338
&--active {
4439
color: var(--cwc-red-foreground);
45-
border-bottom-color: var(--cwc-red-background);
4640
background-color: var(--cwc-red-background);
4741

4842
&:hover {

‎packages/ui/src/styles/foundation/_mixins.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111
}
1212

13-
@mixin is-landscape {
14-
@media (orientation: landscape) and (min-width: 400px) {
13+
@mixin landscape {
14+
@media (orientation: landscape) and (min-width: 450px) {
1515
@content;
1616
}
1717
}

0 commit comments

Comments
 (0)