@stories-js/core
Version:
Stories web components to build stories
169 lines (152 loc) • 3.89 kB
CSS
:host {
/**
* @prop --background: Background of the tab button
* @prop --background-focused: Background of the tab button when focused with the tab key
* @prop --background-focused-opacity: Opacity of the tab button background when focused with the tab key
*
* @prop --color: Color of the tab button
* @prop --color-focused: Color of the tab button when focused with the tab key
* @prop --color-selected: Color of the selected tab button
*
* @prop --padding-top: Top padding of the tab button
* @prop --padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the tab button
* @prop --padding-bottom: Bottom padding of the tab button
* @prop --padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the tab button
*/
--background-focused-opacity: 1;
align-items: center;
justify-content: center;
height: 100%;
outline: none;
background: pink;
/*var(--background);*/
color: var(--color);
}
.button-native {
border-radius: inherit;
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 0;
padding-left: var(--padding-start);
padding-right: var(--padding-end);
padding-top: var(--padding-top);
padding-bottom: var(--padding-bottom);
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;
display: flex;
position: relative;
flex-direction: inherit;
align-items: inherit;
justify-content: inherit;
height: 100%;
border: 0;
outline: none;
background: transparent;
text-decoration: none;
cursor: pointer;
overflow: hidden;
box-sizing: border-box;
-webkit-user-drag: none;
}
@supports (margin-inline-start: 0) or (-webkit-margin-start: 0) {
.button-native {
padding-left: unset;
padding-right: unset;
-webkit-padding-start: var(--padding-start);
padding-inline-start: var(--padding-start);
-webkit-padding-end: var(--padding-end);
padding-inline-end: var(--padding-end);
}
}
.button-native::after {
left: 0;
right: 0;
top: 0;
bottom: 0;
position: absolute;
content: "";
opacity: 0;
}
.button-inner {
display: flex;
position: relative;
flex-flow: inherit;
align-items: inherit;
justify-content: inherit;
height: 100%;
z-index: 1;
}
:host(.stories-focused) .button-native {
color: var(--color-focused);
}
:host(.stories-focused) .button-native::after {
background: var(--background-focused);
opacity: var(--background-focused-opacity);
}
@media (any-hover: hover) {
a:hover {
color: var(--color-selected);
}
}
:host(.tab-selected) {
color: var(--color-selected);
}
:host(.tab-hidden) {
/* stylelint-disable-next-line declaration-no-important */
display: none ;
}
:host(.tab-disabled) {
pointer-events: none;
opacity: 0.4;
}
::slotted(stories-label),
::slotted(stories-icon) {
display: block;
align-self: center;
max-width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
box-sizing: border-box;
}
::slotted(stories-label) {
order: 0;
}
::slotted(stories-icon) {
order: -1;
height: 1em;
}
:host(.tab-has-label-only) ::slotted(stories-label) {
white-space: normal;
}
::slotted(stories-badge) {
box-sizing: border-box;
position: absolute;
z-index: 1;
}
:host(.tab-layout-icon-start) {
flex-direction: row;
}
:host(.tab-layout-icon-end) {
flex-direction: row-reverse;
}
:host(.tab-layout-icon-bottom) {
flex-direction: column-reverse;
}
:host(.tab-layout-icon-hide) ::slotted(stories-icon) {
display: none;
}
:host(.tab-layout-label-hide) ::slotted(stories-label) {
display: none;
}