0.11.16 • Published 2 years ago

jsvn v0.11.16

Weekly downloads
31
License
MIT
Repository
github
Last release
2 years ago

JavaScript Views Notation

is a library for describing views using a combination of markup and styles

Features

  • Supports view inheritance
  • Prevents style mixing between components and libraries, controls css-class dependencies
  • Unifies html, css and js
  • Unifies templates, allowing you to create templates using React, pure HTML or other renders
  • Uses pure ES2020 without transpiles unlike JSX

Documentation

https://jsvn.dev

Example

import $$, { View } from 'jsvn';

const MyView = new View({
    //CSS (static) styles
    background: '#eee',
    width: '200px',
    textAlign: 'center',

    //Inline (dynamic) style
    color: m=>m.myColor,

    //Child nodes
    //Node based on "<div></div>" tag (base by default)
    [$$`my-title`]: {
        //Text node (simplified notation)
        $$: 'JSVN Example',
    },

    //Node based on "<input/>" tag
    [$$`my-input `('/input')]: {
        _bind: [m=>m.myText, m=>m.setMyText],
    },

    [$$(IF)]: m=>m.myText, //Condition for rendering
    [$$()]: {//Unnamed node based on "<div></div>" tag (base by default, equal to "[$$('<>div')]")
        fontFamily: 'Tahoma, sans-serif',

        //Text node
        [$$()]: 'Hello ',

        //Unnamed node based on "<span></span>" tag
        [$$('<>span')]: {
            fontWeight : 'bold',

            //Text node with dynamic text
            $$: m=>`${m.myText}!`,
        },
    },
});
0.11.15

2 years ago

0.11.16

2 years ago

0.11.11

2 years ago

0.11.12

2 years ago

0.11.13

2 years ago

0.11.14

2 years ago

0.11.9

2 years ago

0.11.10

2 years ago

0.11.8

3 years ago

0.11.6

3 years ago

0.11.7

3 years ago

0.11.3

3 years ago

0.11.4

3 years ago

0.11.5

3 years ago

0.11.0

3 years ago

0.10.1

3 years ago

0.11.1

3 years ago

0.11.2

3 years ago

0.10.0

3 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.0

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.3

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.4.2

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.2.2

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.2

5 years ago

0.1.3

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago