danieldelcore / trousers

hooks-first CSS-in-JS library, focused on semantics and runtime performance
https://danieldelcore.github.io/trousers/
MIT License
302 stars 6 forks source link

Dynamic expressions that return different values are hashed the same way #79

Open danieldelcore opened 4 years ago

danieldelcore commented 4 years ago
function getGap({ space }: Theme) {
        const column = columnGap ? space[columnGap] : space[gap];
        const row = rowGap ? space[rowGap] : space[gap];

        return `${row} ${column}`;
    }

    return (
        <div
            css={css<Theme>`
                display: grid;
                grid-template-columns: repeat(${columns}, 1fr);
                gap: ${getGap};
                width: 100%;
            `}
        >
            {children}
        </div>
    );