Skip to content

Commit 535d074

Browse files
authored
fix: unwanted (min-)height: 1px (#6)
- treat `-webkit-fill-available` correctly - reorder declarations
1 parent abd2084 commit 535d074

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ const safeArea = plugin(({addUtilities, matchUtilities, theme}) => {
8787
accu[`${className}-offset`] = (x) =>
8888
Object.entries(propertyValue).reduce((accu, [property, value]) => {
8989
if (Array.isArray(value)) {
90-
accu[property] = value.map((v, i) => (i ? i : `calc(${v} + ${x})`))
90+
accu[property] = value.map((v) =>
91+
v === '-webkit-fill-available' ? v : `calc(${v} + ${x})`
92+
)
9193
} else {
9294
accu[property] = `calc(${value} + ${x})`
9395
}
@@ -108,7 +110,9 @@ const safeArea = plugin(({addUtilities, matchUtilities, theme}) => {
108110
accu[`${className}-or`] = (x) =>
109111
Object.entries(propertyValue).reduce((accu, [property, value]) => {
110112
if (Array.isArray(value)) {
111-
accu[property] = value.map((v, i) => (i ? i : `max(${v}, ${x})`))
113+
accu[property] = value.map((v, i) =>
114+
v === '-webkit-fill-available' ? v : `max(${v}, ${x})`
115+
)
112116
} else {
113117
accu[property] = `max(${value}, ${x})`
114118
}

0 commit comments

Comments
 (0)