comparison tests/dynClassB.ur @ 2121:f89be9cd2087

Support 'dynClass' and 'dynStyle' for <body>
author Adam Chlipala <adam@chlipala.net>
date Tue, 03 Mar 2015 15:55:00 -0500
parents
children
comparison
equal deleted inserted replaced
2120:e3a79066380d 2121:f89be9cd2087
1 style style1
2 style style2
3
4 fun main () : transaction page =
5 toggle <- source False;
6 return <xml>
7 <head>
8 <link rel="stylesheet" type="text/css" href="/style.css"/>
9 </head>
10 <body dynClass={b <- signal toggle;
11 return (if b then style1 else style2)}
12 dynStyle={b <- signal toggle;
13 return (if b then STYLE "margin: 100px" else STYLE "")}>
14 Body
15 <button onclick={fn _ => b <- get toggle; set toggle (not b)}>TOGGLE</button>
16 </body>
17 </xml>