mediawiki-skins-Citizen/resources/components/search.less

183 lines
4.3 KiB
Plaintext
Raw Normal View History

2019-08-15 17:40:13 +00:00
//
// Citizen - Search Styles
// https://starcitizen.tools
//
// TODO: Make it configurable and flexible
#site-search {
2019-12-11 20:29:15 +00:00
#search-form {
2019-08-15 17:40:13 +00:00
position: absolute;
2019-12-11 20:29:15 +00:00
z-index: -1; // Not interactable
margin: 7px 0 8px; // 1px h3 screen reader
top: 0;
right: @icon-box-size + @icon-padding * 2;
2019-08-15 17:40:13 +00:00
opacity: 0;
2019-12-11 20:29:15 +00:00
.boxshadow(4);
transition: @transition-opacity;
2019-08-15 17:40:13 +00:00
2019-12-11 20:29:15 +00:00
// Search field
#search-input {
2019-12-11 20:29:15 +00:00
padding: 12px 15px;
width: 0;
max-width: calc(~"100vw -"@icon-box-size * 2 + @icon-padding * 4 + @margin-side );
border: 1px solid @base-90;
transition: @transition-width, @transition-box-shadow;
&:focus {
outline: 0;
.boxshadow(5);
}
2019-08-15 17:40:13 +00:00
}
2019-12-11 20:29:15 +00:00
// Search field button
2019-12-11 21:06:51 +00:00
#search-button {
2019-12-11 20:29:15 +00:00
.button-blue;
width: @icon-box-size + @icon-padding * 2;
height: 41px;
border: 0;
cursor: pointer; //somehow it is not pointer
&:hover,
&:active,
&:focus {
.button-blue-active;
}
2019-08-15 17:40:13 +00:00
}
2019-12-11 20:29:15 +00:00
}
2019-08-15 17:40:13 +00:00
2019-12-11 20:40:59 +00:00
#search-toggle-icon-container {
2019-12-11 20:29:15 +00:00
display: flex;
align-items: center;
justify-content: center;
height: inherit;
2019-12-11 20:40:59 +00:00
#search-toggle-icon {
2019-12-11 20:29:15 +00:00
opacity: @opacity-icon;
position: absolute;
margin-top: -2px;
margin-left: -2px;
width: 10px;
height: 10px;
border: solid 2px @base-0;
border-radius: 100%;
transform: rotate(-45deg);
transition: @transition-transform,
@transition-height,
@transition-opacity,
@transition-border-color;
&:before,
&:after {
content: '';
position: absolute;
width: 2px;
background-color: @base-0;
transition: inherit;
}
2019-08-15 17:40:13 +00:00
2019-12-11 20:29:15 +00:00
&:before {
top: 10px;
left: 3px;
height: 10px;
}
2019-08-15 17:40:13 +00:00
&:after {
2019-12-11 20:29:15 +00:00
opacity: 0;
top: -1px;
left: 4px;
height: 18px;
transform: rotate(-90deg);
2019-08-15 17:40:13 +00:00
}
}
2019-12-11 20:29:15 +00:00
}
2019-08-15 17:40:13 +00:00
2019-12-11 20:40:59 +00:00
#search-toggle {
2019-12-11 20:29:15 +00:00
&:checked {
~#search-form {
z-index: 5;
opacity: 1;
#search-input {
2019-12-11 20:29:15 +00:00
width: 400px;
}
}
2019-08-15 17:40:13 +00:00
2019-12-11 20:40:59 +00:00
~#search-toggle-icon-container #search-toggle-icon {
2019-12-11 20:29:15 +00:00
border-color: transparent;
&:before {
height: 18px;
transform: translate(1px, -11px);
}
&:after {
opacity: 1;
}
&:hover {
2019-12-11 20:40:59 +00:00
~#search-toggle-icon-container #search-toggle-icon {
2019-12-11 20:29:15 +00:00
border-color: @base-0;
&:after {
opacity: 0;
}
}
}
}
&:hover {
2019-12-11 20:40:59 +00:00
~#search-toggle-icon-container #search-toggle-icon {
2019-12-11 20:29:15 +00:00
border-color: @base-0;
&:after {
height: 12px;
}
}
}
2019-08-15 17:40:13 +00:00
}
2019-12-11 20:29:15 +00:00
&:hover {
2019-12-11 20:40:59 +00:00
~#search-toggle-icon-container #search-toggle-icon {
2019-12-11 20:29:15 +00:00
opacity: @opacity-icon-active;
2019-08-15 17:40:13 +00:00
2019-12-11 20:29:15 +00:00
&:before {
height: 5px;
transform: translate(0px, 5px);
}
}
2019-08-15 17:40:13 +00:00
}
}
}
.suggestions {
2019-12-11 20:29:15 +00:00
.boxshadow(4);
2019-08-15 17:40:13 +00:00
2019-12-11 20:29:15 +00:00
.suggestions-results {
border: 0;
2019-08-15 17:40:13 +00:00
2019-12-11 20:29:15 +00:00
.suggestions-result {
padding: @margin-side / 2 15px;
}
2019-08-15 17:40:13 +00:00
}
2019-12-11 20:29:15 +00:00
.suggestions-special {
padding: @margin-side / 2 15px;
border: 0;
background-color: @base-90;
}
2019-08-15 17:40:13 +00:00
2019-12-11 20:29:15 +00:00
.suggestions-result-current {
background-color: @accent-10;
}
2019-08-15 17:40:13 +00:00
}
// RTL tweaks
.rtl {
2019-12-11 20:29:15 +00:00
#site-search {
#search-form {
left: @icon-box-size + @margin-side + @icon-padding;
right: unset;
}
2019-08-15 17:40:13 +00:00
}
2019-12-11 20:29:15 +00:00
}