fela-plugin-fallback-value
I find its documentation misleading.rgba()
to static color, but as static color is added as the last item, it always wins.Hey all, so we are currently using fela with react and are now trying to split out our reusable components into an npm package and import them into our different apps. However I'm running into issues with exporting/importing these components, I’m assuming this is due to the fact there should only be one Provider/renderer?
Has anyone else been through this process or have any suggestions? Any help would be much appreciated!
createComponent(component)
from a separate npm package, into an app that is wrapped with Provider should work then? Because I'm currently receiving this error message: Uncaught Error: createComponent() can't render styles without the renderer in the context. Missing react-fela's <Provider /> at the app root?
Hi all, i'm new to Fela, and i learned how to use '<FelaComponent style={styles.example}>' to generate a styled div,
but i don't understand how can i use this Fela styling for all the nested html primitive elements. do i need to use <FelaComponent> for every <div> or element in my code?
here's an example. the outer 'div' is working, and the ':hover' effect will work,
but the inner div isn't working and i need to convert it also to <FelaComponent> ?
const styles = {
base: {
border: '5px solid red',
':hover': {
border: '5px solid green'
}
},
innerDiv: {
border: '5px solid red',
':hover': {
border: '5px solid green'
}
}
}
render(){
return (
<Fela style={styles.base}>
<div style={styles.innerDiv}>
{this.props.children}
</div>
</Fela>
);
}
so i found that i can use 'fe' , but it doesn't work with TS. files.
any idea why?
/* @jsx fe */
import { fe } from 'react-fela';
and it works in '.jsx' files, but with '.tsx' files i get the next error:
Type error: Module '"react-fela"' has no exported member 'fe'. TS2305
useFela
hook, and then do something like:
function Foo() {
const { css, theme, } = useFela();
return (<div style={css(wrapperStyle)}>
<div style={css(innerStyle)} />
</div>)
}
so this is as far as i got with this.
i created index.d.ts file and added:
/// <reference path="node\_modules/@types/react/index.d.ts"/>
declare namespace React {
interface HTMLAttributes<T> extends DOMAttributes<T> {
css?: any
}
}
but 'fe' is still not defined. i don't know what else can i do about this