Skip to content

Commit

Permalink
fix: modify styles to follow new anchor api
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanenkoStud committed Aug 8, 2024
1 parent 36b54e6 commit d277f66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
10 changes: 7 additions & 3 deletions packages/kite-chat-component/src/kite-chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,13 @@ kite-context-menu {
anchor-name: --toggle;
}

.kite-dialog[popover] {
anchor-default: --toggle;
position-fallback: --flip;
[popover] {
position-anchor: --toggle;
bottom: calc(anchor(top) + var(--kite-gap));
top: auto;
left: auto;
right: anchor(right);
position-try: flip-block, flip-inline, flip-block flip-inline;
}

@media (max-width: 22rem) {
Expand Down
26 changes: 0 additions & 26 deletions packages/kite-chat-component/src/kite-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,6 @@ console.debug('kite-chat loaded');

const componentStyles = css`
${unsafeCSS(kiteChatStyles)}
@position-fallback --flip {
@try {
bottom: calc(anchor(top) + var(--gap));
top: auto;
left: auto;
right: anchor(right);
}
@try {
bottom: auto;
top: calc(anchor(bottom) + var(--gap));
left: auto;
right: anchor(right);
}
@try {
bottom: calc(anchor(top) + var(--gap));
top: auto;
left: anchor(left);
right: auto;
}
@try {
bottom: auto;
top: calc(anchor(bottom) + var(--gap));
left: anchor(left);
right: auto;
}
}
`;

const CUSTOM_EVENT_INIT = {
Expand Down

0 comments on commit d277f66

Please sign in to comment.