rw-jsx-css

1.0.3 • Public • Published

rw-jsx-css

import { ref, effect } from 'rw-jsx';
import { style } from 'rw-jsx-css';

function App() {
    const colorRef = ref('#fff');
    effect(() => {
        h1Style.value.color = colorRef.value;
    });
    setTimeout(() => {
        colorRef.value = 'orange';
    }, 1000);
    return () => (
        <>
            <h1 class={[h1Style.name]}>Rw App</h1>
            <p>Color: {colorRef.value}</p>
        </>
    );
}
const h1Style = style`
    color: ${(props) => props.color || 'green'};
    bacground: "black";
    :hover {
        color: ${(props) => props.color || 'blue'};
    }
`;

Readme

Keywords

Package Sidebar

Install

npm i rw-jsx-css

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

17.8 kB

Total Files

5

Last publish

Collaborators

  • em00me