mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-09-22 12:48:43 +03:00
Merge pull request #161 from NoRedInk/styles-v2
Add DEPRECATED.Nri.Ui.Styles.V2
This commit is contained in:
commit
be8047e1de
@ -7,6 +7,7 @@
|
||||
"src"
|
||||
],
|
||||
"exposed-modules": [
|
||||
"DEPRECATED.Nri.Ui.Styles.V2",
|
||||
"Nri.Ui.Alert.V1",
|
||||
"Nri.Ui.Alert.V2",
|
||||
"Nri.Ui.AssetPath",
|
||||
|
49
src/DEPRECATED/Nri/Ui/Styles/V2.elm
Normal file
49
src/DEPRECATED/Nri/Ui/Styles/V2.elm
Normal file
@ -0,0 +1,49 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user