Skip to content

Commit bc67013

Browse files
committed
Fix CSS for search
1 parent a1841dd commit bc67013

File tree

1 file changed

+53
-122
lines changed

1 file changed

+53
-122
lines changed

docusaurus/src/scss/custom-search-bar.scss

Lines changed: 53 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -17,155 +17,86 @@
1717
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.04);
1818
font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
1919

20-
.DocSearch.DocSearch-Button:hover {
21-
box-shadow: none;
22-
}
23-
24-
.DocSearch.DocSearch-Button,
25-
.kapa-widget-button {
20+
// Base style for both buttons
21+
> div,
22+
> button {
2623
font-size: var(--strapi-font-size-sm);
27-
line-height: var(--strapi-font-size-sm);
24+
line-height: var(--strapi-line-height-sm);
2825
flex: 1 1 50%;
2926
height: 34px !important;
30-
}
31-
32-
.DocSearch.DocSearch-Button {
3327
background-color: transparent;
34-
width: 65%;
3528
border: none;
36-
justify-content: flex-start;
29+
cursor: pointer;
30+
padding: 0 12px;
3731
margin: 0;
38-
border-radius: 4px 0 0 4px;
39-
position: relative;
40-
padding-left: 12px;
41-
padding-right: 0;
42-
border-right: solid 1px var(--strapi-neutral-200);
43-
32+
color: var(--strapi-neutral-400);
33+
font-weight: 500;
34+
display: flex;
35+
align-items: center;
36+
4437
&:hover {
4538
color: var(--strapi-primary-600);
46-
border-radius: 4px 0 0 4px;
47-
48-
.DocSearch-Button-Placeholder::before {
49-
content:'\E30C';
50-
color: var(--strapi-neutral-500) !important;
51-
}
5239
}
5340
}
5441

55-
.DocSearch-Button-Placeholder {
56-
font-size: var(--strapi-font-size-sm);
57-
line-height: var(--strapi-line-height-sm);
58-
padding-left: 0;
59-
color: var(--strapi-neutral-400);
60-
font-weight: 500;
61-
// left: -16px;
62-
position: relative;
42+
// Specific search button (div with DocSearch classes)
43+
.DocSearch.DocSearch-Button {
44+
border-right: solid 1px var(--strapi-neutral-200);
45+
border-radius: 4px 0 0 4px;
46+
justify-content: flex-start;
6347

64-
&::before {
65-
content: '\E30C';
66-
font-family: "Phosphor";
67-
color: var(--strapi-neutral-500);
68-
margin-right: 6px;
69-
font-size: 16px;
70-
position: relative;
71-
top: 2px;
48+
.DocSearch-Button-Container {
49+
display: flex;
50+
align-items: center;
51+
width: 100%;
52+
53+
.DocSearch-Button-Placeholder {
54+
font-size: var(--strapi-font-size-sm);
55+
line-height: var(--strapi-line-height-sm);
56+
color: inherit;
57+
position: relative;
58+
59+
&::before {
60+
content: '\E30C';
61+
font-family: "Phosphor";
62+
color: var(--strapi-neutral-500);
63+
margin-right: 6px;
64+
font-size: 16px;
65+
position: relative;
66+
top: 2px;
67+
}
68+
}
7269
}
7370

7471
&:hover {
75-
color: var(--strapi-primary-600);
72+
.DocSearch-Button-Placeholder::before {
73+
color: var(--strapi-primary-600);
74+
}
7675
}
7776
}
7877

79-
.DocSearch-Search-Icon {
80-
display: none;
81-
}
82-
83-
.DocSearch-Button-Keys {
84-
display: none;
85-
// min-width: 30px;
86-
// position: relative;
87-
// top: 1px;
88-
// font-size: 1rem;
89-
90-
// .DocSearch-Button-Key {
91-
// color: var(--strapi-neutral-500);
92-
// box-shadow: none;
93-
// background: none;
94-
// border-radius: 0;
95-
// padding: 0;
96-
// margin-right: 0;
97-
// width: 10px;
98-
// }
99-
}
100-
101-
10278
button.kapa-widget-button {
103-
border: none;
104-
padding: 0 0 0 12px;
105-
width: 100%;
106-
height: 36px;
107-
overflow: visible;
108-
cursor: pointer;
109-
position: relative;
110-
border-radius: 0 6px 6px 0;
111-
background: transparent;
112-
text-align: left;
113-
114-
/* inherit font & color from ancestor */
115-
color: var(--strapi-neutral-400);
116-
font: inherit;
117-
font-size: .95rem;
118-
font-weight: 500;
119-
120-
/* Normalize `line-height`. Cannot be changed from `normal` in Firefox 4+. */
121-
line-height: normal;
122-
123-
/* Corrects font smoothing for webkit */
124-
-webkit-font-smoothing: inherit;
125-
-moz-osx-font-smoothing: inherit;
126-
127-
/* Corrects inability to style clickable `input` types in iOS */
128-
-webkit-appearance: none;
129-
/* Remove excess padding and border in Firefox 4+ */
130-
&::-moz-focus-inner {
131-
border: 0;
132-
padding: 0;
133-
}
134-
135-
svg {
136-
position: relative;
137-
left: 6px;
138-
top: 3px;
139-
width: 18px;
140-
height: 18px;
141-
fill: var(--strapi-neutral-500);
142-
}
143-
79+
border-radius: 0 4px 4px 0;
80+
14481
.kapa-widget-button-text {
145-
position: relative;
82+
display: flex;
83+
align-items: center;
14684
font-size: var(--strapi-font-size-sm);
14785
line-height: var(--strapi-line-height-sm);
148-
top: 1px;
86+
color: inherit;
14987

15088
i {
15189
margin-right: 6px;
15290
color: var(--strapi-neutral-500) !important;
153-
}
154-
155-
@media screen and (max-width: 996px){
156-
left: 12px;
91+
font-size: 16px;
92+
position: relative;
93+
top: 1px;
15794
}
15895
}
15996

160-
&:hover,
161-
&:active {
162-
.kapa-widget-button-text {
163-
color: var(--strapi-primary-600);
164-
}
165-
button {
166-
svg {
167-
fill: var(--strapi-primary-600);
168-
}
97+
&:hover {
98+
.kapa-widget-button-text i {
99+
color: var(--strapi-primary-600) !important;
169100
}
170101
}
171102
}
@@ -187,7 +118,7 @@
187118
.kapa-widget-button-text {
188119
display: none;
189120
}
190-
.kapa-widget-button {
121+
button.kapa-widget-button {
191122
border-radius: 50%;
192123
padding: 0;
193124
padding-right: 4px;
@@ -201,4 +132,4 @@
201132
border: var(--strapi-input-border);
202133
color: var(--strapi-dark-100);
203134
}
204-
}
135+
}

0 commit comments

Comments
 (0)