ybbond-reason

My old site written in ReasonReact
Log | Files | Refs | README | LICENSE | CC-LICENSE

Spoiler.re (599B)


      1 module Styles = {
      2   open Css;
      3 
      4   let summary =
      5     style([
      6       fontSize(`em(1.0)),
      7       marginTop(`em(1.0)),
      8       marginBottom(`em(1.0)),
      9       marginLeft(`px(0)),
     10       marginRight(`px(0)),
     11       flex(`num(1.0)),
     12       textAlign(`left),
     13       cursor(`pointer),
     14       userSelect(`none),
     15     ]);
     16 };
     17 
     18 type state = {isopen: bool};
     19 
     20 let initialState = {isopen: false};
     21 
     22 type action =
     23   | Toggle;
     24 
     25 [@react.component]
     26 let make = (~content: ReasonReact.reactElement, ~title: string) =>
     27   <details>
     28     <summary className=Styles.summary> {ReasonReact.string(title)} </summary>
     29     content
     30   </details>;