1.2.6 • Published 8 months ago

rw-jsx v1.2.6

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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

8 months ago

1.2.6

8 months ago

1.2.5

8 months ago

1.2.4

8 months ago

1.2.3

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.0.62

9 months ago

1.0.61

9 months ago

1.0.60

9 months ago

1.0.66

9 months ago

1.0.65

9 months ago

1.0.64

9 months ago

1.0.63

9 months ago

1.0.69

9 months ago

1.0.68

9 months ago

1.1.0-beta.0

9 months ago

1.1.8-beta.0

8 months ago

1.0.73

9 months ago

1.0.72

9 months ago

1.0.71

9 months ago

1.0.70

9 months ago

1.0.74

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.1.9

8 months ago

1.1.8

8 months ago

1.1.7

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

9 months ago

1.0.59

9 months ago

1.0.58

9 months ago

1.0.57

9 months ago

1.0.56

9 months ago

1.0.55

9 months ago

1.0.54

9 months ago

1.0.53

9 months ago

1.0.52

9 months ago

1.0.22

9 months ago

1.0.25

9 months ago

1.0.24

9 months ago

1.0.23

9 months ago

1.0.29

9 months ago

1.0.28

9 months ago

1.0.27

9 months ago

1.0.33

9 months ago

1.0.32

9 months ago

1.0.31

9 months ago

1.0.30

9 months ago

1.0.37

9 months ago

1.0.36

9 months ago

1.0.35

9 months ago

1.0.34

9 months ago

1.0.39

9 months ago

1.0.38

9 months ago

1.0.40

9 months ago

1.0.44

9 months ago

1.0.43

9 months ago

1.0.42

9 months ago

1.0.48

9 months ago

1.0.47

9 months ago

1.0.46

9 months ago

1.0.45

9 months ago

1.0.49

9 months ago

1.0.51

9 months ago

1.0.50

9 months ago

1.0.19

9 months ago

1.0.18

9 months ago

1.0.16

9 months ago

1.0.9

9 months ago

1.0.11

9 months ago

1.0.21

9 months ago

1.0.10

9 months ago

1.0.20

9 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.8

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago