Skip to content

Commit 26c7bfc

Browse files
committed
Roughly allow GlobalSearch to expand rightwards
1 parent a08cbed commit 26c7bfc

File tree

3 files changed

+44
-32
lines changed

3 files changed

+44
-32
lines changed

website/src/views/layout/GlobalSearch.scss

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $dropdown-height: 40rem;
1010
composes: btn-svg from global;
1111
position: relative;
1212
height: 100%;
13-
padding-right: $container-padding;
13+
padding-left: $container-padding;
1414
margin-left: auto;
1515
font-size: 0.9rem;
1616

@@ -23,37 +23,43 @@ $icon-dist: $input-width-open - $input-width;
2323
$icon-dist-lg: $input-width-open-lg - $input-width;
2424

2525
.icon {
26-
position: absolute;
27-
right: $icon-dist + $container-padding;
26+
// position: absolute;
27+
// right: $icon-dist + $container-padding;
28+
// position: relative;
29+
// left: 0;
2830
width: $icon-size;
2931
height: $icon-size;
30-
transform: translate($icon-dist - 0.25rem);
32+
// transform: translate($icon-dist - 0.25rem);
3133
transition: all $desktop-entering-duration $material-deceleration-curve;
3234

3335
@include media-breakpoint-up(lg) {
34-
right: $icon-dist-lg + $container-padding;
35-
transform: translate($icon-dist-lg - 0.25rem);
36+
// right: $icon-dist-lg + $container-padding;
37+
// transform: translate($icon-dist-lg - 0.25rem);
3638
}
3739
}
3840

3941
.iconOpen {
4042
color: theme-color();
41-
transform: translate(0);
43+
// transform: translate(0);
4244
}
4345

4446
.input {
45-
position: absolute;
46-
right: $input-width-open + $container-padding;
47+
$overhang: $icon-size/2; // Extend clickable area to the left of icon
48+
$internal-padding: $overhang; // Symmetrical padding around icon
49+
50+
position: relative;
4751
opacity: 0;
48-
width: $input-width;
52+
left: -$icon-size - $overhang;
53+
padding-left: $icon-size + $overhang + $internal-padding;
54+
width: $input-width + $overhang + $internal-padding;
4955
height: 100%;
50-
padding-left: $input-width;
56+
5157
border: 0;
5258
font-size: $font-size-s;
5359
color: var(--body-color);
5460
background: transparent;
5561
cursor: pointer;
56-
transform: translate($input-width-open);
62+
// transform: translate($input-width-open);
5763
transition: transform $desktop-entering-duration $material-deceleration-curve,
5864
opacity $desktop-entering-duration $material-deceleration-curve 75ms;
5965

@@ -74,16 +80,13 @@ $icon-dist-lg: $input-width-open-lg - $input-width;
7480

7581
.inputOpen {
7682
composes: openWidth;
77-
right: 0;
7883
opacity: 1;
7984
cursor: auto;
80-
transform: translate(0);
8185
}
8286

8387
.selectListContainer {
8488
position: absolute;
85-
top: $navbar-height - 0.5rem;
86-
right: 0;
89+
top: $navbar-height;
8790
z-index: $module-select-z-index;
8891
border: $input-btn-border-width solid $input-border-color;
8992
border-width: 0 $input-btn-border-width $input-btn-border-width;

website/src/views/layout/Navbar.scss

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ $logo-vert-padding: 0.875rem;
4444
display: flex;
4545
// Explicit width so the logo will not expand
4646
// to occupy the entire navbar
47-
width: 12rem;
48-
padding: $logo-vert-padding $grid-gutter-width;
47+
width: 8.3rem;
48+
margin: $logo-vert-padding $grid-gutter-width;
4949
}
5050

5151
.brandLogo {
@@ -74,17 +74,6 @@ $logo-vert-padding: 0.875rem;
7474
text-align: right;
7575
}
7676

77-
@include media-breakpoint-up(xl) {
78-
.brand {
79-
// Padding to match navtab left padding
80-
padding-left: 2rem;
81-
}
82-
83-
.navRight {
84-
padding: $vert-padding $grid-gutter-width/2 $vert-padding 2rem;
85-
}
86-
}
87-
8877
@include media-breakpoint-down(sm) {
8978
.navbarWrapper {
9079
top: -$navbar-height;
@@ -98,11 +87,20 @@ $logo-vert-padding: 0.875rem;
9887

9988
width: 100%;
10089
}
101-
}
10290

103-
@include media-breakpoint-down(xs) {
10491
.brand {
10592
flex: 1;
106-
padding: $logo-vert-padding 0;
93+
margin: $logo-vert-padding 0 $logo-vert-padding $grid-gutter-width/2;
10794
}
10895
}
96+
97+
// @include media-breakpoint-up(xl) {
98+
// .brand {
99+
// // Padding to match navtab left padding
100+
// padding-left: 2rem;
101+
// }
102+
103+
// .navRight {
104+
// padding: $vert-padding $grid-gutter-width/2 $vert-padding 2rem;
105+
// }
106+
// }

website/src/views/layout/Navtabs.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ $divider-margin: 0.3rem;
4444

4545
svg {
4646
margin-bottom: 0.1rem;
47+
48+
$icon-size: $font-size-lg; // TODO: Dedupe with GlobalSearch.scss $icon-size
49+
width: $icon-size;
50+
height: $icon-size;
4751
}
4852
}
4953

@@ -52,6 +56,13 @@ $divider-margin: 0.3rem;
5256
font-size: 0.7rem;
5357
margin-left: 0.4rem;
5458
font-size: 1rem;
59+
60+
// TODO: Try this caps alternative
61+
// margin-left: 0.5rem;
62+
// font-size: 0.85rem;
63+
// letter-spacing: 0.07rem;
64+
// font-weight: 500;
65+
// text-transform: uppercase;
5566
}
5667

5768
.hiddenOnMobile {

0 commit comments

Comments
 (0)