Brian Teague

Results 19 comments of Brian Teague

Luke, here are a couple alternatives: Just a simple counter is the fastest solution possible. ```javascript let count = 0; const className = 'csz-' + count++; ``` A perfect hash...

@Profesor08 See my reply for https://github.com/cristianbote/goober/issues/387 The current workaround is to refactor your code to move different hover values into the children instead of the parent. Ideally, you don't want...

@cristianbote There is definitely different behavior here. Just so we can compare apples and oranges, I cloned @Profesor08 example using styled-components instead of goober to compare functionality: https://codesandbox.io/s/react-goober-forked-ynd84?file=/src/index.js You can...

So it looks like StyledComponents doesn't cache it's CSS or maybe only cache per component? Since every styled component has a unique class, this allows you to use the same...

@Profesor08 A hacky workaround that I tested is to put in some dummy css to force the template strings to be different between Link and Button. This will generate unique...

@cristianbote This makes total sense when you think about it like instances of an object class. Each styled component is its own class: Link, Button, Tab, etc. You don't want...

@Profesor08 Okay, so **caching at the style level still doesn't work because** Two components with the exact same styles will always generate the exact same hash and end up with...

@Profesor08 Looks like it works as intended now assuming @cristianbote doesn't have any concerns with my PR. https://codesandbox.io/s/react-goober-forked-3vnqd

@cristianbote I opened PR #401 which reduces the bundle size and also fixes this issue.

@cristianbote Agreed, per my last comment on the closed PR: "I think we can state the library is working as designed unless you want to implement a way to generate...