linaria
linaria copied to clipboard
Support For Solidjs
Solidjs framework is A faster React Alternative..
This repository may be used as a reference to implement a CSS in JS implementation in SolidJS. https://github.com/solidjs/solid-styled-components
Hey everyone! FYI I'm working on this.
Basically it all nails down to building a new processor, mostly similar to StyledProcessor
in @linaria/react
. I'm already able to transpile html tags down to pure jsx-components, which can then be passed to babel-preset-solid
that transpiles them to pure dom/ssr templates.
So it's working for html tags (styled.div
) but I'm having troubles with anonymous components wrapped directly in styled
(e.g. styled(() => <div></div>)
), they just disappear from the output even with the base @linaria/react
, the body is replaced with a simple () => {}
.
Additionally, I think I'd need some help with understanding where/how things like const _exp = () => ....
are generated. Currently, all interpolations are replaced with such functions, example:
`
color: ${props => props.color};
`
is transpiled to
const _exp = () => props => props.color
and _exp
can then be called directly in the body of the newly generated component this way:
const style = {
'--sdfds-0': _exp()(props)
}
Do you see the extra call? I'd like to know if it's possible to hook into generation of these _exp
s.
Additionally, I'd like to know if you'd merge this to the repo as a separate package? (similar to atomic package)
@raveclassic it will be a long story :) Can you message me in TG @anber_ru?
Really want to use linaria with Solid.js. Any updates on this?
@victorteokw, we have a test library. I'll try to make a PR tomorrow.
Many thanks @usmanyunusov 🎉
PR: #1096
@usmanyunusov @raveclassic nu kak tam s dengami? I can help with solid btw Check demo with astro + solid: https://github.com/callstack/linaria/pull/1118
@MrFoxPro I've updated the PR and added a simple demo https://github.com/callstack/linaria/pull/1096