1.2.6 • Published 9 months ago

rw-jsx v1.2.6

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

rw-jsx

npm init rw-jsx <project-name || null>
npm create rw-jsx <project-name || null>
npm i -g rw-jsx-cli [create || null] <project-name || null>

index.jsx

import { createNode } from 'rw-jsx';
import { style } from 'rw-jsx-css';
import './index.css';
import { App } from './src/App';

const appStyle = style`
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
`;
const app = createNode(<div class={appStyle.name} />);
document.body.appendChild(app);
render(<App />, app);

App.jsx

import { ref } from 'rw-jsx';
import { style } from 'rw-jsx-css';
import viteLogo from '/vite.svg';

export function App() {
    const countRef = ref(0);
    return () => (
        <>
            <div class={logoContainer.name}>
                <a href='https://vitejs.dev' target='_blank'>
                    <img src={viteLogo} class={[logo.name]} alt='Vite logo' />
                </a>
                <a href='https://www.npmjs.com/package/rw-jsx' target='_blank'>
                    <h1 class={[logo.name, rw.name]}>Rw</h1>
                </a>
            </div>
            <h1>Vite + Rw</h1>
            <h3>
                <a
                    class={vitePluginStyle.name}
                    href='https://www.npmjs.com/package/vite-plugins-rw-jsx'
                    target='_blank'>
                    vite-plugins-rw-jsx
                </a>
            </h3>
            <div class={card.name}>
                <button onClick={() => countRef.value++}>count is {countRef.value}</button>
                <p>
                    Edit <code>src/App.jsx</code> and save to test HMR
                </p>
            </div>
            <p class={readTheDocs.name}>Click on the Vite and Rw logos to learn more</p>
        </>
    );
}
const vitePluginStyle = style`
    color: #888;
    transition: .2s;
    font-weight: bold;
    text-decoration: underline;
    :hover{
        color: #FFFFFFFF;
        filter: drop-shadow(0 0 .5em #FFFFFFAA);
        background: #14141449;
        padding: .8em;
        border-radius: .8em;
    }
`;
const logoContainer = style`
    display: flex;
    align-items: center;
    justify-content: center;
`;
const logo = style`
    height: 6em;
    padding: 1.5em;
    transition: .2s;
    :hover{
        filter: drop-shadow(0 0 2em #646cffaa);
    }
`;
const rw = style`
    height: 1em;
    margin: 0;
    padding: 0;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bolder;
    text-decoration-line: underline;
    text-decoration-color: #ddd;
    user-select: none;
    font-style: italic;
    :hover{
        filter: drop-shadow(0 0 .5em #ffffff);
    }
    color: #ddd;
`;
const card = style`
    padding: 2em;
`;

const readTheDocs = style`
    color: #888;
`;
1.2.0

9 months ago

1.2.6

9 months ago

1.2.5

9 months ago

1.2.4

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.0.62

10 months ago

1.0.61

10 months ago

1.0.60

10 months ago

1.0.66

10 months ago

1.0.65

10 months ago

1.0.64

10 months ago

1.0.63

10 months ago

1.0.69

10 months ago

1.0.68

10 months ago

1.1.0-beta.0

9 months ago

1.1.8-beta.0

9 months ago

1.0.73

10 months ago

1.0.72

10 months ago

1.0.71

10 months ago

1.0.70

10 months ago

1.0.74

10 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.0.59

10 months ago

1.0.58

10 months ago

1.0.57

10 months ago

1.0.56

10 months ago

1.0.55

10 months ago

1.0.54

10 months ago

1.0.53

10 months ago

1.0.52

10 months ago

1.0.22

10 months ago

1.0.25

10 months ago

1.0.24

10 months ago

1.0.23

10 months ago

1.0.29

10 months ago

1.0.28

10 months ago

1.0.27

10 months ago

1.0.33

10 months ago

1.0.32

10 months ago

1.0.31

10 months ago

1.0.30

10 months ago

1.0.37

10 months ago

1.0.36

10 months ago

1.0.35

10 months ago

1.0.34

10 months ago

1.0.39

10 months ago

1.0.38

10 months ago

1.0.40

10 months ago

1.0.44

10 months ago

1.0.43

10 months ago

1.0.42

10 months ago

1.0.48

10 months ago

1.0.47

10 months ago

1.0.46

10 months ago

1.0.45

10 months ago

1.0.49

10 months ago

1.0.51

10 months ago

1.0.50

10 months ago

1.0.19

10 months ago

1.0.18

10 months ago

1.0.16

10 months ago

1.0.9

10 months ago

1.0.11

10 months ago

1.0.21

10 months ago

1.0.10

10 months ago

1.0.20

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.8

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago