selfprivacy.org/_vendor/github.com/google/docsy/assets/scss/_search.scss

123 lines
2 KiB
SCSS
Raw Normal View History

2024-04-21 23:04:16 +00:00
// Search
.td-search {
2024-04-25 22:15:39 +00:00
background: transparent;
position: relative;
width: 100%;
// Search icon
&__icon {
// Vertically center the content.
display: flex;
align-items: center;
height: 100%;
// Position this on the left of the input.
position: absolute;
left: 0.75em;
// Click-through to the underlying input.
pointer-events: none;
&:before {
@extend .fa;
content: fa-content($fa-var-search);
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
// Styling adjustments for the navbar
@at-root {
.td-navbar & {
color: $navbar-dark-color;
}
}
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
// Search input element
&__input {
width: 100%;
text-indent: 1.25em;
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&:not(:focus) {
background: transparent;
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&.form-control:focus {
border-color: tint-color($primary, 95%);
box-shadow: 0 0 0 2px tint-color($primary, 40%);
color: inherit;
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
// Styling adjustments for the navbar
@at-root {
.td-navbar & {
border: none;
color: $navbar-dark-color;
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
@include placeholder {
color: $navbar-dark-color;
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
}
}
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
// Hide icon on focus
&:focus-within {
.td-search__icon {
display: none;
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
.td-search-input {
text-indent: 0px;
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
}
&:not(:focus-within) {
color: $input-placeholder-color;
}
}
.td-sidebar .td-search--algolia {
display: block;
padding: 0 0.5rem;
> button {
margin: 0;
width: 100%;
}
2024-04-21 23:04:16 +00:00
}
// Offline search
.td-search--offline {
2024-04-25 22:15:39 +00:00
&:focus-within {
// Don't hide the search icon on focus: this gives better UX when user
// explores content of search-results popup and focus is lost.
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
.td-search__icon {
display: flex;
color: $input-placeholder-color;
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
}
2024-04-21 23:04:16 +00:00
}
.td-offline-search-results {
2024-04-25 22:15:39 +00:00
max-width: 90%;
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
.card {
margin-bottom: $spacer * 0.5;
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
.card-header {
font-weight: bold;
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&__close-button {
// cursor: pointer;
float: right;
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&:after {
@extend .fas;
content: fa-content($fa-var-times);
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
}
2024-04-21 23:04:16 +00:00
}