This syntax is called “Brackethtml” it reduces the redundancy of HTML and still can be easily understood as HTML, in addition to supporting HTML normally.
Brackethtml already comes with a built-in CSS-in-JS library. In the previous examples, if we wanted to add some style to our button we could do:
constbtn=`button[color:blue; ~ Click me!]`;
Usage rules
The list below describes the usage rules:
The HTML tag name must be followed by square brackets:
constbtn=`button[]`;
The ~ symbol must be used inside tags that may contain children to separate attributes and CSS-in-JS from their children, and must be used between whitespace: