Skip to content

Commit

Permalink
fix: Live-sync should cleanup selectors and key frames if the last on…
Browse files Browse the repository at this point in the history
…es are removed
  • Loading branch information
CatchABus committed Apr 27, 2024
1 parent 58586b5 commit 7da3c08
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/ui/styling/style-scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,13 +480,15 @@ const loadCss = profile(`"style-scope".loadCss`, (cssModule: string): void => {
const { selectors, keyframes } = CSSSource.fromURI(cssModule);
let updated = false;

if (selectors.length > 0) {
// Check for existing application css selectors too in case the app is undergoing a live-sync
if (selectors.length > 0 || applicationCssSelectors.length > 0) {
applicationCssSelectors = selectors;
mergeCssSelectors();
updated = true;
}

if (keyframes.length > 0) {
// Check for existing application css keyframes too in case the app is undergoing a live-sync
if (keyframes.length > 0 || applicationCssKeyframes.length > 0) {
applicationCssKeyframes = keyframes;
mergeCssKeyframes();
updated = true;
Expand Down

0 comments on commit 7da3c08

Please sign in to comment.