Skip to content

Commit

Permalink
fix(template): set search container width and font-size
Browse files Browse the repository at this point in the history
  • Loading branch information
luxiaobei authored and why520crazy committed Dec 21, 2021
1 parent f338ca2 commit a8364c9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/template/src/shared/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>
<div class="spacer"></div>
<div class="action-items">
<dg-search class="action-item" *ngIf="global.config.mode | dgIsFull"></dg-search>
<dg-search class="action-item search-container" *ngIf="global.config.mode | dgIsFull"></dg-search>

<dg-locales-selector class="action-item" *ngIf="global.config.locales && global.config.locales.length > 1"></dg-locales-selector>
<a *ngIf="global.config.repoUrl" class="action-item repo-url" href="{{ global.config.repoUrl }}" target="_blank">
Expand Down
13 changes: 7 additions & 6 deletions packages/template/src/styles/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
.action-items {
display: flex;
align-items: center;
flex: auto;
justify-content: end;

.search-container {
flex: auto;
max-width: 300px;
}

.action-item {
margin-left: 20px;
Expand All @@ -68,12 +75,6 @@
font-size: 32px;
}
}

.dg-search-container {
.search {
width: 200px;
}
}
}

@include dg-media-breakpoint-down('md') {
Expand Down
8 changes: 8 additions & 0 deletions packages/template/src/styles/search.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.dg-search-container {
position: relative;
line-height: $dg-font-size-base;
font-size: $dg-font-size-base;

.search-icon {
position: absolute;
Expand All @@ -14,10 +16,12 @@

.search {
padding: 0.532rem 10px 0.532rem 30px;
width: 100%;
outline: none;
border: 1px solid $dg-gray-200;
border-radius: 18px;
-webkit-appearance: none;
box-sizing: border-box;
}

.search-results-container {
Expand Down Expand Up @@ -75,4 +79,8 @@
}
}
}

.algolia-autocomplete {
width: 100%;
}
}
4 changes: 0 additions & 4 deletions packages/template/src/styles/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,5 @@
min-width: 280px;
}
}

.search {
width: 240px;
}
}
}

0 comments on commit a8364c9

Please sign in to comment.