Default's declarations are now processed and merged even when there is no tailwind base directive included in the stylesheet. Without this applying tailwind utilities in css modules would break if they relied on defaults rules. Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
17 lines
361 B
JavaScript
17 lines
361 B
JavaScript
export function defaults(target, ...sources) {
|
|
for (let source of sources) {
|
|
for (let k in source) {
|
|
if (!target?.hasOwnProperty?.(k)) {
|
|
target[k] = source[k]
|
|
}
|
|
}
|
|
|
|
for (let k of Object.getOwnPropertySymbols(source)) {
|
|
if (!target?.hasOwnProperty?.(k)) {
|
|
target[k] = source[k]
|
|
}
|
|
}
|
|
}
|
|
|
|
return target
|
|
}
|