FIX: Adjust button styling when custom text is used (#45)
This commit is contained in:
parent
b0b6448e7c
commit
5fb25748da
|
|
@ -74,7 +74,7 @@ $max-width: 600px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn.search-icon {
|
.btn.search-icon:not(.has-search-button-text) {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|
@ -91,6 +91,22 @@ $max-width: 600px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.btn.search-icon.has-search-button-text {
|
||||||
|
order: 2;
|
||||||
|
margin-left: 0.5em;
|
||||||
|
column-gap: 0.5em;
|
||||||
|
background-color: var(--tertiary);
|
||||||
|
color: var(--secondary);
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--tertiary-hover);
|
||||||
|
}
|
||||||
|
.d-icon {
|
||||||
|
color: var(--secondary);
|
||||||
|
}
|
||||||
|
+ .search-input #search-term[type="text"] {
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.search-input .btn.search-context {
|
.search-input .btn.search-context {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
||||||
|
|
@ -108,18 +108,23 @@ export default apiInitializer("1.14.0", (api) => {
|
||||||
this.state.showHeaderResults === true;
|
this.state.showHeaderResults === true;
|
||||||
let contents = [];
|
let contents = [];
|
||||||
|
|
||||||
|
let buttonClass =
|
||||||
|
I18n.t(themePrefix("search_banner.search_button_text")) === ""
|
||||||
|
? "btn search-icon"
|
||||||
|
: "btn search-icon has-search-button-text";
|
||||||
|
|
||||||
if (formFactor === "widget") {
|
if (formFactor === "widget") {
|
||||||
contents.push(
|
contents.push(
|
||||||
this.attach("link", {
|
this.attach("link", {
|
||||||
href: this.fullSearchUrl({ expanded: true }),
|
href: this.fullSearchUrl({ expanded: true }),
|
||||||
contents: () => [
|
contents: () => [
|
||||||
|
iconNode("search"),
|
||||||
h(
|
h(
|
||||||
"span",
|
"span",
|
||||||
I18n.t(themePrefix("search_banner.search_button_text"))
|
I18n.t(themePrefix("search_banner.search_button_text"))
|
||||||
),
|
),
|
||||||
iconNode("search"),
|
|
||||||
],
|
],
|
||||||
className: "btn search-icon",
|
className: buttonClass,
|
||||||
title: "search.open_advanced",
|
title: "search.open_advanced",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue