mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { css } from 'lit';
|
|
import componentStyles from '../../styles/component.styles.js';
|
|
|
|
export default css`
|
|
${componentStyles}
|
|
|
|
:host {
|
|
--arrow-color: var(--wa-color-black);
|
|
--arrow-size: var(--wa-tooltip-arrow-size);
|
|
|
|
/*
|
|
* These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant
|
|
* 0.7071 is derived from sin(45), which is the diagonal size of the arrow's container after rotating.
|
|
*/
|
|
--arrow-size-diagonal: calc(var(--arrow-size) * 0.7071);
|
|
--arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size));
|
|
|
|
display: contents;
|
|
}
|
|
|
|
.popup {
|
|
position: absolute;
|
|
isolation: isolate;
|
|
max-width: var(--auto-size-available-width, none);
|
|
max-height: var(--auto-size-available-height, none);
|
|
}
|
|
|
|
.popup--fixed {
|
|
position: fixed;
|
|
}
|
|
|
|
.popup:not(.popup--active) {
|
|
display: none;
|
|
}
|
|
|
|
.popup__arrow {
|
|
position: absolute;
|
|
width: calc(var(--arrow-size-diagonal) * 2);
|
|
height: calc(var(--arrow-size-diagonal) * 2);
|
|
rotate: 45deg;
|
|
background: var(--arrow-color);
|
|
z-index: -1;
|
|
}
|
|
`;
|