mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-01 00:34:27 +03:00
e2907d9ba2
* Use elm-css 16.0.0 * 💀 Ui.Checkbox V1 and V2 * s/Css.Foreign/Css.Global/g * 💀 Nri.Ui.Styles.V1 * 💀 BannerAlert.V1 * 💀 Modal.V1 * 💀 Dropdown.V1 * 💀 Select.V1 and V2 * 💀 Alert.V1 * 💀 Button.V1 and V2 * 💀 Divider.V1 * 💀 Icon.V1 and V2 * 💀 Outline.V1 * 💀 SegmentedControl.V1-V5 * 💀 TextArea.V1 and V2 * 💀 TextInput.V1 * delete the rest of the modules * actually more deletions * InputStyles v1 is unused * move to src-0.18 * do the 0.19 upgrade * select options are addressable by index * elm-css 16 * update scripts * elm-format * Update V2.elm * put the nbsp back * elm-format validation for both versions
50 lines
1.2 KiB
Elm
50 lines
1.2 KiB
Elm
module DEPRECATED.Nri.Ui.Styles.V2 exposing (Keyframe, keyframes, toString)
|
|
|
|
{-| DEPRECATED. Once we are on elm-css 15.1.0 or later, we should use its
|
|
built-in keyframe functionality.
|
|
|
|
|
|
### Keyframe animations
|
|
|
|
@docs Keyframe, keyframes, toString
|
|
|
|
-}
|
|
|
|
|
|
{-| A CSS keyframe animation that will have vendor prefixes automatically added.
|
|
-}
|
|
type Keyframe
|
|
= CompiledKeyframe String
|
|
|
|
|
|
{-| Create a CSS keyframe animation with appropriate vendor prefixes
|
|
-}
|
|
keyframes : String -> List ( String, String ) -> Keyframe
|
|
keyframes name stops =
|
|
let
|
|
stop ( when, what ) =
|
|
when ++ " {" ++ what ++ "}"
|
|
|
|
x prefix =
|
|
"@"
|
|
++ prefix
|
|
++ "keyframes "
|
|
++ name
|
|
++ " {\n"
|
|
++ String.join "\n" (List.map stop stops)
|
|
++ "\n}\n"
|
|
in
|
|
[ "-webkit-", "-moz-", "" ]
|
|
|> List.map x
|
|
|> String.join ""
|
|
|> CompiledKeyframe
|
|
|
|
|
|
{-| Turn a [`Keyframe`](#Keyframe) into a string that can be included in a CSS stylesheet.
|
|
-}
|
|
toString : Keyframe -> String
|
|
toString keyframe =
|
|
case keyframe of
|
|
CompiledKeyframe compiled ->
|
|
compiled
|