survivejs / site

survivejs.com
https://survivejs.com/
Other
68 stars 22 forks source link

Try Emotion #79

Closed sapegin closed 6 years ago

sapegin commented 6 years ago

I’m still trying to understand how to make styles extraction work ;-/

bebraw commented 6 years ago

It might be easier to test this against the simple demo at antwar repository. I wonder if the build process works against style extraction here. It generates a big site bundle before generating individual pages.

sapegin commented 6 years ago

The problem is it doesn’t work with dynamic styles, so even ${t.space.xl} doesn’t work. I need to investigate what option we have.

bebraw commented 6 years ago

Ah, right. They suggest using CSS variables for dynamic bits.

sapegin commented 6 years ago

But they are not dynamic from the run time point of view ;-) I guess we can make another plugin to inline theme variables. Another problem is props — we’ll probably have to split these components into multiple.

sapegin commented 6 years ago

Now I need to solve the modifiers issue (<Panel prev>, <Panel next>).

sapegin commented 6 years ago

@bebraw How do you like it now? Static extraction works fine as long as you don’t use any dynamic content like functions. But you may use theme.

I’ll extract Babel plugin to a separate package.

sapegin commented 6 years ago

I guess it’s done and works quite well. What do you think?

bebraw commented 6 years ago

Really nice work. I think eventually we should push components like this to https://github.com/survivejs-sites/components and implement a style guide. Nice, isolated, and reusable.

sapegin commented 6 years ago

Yeah, that wood be good ;-)