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

224 lines
5.1 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
}
}
}
2019-12-12 00:35:49 +00:00
#typeahead-suggestions {
position: relative;
z-index: 99999;
}
2019-12-11 23:56:07 +00:00
.suggestions-dropdown {
background: @base-100;
2019-12-11 20:29:15 +00:00
.boxshadow(4);
2019-12-12 00:22:50 +00:00
}
2019-12-12 00:13:20 +00:00
2019-12-12 00:22:50 +00:00
.suggestion-link {
display: block;
position: relative;
min-height: 2rem * @content-scaling;
padding: 1rem 1rem 1rem 8.5rem * @content-scaling;
}
2019-12-12 00:13:20 +00:00
2019-12-12 00:22:50 +00:00
.suggestion-title {
margin: 0 0 0.78rem * @content-scaling 0;
2019-12-12 00:38:22 +00:00
color: @base-10;
2019-12-12 00:22:50 +00:00
font-size: 1.6rem * @content-scaling;
2019-12-12 00:38:22 +00:00
font-weight: 400;
2019-12-12 00:22:50 +00:00
line-height: 1.872rem * @content-scaling;
}
.suggestion-link.active .suggestion-title {
color: @accent-50;
}
.suggestion-highlight {
2019-12-12 00:38:22 +00:00
font-weight: 600;
font-style: normal;
2019-12-12 00:22:50 +00:00
}
.suggestion-description {
color: @base-30;
margin: 0;
2019-12-12 00:34:14 +00:00
font-family: @fonts;
2019-12-12 00:22:50 +00:00
font-size: 1.3rem * @content-scaling;
line-height: 1.43rem * @content-scaling;
}
.suggestion-link.active {
background-color: @accent-90;
}
/* using element selector to override default anchor styles */
a.suggestion-link:hover {
text-decoration: none;
}
.suggestion-thumbnail {
2019-12-12 00:34:14 +00:00
background-color: @base-80;
2019-12-12 00:22:50 +00:00
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
height: 100%;
width: 7rem * @content-scaling;
position: absolute;
top: 0;
left: 0;
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
}