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

323 lines
5.9 KiB
Plaintext
Raw Normal View History

2021-01-11 17:13:59 +00:00
.search-container {
position: relative;
}
#search {
&-checkbox {
&:checked {
~ #searchform {
z-index: 10;
pointer-events: auto; // clickable
2021-04-17 01:07:53 +00:00
transform: none;
}
~ #search-toggle-icon {
#search-toggle-icon {
&-2 {
border-color: transparent;
}
&-1 {
height: 14px;
transform: translate3d( -5px, -7px, 0 ) 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;
transform: translate3d( -5px, -7px, 0 ) rotate( 135deg );
}
&-2 {
border-color: transparent;
}
&-3 {
height: 12px;
}
&-1,
&-3 {
background-color: var( --background-color-icon--hover );
}
}
}
}
&:active {
~ #search-toggle-icon {
#search-toggle-icon {
&-1,
&-3 {
background-color: var( --background-color-icon--active );
}
}
}
}
}
}
2020-06-08 22:42:15 +00:00
&form {
position: absolute;
z-index: -1; // not interactable
top: 0;
right: @margin-side / 2;
display: flex;
margin: 7px 0 8px; // 1px h3 screen reader
2020-06-09 02:41:49 +00:00
border-radius: @border-radius-small;
2020-06-08 22:42:15 +00:00
pointer-events: none; // not clickable
2021-04-17 01:07:53 +00:00
transform: translateX( 120% );
transition: @transition-transform-quick;
.boxshadow(4);
2020-06-08 22:42:15 +00:00
&-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;
2020-06-08 22:42:48 +00:00
background-position: center;
background-repeat: no-repeat;
background-size: 14px;
2021-01-14 17:20:15 +00:00
opacity: var( --opacity-icon-base );
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;
2020-06-09 01:59:02 +00:00
background-position: center;
background-repeat: no-repeat;
background-size: 18px;
2021-01-14 17:20:15 +00:00
opacity: var( --opacity-icon-base );
2020-06-09 01:59:02 +00:00
transition: @transition-transform-quick, @transition-opacity-quick;
2020-06-09 01:58:35 +00:00
2020-06-09 01:59:02 +00:00
&:hover {
2021-01-14 17:20:15 +00:00
opacity: var( --opacity-icon-base--hover );
2020-06-09 01:59:02 +00:00
transform: rotate( 30deg );
}
2021-01-14 17:20:15 +00:00
&:active {
opacity: var( --opacity-icon-base--active );
}
2020-06-09 01:58:35 +00:00
}
2020-06-08 22:42:15 +00:00
}
&-toggle {
position: absolute;
2020-06-08 22:42:15 +00:00
z-index: 21; // override to be on top of the form
right: 0; // align checkbox with icon
width: ~'calc( var( --width-button-corner ) - 10px )';
height: var( --height-header );
&-icon {
2020-06-08 22:42:15 +00:00
position: relative;
z-index: 20; // stay on top of search form
display: flex;
width: var( --width-button-base );
height: var( --height-header );
align-items: center;
justify-content: center;
margin-right: 10px;
transition: @transition-transform-quick, @transition-height-quick, @transition-opacity-quick, @transition-border-color-quick;
&-1 {
top: 7px;
left: 12px;
2021-01-16 05:12:01 +00:00
height: 8px;
transform: rotate( -45deg );
}
&-2 {
width: 10px;
height: 10px;
/* Use background-color variable because it is a part of the logo */
border: solid 2px var( --background-color-icon );
2021-01-16 04:56:33 +00:00
margin-top: -4px;
margin-left: -2px;
border-radius: 100%;
transform: rotate( -45deg );
}
&-3 {
2020-06-07 05:31:34 +00:00
top: 0;
left: -7px;
2020-06-08 22:42:15 +00:00
height: 14px;
opacity: 0;
transform: rotate( -135deg );
}
&-1,
&-3 {
width: 2px;
background-color: var( --background-color-icon );
}
}
&:hover {
~ #search-toggle-icon {
#search-toggle-icon {
&-1 {
height: 6px;
background-color: var( --background-color-icon--hover );
transform: translate3d( 2px, 2px, 0 ) rotate( -45deg );
}
&-2 {
border-color: var( --background-color-icon--hover );
}
}
}
}
&:active {
~ #search-toggle-icon {
#search-toggle-icon {
&-1 {
background-color: var( --background-color-icon--active );
}
&-2 {
border-color: var( --background-color-icon--active );
}
}
}
}
}
&Input {
2020-06-09 02:36:45 +00:00
z-index: 100;
2021-04-17 01:07:53 +00:00
width: @search-bar-width;
2020-06-08 22:42:15 +00:00
max-width: calc( ~'100vw -'@margin-side );
height: @search-bar-height;
padding: 8px @icon-box-size + @icon-padding + @search-bar-height + @margin-side / 2 8px @search-bar-height;
border: 1px solid var( --border-color-base--lighter );
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: var( --background-color-dp-03 );
2020-06-09 02:41:49 +00:00
border-radius: @border-radius-small;
2021-04-17 01:07:53 +00:00
transition: @transition-background-quick, @transition-box-shadow-quick;
&:focus {
background-color: var( --background-color-dp-08 );
outline: 0;
.boxshadow(5);
}
}
}
.search {
&-toggle-icon-div {
position: relative;
border-radius: @border-radius-large;
transition: inherit;
}
}
// RTL styles
.rtl {
#search {
&form {
/* @noflip */
right: unset !important;
/* @noflip */
left: 10px !important;
}
&-toggle {
&-icon {
&-1 {
transform: rotate( 45deg );
}
&-2 {
transform: rotate( 45deg );
}
&-3 {
transform: rotate( 135deg );
}
}
&:checked {
~ #search-toggle-icon {
#search-toggle-icon {
&-1 {
transform: translate3d( -5px, -7px, 0 ) rotate( -135deg );
}
}
}
&:hover {
~ #search-toggle-icon {
#search-toggle-icon {
&-1 {
transform: translate3d( -5px, -7px, 0 ) rotate( -135deg );
}
}
}
}
}
&:hover {
~ #search-toggle-icon {
#search-toggle-icon {
&-1 {
transform: translate3d( 2px, 2px, 0 ) rotate( 45deg );
}
}
}
}
}
}
}
.skin-citizen-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:48 +00:00
filter: invert( 1 );
2020-06-09 01:58:35 +00:00
}
2020-06-08 22:42:15 +00:00
}
}
2020-06-07 05:31:34 +00:00
}
2020-06-09 02:36:45 +00:00
@media ( max-width: @search-bar-width ) {
#search {
2021-04-17 01:12:10 +00:00
&form {
transition: none; // no transition on mobile
2021-04-17 01:12:10 +00:00
&:before {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
background: var( --background-color-dp-03 );
content: '';
opacity: 0.9;
}
}
2020-06-09 02:36:45 +00:00
}
}