@stories-js/core
Version:
Stories web components to build stories
137 lines (126 loc) • 3.36 kB
CSS
:host {
/**
* @prop --background: Background of the searchbar input
* @prop --box-shadow: Box shadow of the searchbar input
* @prop --border-radius: Border radius of the searchbar input
* @prop --cancel-button-color: Color of the searchbar cancel button
* @prop --clear-button-color: Color of the searchbar clear button
* @prop --color: Color of the searchbar text
* @prop --icon-color: Color of the searchbar icon
* @prop --placeholder-color: Color of the searchbar placeholder
* @prop --placeholder-font-style: Font style of the searchbar placeholder
* @prop --placeholder-font-weight: Font weight of the searchbar placeholder
* @prop --placeholder-opacity: Opacity of the searchbar placeholder
*/
--placeholder-color: initial;
--placeholder-font-style: initial;
--placeholder-font-weight: initial;
--placeholder-opacity: .5;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: flex;
position: relative;
align-items: center;
width: 100%;
color: var(--color);
font-family: var(--stories-font-family, inherit);
box-sizing: border-box;
}
:host(.stories-color) {
color: var(--stories-color-contrast);
}
:host(.stories-color) .searchbar-input {
background: var(--stories-color-base);
}
:host(.stories-color) .searchbar-clear-button,
:host(.stories-color) .searchbar-cancel-button,
:host(.stories-color) .searchbar-search-icon {
color: inherit;
}
.searchbar-search-icon {
color: var(--icon-color);
pointer-events: none;
}
.searchbar-input-container {
display: block;
position: relative;
flex-shrink: 1;
width: 100%;
}
.searchbar-input {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
letter-spacing: inherit;
text-decoration: inherit;
text-indent: inherit;
text-overflow: inherit;
text-transform: inherit;
text-align: inherit;
white-space: inherit;
color: inherit;
border-radius: var(--border-radius);
display: block;
width: 100%;
border: 0;
outline: none;
background: var(--background);
font-family: inherit;
box-shadow: var(--box-shadow);
box-sizing: border-box;
appearance: none;
}
.searchbar-input::placeholder {
color: var(--placeholder-color);
font-family: inherit;
font-style: var(--placeholder-font-style);
font-weight: var(--placeholder-font-weight);
opacity: var(--placeholder-opacity);
}
.searchbar-input::-webkit-search-cancel-button, .searchbar-input::-ms-clear {
display: none;
}
.searchbar-cancel-button {
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
display: none;
height: 100%;
border: 0;
outline: none;
color: var(--cancel-button-color);
cursor: pointer;
appearance: none;
}
.searchbar-cancel-button > div {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.searchbar-clear-button {
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
padding-bottom: 0;
display: none;
min-height: 0;
outline: none;
color: var(--clear-button-color);
appearance: none;
}
:host(.searchbar-has-value.searchbar-should-show-clear) .searchbar-clear-button {
display: block;
}
:host(.searchbar-disabled) {
cursor: default;
opacity: 0.4;
pointer-events: none;
}