Skip to content

Commit 8fbed80

Browse files
Schwehn42BingeCode
andauthored
fix: stack view header (#5474)
Co-authored-by: Benedikt Scheffbuch <[email protected]>
1 parent 913786e commit 8fbed80

File tree

3 files changed

+35
-30
lines changed

3 files changed

+35
-30
lines changed
Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
11
@import "constants/style";
22
@import "routes/StackView/StackView.scss";
33

4+
$header-max-width: 80vw;
5+
46
.note-dialog-header {
5-
font-size: calc(24px + 0.8vw);
6-
color: $gray--000;
7-
width: fit-content; // change to constant value for overflow ellipsis
8-
// height: $stack-view__header-height;
9-
min-height: $stack-view__min-height;
10-
letter-spacing: $letter-spacing--large;
11-
line-height: $line-height--large;
12-
text-align: center;
13-
cursor: initial;
147
display: flex;
8+
min-height: $stack-view__min-height;
159
flex-direction: column;
16-
align-items: center;
1710
flex-shrink: 0;
11+
align-items: center;
1812
gap: $spacing--base;
13+
14+
width: $header-max-width;
15+
max-width: $header-max-width;
16+
17+
color: $gray--000;
18+
19+
letter-spacing: $letter-spacing--large;
20+
text-align: center;
21+
cursor: initial;
1922
}
2023

2124
.note-dialog-header__name {
22-
width: 100%;
23-
margin: $spacing--lg 0 0 0;
25+
max-width: 100%;
26+
27+
font-size: calc($text--2xl + 0.8vw);
28+
font-weight: 700;
2429

2530
overflow: hidden;
2631
white-space: nowrap;
2732
text-overflow: ellipsis;
2833

29-
&::after {
30-
content: " ";
31-
display: block;
32-
height: 6px;
33-
background: var(--accent-color--light);
34-
border-radius: $rounded--full;
35-
margin-top: $spacing--base;
36-
}
34+
border-bottom: 6px solid var(--accent-color--light);
3735
}
3836

3937
.note-dialog-header__description {
40-
width: 60%;
38+
width: 100%;
4139
font-size: $text--lg;
4240
font-weight: 600;
4341
line-height: 30px;
@@ -50,8 +48,14 @@
5048
}
5149
}
5250

51+
@media screen and (max-width: $breakpoint--smartphone) {
52+
.note-dialog-header {
53+
max-width: calc(100vw - 60px);
54+
}
55+
}
56+
5357
[theme="dark"] {
54-
.note-dialog-header > h2::after {
55-
background: var(--accent-color--dark);
58+
.note-dialog-header__name {
59+
border-bottom-color: var(--accent-color--dark);
5660
}
5761
}

src/components/NoteDialogComponents/NoteDialogHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ type NoteDialogHeaderProps = {
99

1010
export const NoteDialogHeader: FC<NoteDialogHeaderProps> = ({columnName, columnDescription}: NoteDialogHeaderProps) => (
1111
<div className="note-dialog-header">
12-
<h2 className="note-dialog-header__name" data-clarity-mask="True">
12+
<div className="note-dialog-header__name" data-clarity-mask="True">
1313
{columnName}
14-
</h2>
14+
</div>
1515
<TextArea
1616
className="note-dialog-header__description"
1717
input={columnDescription}

src/routes/StackView/StackView.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import "constants/style";
22

3-
$stack-view__header-height: 14vh;
3+
$stack-view__header-height: 164px;
44
$stack-view__navigation-height: 14vh;
55
$stack-view__min-height: 82px;
66

@@ -11,10 +11,10 @@ $stack-view__min-height: 82px;
1111
}
1212

1313
.stack-view {
14-
display: flex;
14+
display: grid;
1515
height: 100vh;
16-
flex-direction: column;
17-
align-items: center;
16+
grid-template-rows: $stack-view__header-height auto 1fr;
17+
justify-items: center;
1818

1919
padding-top: $spacing--xl;
2020
}
@@ -38,7 +38,8 @@ $stack-view__min-height: 82px;
3838
.stack-view__content {
3939
position: relative;
4040

41-
height: calc(100vh - $stack-view__header-height - $stack-view__navigation-height);
41+
// subtracting header, navigation, and spacing from viewport height to limit extendable note
42+
height: calc(100vh - ($spacing--xl + $stack-view__header-height + $stack-view__navigation-height + $spacing--xl));
4243
width: 100vw;
4344
border-radius: $note__border-radius;
4445

0 commit comments

Comments
 (0)