(* Copyright 2015 Google Inc.
Copyright 2016, 2017 Benjamin Barenblat
Licensed under the Apache License, Version 2.0 (the “License”); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License. *)
style stackingContext
fun inNewStackingContext x =
{x}
(* TODO(bbaren): Support attributes in the arguments. *)
fun page p =
(* Disable tap highlight on IE. *)
(* Color the status bar on mobile devices. *)
{p.Head}
{p.Body}
structure AppBar = struct
style bar
style title
fun make t =
{[t]}
end
structure Checkbox = struct
style checkbox
style checked
style container
style ink
(* Pixel dimensions of the checkbox. If you update these, you must also
update the CSS file. *)
val width = 24
val height = 24
fun centeredAtXY x y : css_style =
let
val x' = x - width / 2
val y' = y - width / 2
in
oneProperty (oneProperty
noStyle
(value (property "left") (atom (show x' ^ "px"))))
(value (property "top") (atom (show y' ^ "px")))
end
fun inkAnimation (s : source (option {X : int, Y : int})) =
| Some xy => )
}
/>
val make c onChange =
s <- source c;
inkCenter <- source None;
return (inNewStackingContext
{inkAnimation inkCenter}
set inkCenter (Some {X = click.ClientX, Y = click.ClientY});
c <- get s;
let
val c' = not c
in
set s c';
onChange c'
end
}
>
)
end
structure List = struct
structure SingleLine = struct
style element
style icon
style list
fun make es =