ant-design/site/theme/template/Layout/Header/SearchBar.less
二货机器人 36bcaaef85
Add variable.less to support css variable (#31496)
* chore: use varaible.less

* chore: basic primary varaible

* chore: Move to variable

* chore: align active color

* chore: global fix of css variable

* chore: primary colors

* chore: button danger

* chore: btn default error color

* chore: button series

* chore: More examples

* chore: More components

* chore: Form demo

* chore: form style

* fix: Tag & Alert variable

* chore: update footer

* chore: rm tmp code

* chore: transfer

* fix: picker column active color

* chore: Adjust active bg color

* chore: table hover color

* chore: all css variables

* chore: Global using variables

* chore: Test case

* chore: Update test logic

* chore: back of default less

* chore: entry of site use proxy style

* chore: update entry

* chore: split of variables

* refactor: quick dist speed

* fix: site use variable version

* chore: Update less config

* chore: add mv script

* chore: Update repalcement script

* chore: Add inject variables

* chore: Update script

* fix: script path

* chore: Move to component instead

* chore: fix condition

* chore: update config

* chore: Update in less transform

* chore: Modify logic

* chore: change to variables

* chore: Update name

* fix: script name

* chore: do inject

* revert: back of path

* chore: 2 way of generate

* bump tools

* chore: Add auto replacement script

* chore: auto genrate less file

* chore: fix test

* test: More test case

* chore: Update limit config

* test: coverage

* docs: Update doc
2021-09-01 10:56:50 +08:00

188 lines
3.2 KiB
Plaintext

@import '../../../static/theme.less';
@import (reference) '../../../../../components/style/themes/variable.less';
@import './index.less';
@import './DocSearch.less';
@search-icon-color: #ced4d9;
#search-box {
position: relative;
display: flex;
flex: auto !important;
align-items: center;
height: 22px;
margin: 0 auto 0 0 !important;
padding-left: 16px;
line-height: 22px;
white-space: nowrap;
border-left: 1px solid @site-border-color-split;
transition: width 0.5s;
.keybindings {
cursor: pointer;
}
.keybinding {
color: @search-icon-color;
kbd {
display: inline-block;
width: 20px;
height: 20px;
padding: 0;
// better keybinding font display using `Arial`
font-family: Arial; /* stylelint-disable-line font-family-no-missing-generic-family-keyword */
text-align: center;
}
}
.ant-row-rtl & {
margin: 0 0 0 auto !important;
padding-right: 16px;
padding-left: 0;
border-right: 1px solid @site-border-color-split;
border-left: none;
}
> * {
flex: auto;
}
.anticon {
position: absolute;
top: 50%;
z-index: 1;
flex: none;
color: @search-icon-color;
transform: translateY(-50%);
pointer-events: none;
}
.ant-input-affix-wrapper {
background: transparent;
border: 0;
box-shadow: none;
}
input {
width: 100%;
max-width: 200px;
padding-left: 20px;
font-size: 14px;
background: transparent;
border: 0;
box-shadow: none;
.ant-row-rtl & {
padding-right: 20px;
padding-left: 11px;
}
&::placeholder {
color: #a3b1bf;
}
}
// ================ Narrow ================
&.narrow-mode {
flex: none !important;
width: 30px;
&:hover {
.anticon {
color: #a3b1bf;
}
}
.anticon {
right: 0;
left: auto;
.ant-row-rtl & {
right: auto;
left: 0;
}
}
input {
max-width: none;
padding-right: 20px;
padding-left: 11px;
cursor: pointer;
.ant-row-rtl & {
padding-right: 11px;
padding-left: 20px;
}
}
&.focused {
width: 500px;
.anticon {
color: @search-icon-color;
}
input {
cursor: text;
}
}
}
}
.component-select {
&.ant-select-dropdown {
font-size: 14px;
border: 0;
border-radius: 0;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}
.ant-select-dropdown-menu {
max-height: 200px;
}
.ant-select-dropdown-menu-item {
border-radius: 0 !important;
}
.ant-component-decs {
position: absolute;
right: 16px;
color: #aaa;
font-size: 12px;
.ant-row-rtl & {
right: auto;
left: 16px;
}
}
}
@media only screen and (max-width: @mobile-max-width) {
#search-box {
display: none;
}
}
.DocSearch {
font-family: @font-family;
}
#antd_algolia_search_modal {
// avoid the veritcal scrollbar(looks like a white block)
.DocSearch-Hit-title {
overflow-y: hidden;
mark {
padding: 0;
}
}
// reset original `box-shadow` style
.DocSearch-Footer {
box-shadow: none;
}
}
// customization DocSearch Modal component in light mode
body[data-theme='default'] #antd_algolia_search_modal {
.customDocSearch();
}