mediawiki-skins-Citizen/resources/skins.citizen.styles/Searchbox.less

252 lines
4.3 KiB
Plaintext
Raw Normal View History

#search {
2020-06-08 22:42:15 +00:00
&form {
position: absolute;
z-index: -1; // not interactable
margin: 7px 0 8px; // 1px h3 screen reader
display: flex;
top: 0;
right: @margin-side / 2;
opacity: 0;
.boxshadow(4);
2020-06-09 02:41:49 +00:00
border-radius: @border-radius-small;
2020-06-08 22:42:15 +00:00
transition: @transition-opacity;
pointer-events: none; // not clickable
&-icon {
position: absolute;
2020-06-09 02:36:45 +00:00
z-index: 110;
2020-06-09 01:58:35 +00:00
width: @search-bar-height;
2020-06-08 22:42:15 +00:00
height: @search-bar-height;
opacity: @opacity-icon;
2020-06-09 01:58:35 +00:00
background-size: 14px;
2020-06-08 22:42:48 +00:00
background-repeat: no-repeat;
background-position: center;
2020-06-08 22:42:15 +00:00
}
2020-06-09 01:58:35 +00:00
&-random {
position: absolute;
2020-06-09 02:36:45 +00:00
z-index: 120;
2020-06-09 01:58:35 +00:00
right: 38px;
width: @search-bar-height;
height: @search-bar-height;
opacity: @opacity-icon;
background-size: 18px;
background-repeat: no-repeat;
2020-06-09 01:59:02 +00:00
background-position: center;
transition: @transition-transform-quick, @transition-opacity-quick;
2020-06-09 01:58:35 +00:00
2020-06-09 01:59:02 +00:00
&:hover {
opacity: @opacity-icon-active;
transform: rotate( 30deg );
}
2020-06-09 01:58:35 +00:00
}
2020-06-08 22:42:15 +00:00
}
&-toggle {
right: 0; // align checkbox with icon
2020-06-08 22:42:15 +00:00
z-index: 21; // override to be on top of the form
&-icon {
2020-06-08 22:42:15 +00:00
position: relative;
z-index: 20; // stay on top of search form
display: flex;
align-items: center;
justify-content: center;
width: @icon-box-size + @margin-side + @icon-padding;
height: @header-height;
opacity: @opacity-icon;
transition: @transition-transform-quick, @transition-height-quick, @transition-opacity-quick, @transition-border-color-quick;
&-1 {
top: 7px;
left: 12px;
height: 10px;
transform: rotate( -45deg );
}
&-2 {
margin-top: -2px;
margin-left: -2px;
width: 10px;
height: 10px;
border: solid 2px @base-0;
border-radius: 100%;
transform: rotate( -45deg );
}
&-3 {
opacity: 0;
2020-06-07 05:31:34 +00:00
top: 0;
left: -7px;
2020-06-08 22:42:15 +00:00
height: 14px;
transform: rotate( -135deg );
}
&-1,
&-3 {
width: 2px;
background-color: @base-0;
}
}
&:checked {
~ #searchform {
z-index: 10;
opacity: 1;
pointer-events: auto; // clickable
#searchInput {
2020-06-08 22:42:15 +00:00
width: @search-bar-width;
}
}
~ #search-toggle-icon {
#search-toggle-icon {
&-2 {
border-color: transparent;
}
&-1 {
2020-06-08 22:42:15 +00:00
height: 14px;
2020-06-07 05:31:34 +00:00
transform: translate( -5px, -7px ) rotate( 135deg );
}
&-3 {
opacity: 1;
}
}
&:hover {
border-color: @base-0;
#search-toggle-icon-3 {
opacity: 0;
}
}
}
&:hover {
~ #search-toggle-icon {
#search-toggle-icon {
&-1 {
height: 12px;
2020-06-07 05:31:34 +00:00
transform: translate( -5px, -7px ) rotate( 135deg );
}
&-2 {
border-color: transparent;
}
&-3 {
height: 12px;
}
}
}
}
}
&:hover {
~ #search-toggle-icon {
opacity: @opacity-icon-active;
#search-toggle-icon {
&-1 {
height: 6px;
2020-06-07 05:31:34 +00:00
transform: translate( 2px, 2px ) rotate( -45deg );
}
}
}
}
}
&Input {
2020-06-09 02:36:45 +00:00
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
2020-06-09 02:36:45 +00:00
z-index: 100;
padding: 8px @icon-box-size + @icon-padding + @search-bar-height + @margin-side / 2 8px @search-bar-height;
width: 0;
2020-06-08 22:42:15 +00:00
height: @search-bar-height;
max-width: calc( ~'100vw -'@margin-side );
2020-06-09 02:36:45 +00:00
background: @base-100;
border: 1px solid @base-90;
2020-06-09 02:41:49 +00:00
border-radius: @border-radius-small;
transition: @transition-width, @transition-box-shadow;
&:focus {
outline: 0;
.boxshadow(5);
}
}
}
.search {
&-toggle-icon-div {
position: relative;
transition: inherit;
}
}
2020-06-10 05:17:49 +00:00
@media ( max-width: @search-bar-width ) {
2020-06-09 02:36:45 +00:00
#searchform:before {
2020-06-09 02:38:45 +00:00
content: '';
display: block;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: @base-100;
opacity: 0.9;
2020-06-09 02:36:45 +00:00
}
}
@media ( prefers-color-scheme: dark ) {
#search {
2020-06-08 22:42:15 +00:00
&form {
2020-06-09 01:58:35 +00:00
&-icon,
&-random {
2020-06-08 22:42:15 +00:00
opacity: 0.4;
2020-06-08 22:42:48 +00:00
filter: invert( 1 );
2020-06-08 22:42:15 +00:00
}
2020-06-09 01:58:35 +00:00
&-random:hover {
opacity: 0.6;
}
2020-06-08 22:42:15 +00:00
}
&-toggle {
&-icon {
opacity: 0.4;
&-2 {
border-color: @base-100;
}
&-1,
&-3 {
background: @base-100;
}
}
&:hover {
~ #search-toggle-icon {
opacity: 0.6;
}
}
}
&Input {
border-color: @dark-bg-60;
2020-06-09 02:36:45 +00:00
background: @dark-bg-50;
}
}
2020-06-07 05:31:34 +00:00
}
2020-06-09 02:36:45 +00:00
@media ( max-width: @search-bar-width ) and ( prefers-color-scheme: dark ) {
2020-06-09 02:36:45 +00:00
#searchform:before {
background: @dark-bg-50;
}
}