Skip to content

Commit

Permalink
update dimension warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Feb 23, 2021
1 parent 3cb86a1 commit e798e9c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/LayerCake.svelte
Expand Up @@ -188,12 +188,11 @@
b.left = $padding.left;
b.width = b.right - b.left;
b.height = b.bottom - b.top;
if (b.width < 0 && b.height < 0) {
console.error('[LayerCake] Target div has negative width and height. Did you forget to set a width or height on the container?');
} else if (b.width < 0) {
console.error('[LayerCake] Target div has a negative width. Did you forget to set that CSS on the container?');
} else if (b.height < 0) {
console.error('[LayerCake] Target div has negative height. Did you forget to set that CSS on the container?');
if (b.width <= 0) {
console.error('[LayerCake] Target div has zero or negative width. Did you forget to set an explicit width in CSS on the container?');
}
if (b.height <= 0) {
console.error('[LayerCake] Target div has zero or negative height. Did you forget to set an explicit height in CSS on the container?');
}
return b;
});
Expand Down

0 comments on commit e798e9c

Please sign in to comment.