mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-12 09:21:11 +00:00
bd83398659
Creates a new skins.vector.search module that replaces the searchSuggest module from MediaWiki core. This module creates a new Vue app using the WVUI search widget for the new search experience. The legacy search input form is still retains on pageload, and the new search kicks on search input focus. In order to manage that transition, the legacy search input is styled to resemble the new WVUI input, and the new input is manually focused after the component mounts. Vue is also added as a dev-dependency to help with type-checking. Other changes: * the entry in skin.json is reordered alphabetically after skins.vector.js Bug: T264355 Change-Id: Ibb9561a77a14734297cb4d0ddcd415fc0750b45d
43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
@import 'SearchBox.less';
|
|
|
|
/**
|
|
* Minimal styling for initial no-JS server-rendered
|
|
* search form, which gets replaced by WVUI on focus.
|
|
* Most values are hard-coded since they aim to
|
|
* mimic WVUI-specific variables and disable the ResourceLoader LESS transformation of `calc`.
|
|
*/
|
|
|
|
// Parent class can be removed when $wgVectorUseCoreSearch is no longer supported.
|
|
.skin-vector-search-vue {
|
|
// Position search in header.
|
|
#searchInput {
|
|
padding-left: 36px;
|
|
font-size: inherit;
|
|
.transition( none );
|
|
|
|
// Recreate WVUI expanding input.
|
|
&:focus {
|
|
position: relative;
|
|
// Use ~ and fixed values to disable the LESS transformation in ResourceLoader LESS implementation
|
|
padding-left: ~'calc(12px + 2.57142857em + 12px)';
|
|
width: ~'calc( 100% + 24px )';
|
|
left: ~'calc( -1 * 24px )';
|
|
}
|
|
}
|
|
|
|
// Move & resize search icon to match WVUI.
|
|
#searchButton {
|
|
top: 0;
|
|
right: auto;
|
|
left: 0;
|
|
width: 36px;
|
|
min-height: 36px;
|
|
background-size: 20px auto;
|
|
}
|
|
|
|
// Reposition search icon for expanded input.
|
|
#searchInput:focus ~ #searchButton {
|
|
left: -9px;
|
|
}
|
|
}
|