summaryrefslogtreecommitdiffstats
path: root/site/assets/scss/_search.scss
blob: ca1e5b060c8164d8c5c5ec40063851484cca34b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// stylelint-disable selector-class-pattern

:root {
  --docsearch-primary-color: var(--bd-violet);
  --docsearch-logo-color: var(--bd-violet);
}

@include color-mode(dark, true) {
  // From here, the values are copied from https://cdn.jsdelivr.net/npm/@docsearch/css@3
  // in html[data-theme="dark"] selector
  // and are slightly modified for formatting purpose
  --docsearch-text-color: #f5f6f7;
  --docsearch-container-background: rgba(9, 10, 17, .8);
  --docsearch-modal-background: #15172a;
  --docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;
  --docsearch-searchbox-background: #090a11;
  --docsearch-searchbox-focus-background: #000;
  --docsearch-hit-color: #bec3c9;
  --docsearch-hit-shadow: none;
  --docsearch-hit-background: #090a11;
  --docsearch-key-gradient: linear-gradient(-26.5deg, #565872, #31355b);
  --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, .3);
  --docsearch-footer-background: #1e2136;
  --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, .5), 0 -4px 8px 0 rgba(0, 0, 0, .2);
  --docsearch-muted-color: #7f8497;
}

.bd-search {
  position: relative;

  @include media-breakpoint-up(lg) {
    position: absolute;
    top: .875rem;
    left: 50%;
    width: 200px;
    margin-left: -100px;
  }

  @include media-breakpoint-up(xl) {
    width: 280px;
    margin-left: -140px;
  }

}

.DocSearch-Container {
  --docsearch-muted-color: var(--bs-secondary-color);
  --docsearch-hit-shadow: none;

  z-index: 2000; // Make sure to be over all components showcased in the documentation
  cursor: auto; // Needed because of [role="button"] in Algolia search modal. Remove once https://github.com/algolia/docsearch/issues/1370 is tackled.

  @include media-breakpoint-up(lg) {
    padding-top: 4rem;
  }
}

.DocSearch-Button {
  --docsearch-searchbox-background: #{rgba($black, .1)};
  --docsearch-searchbox-color: #{$white};
  --docsearch-searchbox-focus-background: #{rgba($black, .25)};
  --docsearch-searchbox-shadow: #{0 0 0 .25rem rgba($bd-accent, .4)};
  --docsearch-text-color: #{$white};
  --docsearch-muted-color: #{rgba($white, .65)};

  width: 100%;
  height: 38px; // Match Bootstrap inputs
  margin: 0;
  border: 1px solid rgba($white, .4);
  @include border-radius(.375rem);

  .DocSearch-Search-Icon {
    opacity: .65;
  }

  &:active,
  &:focus,
  &:hover {
    border-color: rgba($bd-accent, 1);

    .DocSearch-Search-Icon {
      opacity: 1;
    }
  }

  @include media-breakpoint-down(lg) {
    &,
    &:hover,
    &:focus {
      background: transparent;
      border: 0;
      box-shadow: none;
    }
    &:focus {
      box-shadow: var(--docsearch-searchbox-shadow);
    }
  }
}

.DocSearch-Button-Keys,
.DocSearch-Button-Placeholder {
  @include media-breakpoint-down(lg) {
    display: none;
  }
}

.DocSearch-Button-Keys {
  min-width: 0;
  padding: .125rem .25rem;
  background: rgba($black, .25);
  @include border-radius(.25rem);
}

.DocSearch-Button-Key {
  top: 0;
  width: auto;
  height: 1.25rem;
  padding-right: .125rem;
  padding-left: .125rem;
  margin-right: 0;
  font-size: .875rem;
  background: none;
  box-shadow: none;
}

.DocSearch-Commands-Key {
  padding-left: 1px;
  font-size: .875rem;
  background-color: rgba($black, .1);
  background-image: none;
  box-shadow: none;
}

.DocSearch-Form {
  @include border-radius(var(--bs-border-radius));
}

.DocSearch-Hits {
  mark {
    padding: 0;
  }
}

.DocSearch-Hit {
  padding-bottom: 0;
  @include border-radius(0);

  a {
    @include border-radius(0);
    border: solid var(--bs-border-color);
    border-width: 0 1px 1px;
  }

  &:first-child a {
    @include border-top-radius(var(--bs-border-radius));
    border-top-width: 1px;
  }
  &:last-child a {
    @include border-bottom-radius(var(--bs-border-radius));
  }
}

.DocSearch-Hit-icon {
  display: flex;
  align-items: center;
}

// Fix --docsearch-logo-color that doesn't do anything
.DocSearch-Logo svg .cls-1,
.DocSearch-Logo svg .cls-2 {
  fill: var(--docsearch-logo-color);
}