Define CSS transitions.
import Css exposing (..)
import Css.Transitions exposing (easeInOut, transition)
import Html
import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (css)
{-| In this case we are specifying a transition such that:
- When the backgroundColor changes will interpolate between the current value and
the new value over 1000 milliseconds with no delay and a default (ease) easing function
- When the transform changes will interpolate between the current value and the
new value over 500 milliseconds with no delay and an easeInOut easing function
We are then using the `hover` function to specify that the backgroundColor and transform change on hover
-}
primaryButton =
styled button
[ backgroundColor (rgb 241 241 241)
, transform (scaleX 1)
, hover
[ backgroundColor (rgb 220 220 220)
, transform (scaleX 1.2)
]
, transition
[ Css.Transitions.backgroundColor 1000
, Css.Transitions.transform3 500 0 easeInOut
]
]This function is used to batch up a list of supplied transitions that have been created (using the property functions listed below) and then produce a Css.Style.
This can then be used with other functions (such as Html.Styled.Attributes.css) to add the desired transitions to elements / classes as required.
These functions are used to specify the CSS timing function which describes how the animation speeds up or slows down over time.
CSS ease timing function
CSS linear timing function
CSS easeIn timing function
CSS easeOut timing function
CSS easeInOut timing function
CSS stepStart timing function
CSS stepEnd timing function
CSS cubicBezier timing function
These functions are used to create a transition, generally they come in three flavours, allowing you to specify:
An example of this would be the background3, background2 and background functions
Create a Transition for the background
property specifying only the duration
Create a Transition for the background
property specifying duration and delay
Create a Transition for the background
property specifying duration, delay and timing function
Create a Transition for the background-color
property specifying only the duration
Create a Transition for the background-color
property specifying duration and delay
Create a Transition for the background-color
property specifying duration, delay and timing function
Create a Transition for the background-position
property specifying only the duration
Create a Transition for the background-position
property specifying duration and delay
Create a Transition for the background-position
property specifying duration, delay and timing function
Create a Transition for the background-size
property specifying only the duration
Create a Transition for the background-size
property specifying duration and delay
Create a Transition for the background-size
property specifying duration, delay and timing function
Create a Transition for the border
property specifying only the duration
Create a Transition for the border
property specifying duration and delay
Create a Transition for the border
property specifying duration, delay and timing function
Create a Transition for the border-bottom
property specifying only the duration
Create a Transition for the border-bottom
property specifying duration and delay
Create a Transition for the border-bottom
property specifying duration, delay and timing function
Create a Transition for the border-bottom-color
property specifying only the duration
Create a Transition for the border-bottom-color
property specifying duration and delay
Create a Transition for the border-bottom-color
property specifying duration, delay and timing function
Create a Transition for the border-bottom-left-radius
property specifying only the duration
Create a Transition for the border-bottom-left-radius
property specifying duration and delay
Create a Transition for the border-bottom-left-radius
property specifying duration, delay and timing function
Create a Transition for the border-bottom-right-radius
property specifying only the duration
Create a Transition for the border-bottom-right-radius
property specifying duration and delay
Create a Transition for the border-bottom-right-radius
property specifying duration, delay and timing function
Create a Transition for the border-bottom-width
property specifying only the duration
Create a Transition for the border-bottom-width
property specifying duration and delay
Create a Transition for the border-bottom-width
property specifying duration, delay and timing function
Create a Transition for the border-color
property specifying only the duration
Create a Transition for the border-color
property specifying duration and delay
Create a Transition for the border-color
property specifying duration, delay and timing function
Create a Transition for the border-left
property specifying only the duration
Create a Transition for the border-left
property specifying duration and delay
Create a Transition for the border-left
property specifying duration, delay and timing function
Create a Transition for the border-left-color
property specifying only the duration
Create a Transition for the border-left-color
property specifying duration and delay
Create a Transition for the border-left-color
property specifying duration, delay and timing function
Create a Transition for the border-left-width
property specifying only the duration
Create a Transition for the border-left-width
property specifying duration and delay
Create a Transition for the border-left-width
property specifying duration, delay and timing function
Create a Transition for the border-radius
property specifying only the duration
Create a Transition for the border-radius
property specifying duration and delay
Create a Transition for the border-radius
property specifying duration, delay and timing function
Create a Transition for the border-right
property specifying only the duration
Create a Transition for the border-right
property specifying duration and delay
Create a Transition for the border-right
property specifying duration, delay and timing function
Create a Transition for the border-right-color
property specifying only the duration
Create a Transition for the border-right-color
property specifying duration and delay
Create a Transition for the border-right-color
property specifying duration, delay and timing function
Create a Transition for the border-right-width
property specifying only the duration
Create a Transition for the border-right-width
property specifying duration and delay
Create a Transition for the border-right-width
property specifying duration, delay and timing function
Create a Transition for the border-top
property specifying only the duration
Create a Transition for the border-top
property specifying duration and delay
Create a Transition for the border-top
property specifying duration, delay and timing function
Create a Transition for the border-top-color
property specifying only the duration
Create a Transition for the border-top-color
property specifying duration and delay
Create a Transition for the border-top-color
property specifying duration, delay and timing function
Create a Transition for the border-top-left-radius
property specifying only the duration
Create a Transition for the border-top-left-radius
property specifying duration and delay
Create a Transition for the border-top-left-radius
property specifying duration, delay and timing function
Create a Transition for the border-top-right-radius
property specifying only the duration
Create a Transition for the border-top-right-radius
property specifying duration and delay
Create a Transition for the border-top-right-radius
property specifying duration, delay and timing function
Create a Transition for the border-top-width
property specifying only the duration
Create a Transition for the border-top-width
property specifying duration and delay
Create a Transition for the border-top-width
property specifying duration, delay and timing function
Create a Transition for the border-width
property specifying only the duration
Create a Transition for the border-width
property specifying duration and delay
Create a Transition for the border-width
property specifying duration, delay and timing function
Create a Transition for the bottom
property specifying only the duration
Create a Transition for the bottom
property specifying duration and delay
Create a Transition for the bottom
property specifying duration, delay and timing function
Create a Transition for the box-shadow
property specifying only the duration
Create a Transition for the box-shadow
property specifying duration and delay
Create a Transition for the box-shadow
property specifying duration, delay and timing function
Create a Transition for the caret-color
property specifying only the duration
Create a Transition for the caret-color
property specifying duration and delay
Create a Transition for the caret-color
property specifying duration, delay and timing function
Create a Transition for the clip
property specifying only the duration
Create a Transition for the clip
property specifying duration and delay
Create a Transition for the clip
property specifying duration, delay and timing function
Create a Transition for the clip-path
property specifying only the duration
Create a Transition for the clip-path
property specifying duration and delay
Create a Transition for the clip-path
property specifying duration, delay and timing function
Create a Transition for the color
property specifying only the duration
Create a Transition for the color
property specifying duration and delay
Create a Transition for the color
property specifying duration, delay and timing function
Create a Transition for the column-count
property specifying only the duration
Create a Transition for the column-count
property specifying duration and delay
Create a Transition for the column-count
property specifying duration, delay and timing function
Create a Transition for the column-gap
property specifying only the duration
Create a Transition for the column-gap
property specifying duration and delay
Create a Transition for the column-gap
property specifying duration, delay and timing function
Create a Transition for the column-rule
property specifying only the duration
Create a Transition for the column-rule
property specifying duration and delay
Create a Transition for the column-rule
property specifying duration, delay and timing function
Create a Transition for the column-rule-color
property specifying only the duration
Create a Transition for the column-rule-color
property specifying duration and delay
Create a Transition for the column-rule-color
property specifying duration, delay and timing function
Create a Transition for the column-rule-width
property specifying only the duration
Create a Transition for the column-rule-width
property specifying duration and delay
Create a Transition for the column-rule-width
property specifying duration, delay and timing function
Create a Transition for the column-width
property specifying only the duration
Create a Transition for the column-width
property specifying duration and delay
Create a Transition for the column-width
property specifying duration, delay and timing function
Create a Transition for the columns
property specifying only the duration
Create a Transition for the columns
property specifying duration and delay
Create a Transition for the columns
property specifying duration, delay and timing function
Create a Transition for the filter
property specifying only the duration
Create a Transition for the filter
property specifying duration and delay
Create a Transition for the filter
property specifying duration, delay and timing function
Create a Transition for the flex
property specifying only the duration
Create a Transition for the flex
property specifying duration and delay
Create a Transition for the flex
property specifying duration, delay and timing function
Create a Transition for the flex-basis
property specifying only the duration
Create a Transition for the flex-basis
property specifying duration and delay
Create a Transition for the flex-basis
property specifying duration, delay and timing function
Create a Transition for the flex-grow
property specifying only the duration
Create a Transition for the flex-grow
property specifying duration and delay
Create a Transition for the flex-grow
property specifying duration, delay and timing function
Create a Transition for the flex-shrink
property specifying only the duration
Create a Transition for the flex-shrink
property specifying duration and delay
Create a Transition for the flex-shrink
property specifying duration, delay and timing function
Create a Transition for the font
property specifying only the duration
Create a Transition for the font
property specifying duration and delay
Create a Transition for the font
property specifying duration, delay and timing function
Create a Transition for the font-size
property specifying only the duration
Create a Transition for the font-size
property specifying duration and delay
Create a Transition for the font-size
property specifying duration, delay and timing function
Create a Transition for the font-size-adjust
property specifying only the duration
Create a Transition for the font-size-adjust
property specifying duration and delay
Create a Transition for the font-size-adjust
property specifying duration, delay and timing function
Create a Transition for the font-size-stretch
property specifying only the duration
Create a Transition for the font-stretch
property specifying duration and delay
Create a Transition for the font-stretch
property specifying duration, delay and timing function
Create a Transition for the font-variation-settings
property specifying only the duration
Create a Transition for the font-variation-settings
property specifying duration and delay
Create a Transition for the font-variation-settings
property specifying duration, delay and timing function
Create a Transition for the font-weight
property specifying only the duration
Create a Transition for the font-weight
property specifying duration and delay
Create a Transition for the font-weight
property specifying duration, delay and timing function
Create a Transition for the grid-column-gap
property specifying only the duration
Create a Transition for the grid-column-gap
property specifying duration and delay
Create a Transition for the grid-column-gap
property specifying duration, delay and timing function
Create a Transition for the grid-gap
property specifying only the duration
Create a Transition for the grid-gap
property specifying duration and delay
Create a Transition for the grid-gap
property specifying duration, delay and timing function
Create a Transition for the grid-row-gap
property specifying only the duration
Create a Transition for the grid-row-gap
property specifying duration and delay
Create a Transition for the grid-row-gap
property specifying duration, delay and timing function
Create a Transition for the height
property specifying only the duration
Create a Transition for the height
property specifying duration and delay
Create a Transition for the height
property specifying duration, delay and timing function
Create a Transition for the left
property specifying only the duration
Create a Transition for the left
property specifying duration and delay
Create a Transition for the left
property specifying duration, delay and timing function
Create a Transition for the letter-spacing
property specifying only the duration
Create a Transition for the letter-spacing
property specifying duration and delay
Create a Transition for the letter-spacing
property specifying duration, delay and timing function
Create a Transition for the line-height
property specifying only the duration
Create a Transition for the line-height
property specifying duration and delay
Create a Transition for the line-height
property specifying duration, delay and timing function
Create a Transition for the margin
property specifying only the duration
Create a Transition for the margin
property specifying duration and delay
Create a Transition for the margin
property specifying duration, delay and timing function
Create a Transition for the margin-bottom
property specifying only the duration
Create a Transition for the margin-bottom
property specifying duration and delay
Create a Transition for the margin-bottom
property specifying duration, delay and timing function
Create a Transition for the margin-left
property specifying only the duration
Create a Transition for the margin-left
property specifying duration and delay
Create a Transition for the margin-left
property specifying duration, delay and timing function
Create a Transition for the margin-right
property specifying only the duration
Create a Transition for the margin-right
property specifying duration and delay
Create a Transition for the margin-right
property specifying duration, delay and timing function
Create a Transition for the margin-top
property specifying only the duration
Create a Transition for the margin-top
property specifying duration and delay
Create a Transition for the margin-top
property specifying duration, delay and timing function
Create a Transition for the mask
property specifying only the duration
Create a Transition for the mask
property specifying duration and delay
Create a Transition for the mask
property specifying duration, delay and timing function
Create a Transition for the mask-position
property specifying only the duration
Create a Transition for the mask-position
property specifying duration and delay
Create a Transition for the mask-position
property specifying duration, delay and timing function
Create a Transition for the mask-size
property specifying only the duration
Create a Transition for the mask-size
property specifying duration and delay
Create a Transition for the mask-size
property specifying duration, delay and timing function
Create a Transition for the max-height
property specifying only the duration
Create a Transition for the max-height
property specifying duration and delay
Create a Transition for the max-height
property specifying duration, delay and timing function
Create a Transition for the max-width
property specifying only the duration
Create a Transition for the max-width
property specifying duration and delay
Create a Transition for the max-width
property specifying duration, delay and timing function
Create a Transition for the min-height
property specifying only the duration
Create a Transition for the min-height
property specifying duration and delay
Create a Transition for the min-height
property specifying duration, delay and timing function
Create a Transition for the min-width
property specifying only the duration
Create a Transition for the min-width
property specifying duration and delay
Create a Transition for the min-width
property specifying duration, delay and timing function
Create a Transition for the object-position
property specifying only the duration
Create a Transition for the object-position
property specifying duration and delay
Create a Transition for the object-position
property specifying duration, delay and timing function
Create a Transition for the offset
property specifying only the duration
Create a Transition for the offset
property specifying duration and delay
Create a Transition for the offset
property specifying duration, delay and timing function
Create a Transition for the offset-anchor
property specifying only the duration
Create a Transition for the offset-anchor
property specifying duration and delay
Create a Transition for the offset-anchor
property specifying duration, delay and timing function
Create a Transition for the offset-distance
property specifying only the duration
Create a Transition for the offset-distance
property specifying duration and delay
Create a Transition for the offset-distance
property specifying duration, delay and timing function
Create a Transition for the offset-path
property specifying only the duration
Create a Transition for the offset-path
property specifying duration and delay
Create a Transition for the offset-path
property specifying duration, delay and timing function
Create a Transition for the offset-rotate
property specifying only the duration
Create a Transition for the offset-rotate
property specifying duration and delay
Create a Transition for the offset-rotate
property specifying duration, delay and timing function
Create a Transition for the opacity
property specifying only the duration
Create a Transition for the opacity
property specifying duration and delay
Create a Transition for the opacity
property specifying duration, delay and timing function
Create a Transition for the order
property specifying only the duration
Create a Transition for the order
property specifying duration and delay
Create a Transition for the order
property specifying duration, delay and timing function
Create a Transition for the outline
property specifying only the duration
Create a Transition for the outline
property specifying duration and delay
Create a Transition for the outline
property specifying duration, delay and timing function
Create a Transition for the outline-color
property specifying only the duration
Create a Transition for the outline-color
property specifying duration and delay
Create a Transition for the outline-color
property specifying duration, delay and timing function
Create a Transition for the outline-offset
property specifying only the duration
Create a Transition for the outline-offset
property specifying duration and delay
Create a Transition for the outline-offset
property specifying duration, delay and timing function
Create a Transition for the outline-width
property specifying only the duration
Create a Transition for the outline-width
property specifying duration and delay
Create a Transition for the outline-width
property specifying duration, delay and timing function
Create a Transition for the padding
property specifying only the duration
Create a Transition for the padding
property specifying duration and delay
Create a Transition for the padding
property specifying duration, delay and timing function
Create a Transition for the padding-bottom
property specifying only the duration
Create a Transition for the padding-bottom
property specifying duration and delay
Create a Transition for the padding-bottom
property specifying duration, delay and timing function
Create a Transition for the padding-left
property specifying only the duration
Create a Transition for the padding-left
property specifying duration and delay
Create a Transition for the padding-left
property specifying duration, delay and timing function
Create a Transition for the padding-right
property specifying only the duration
Create a Transition for the padding-right
property specifying duration and delay
Create a Transition for the padding-right
property specifying duration, delay and timing function
Create a Transition for the padding-top
property specifying only the duration
Create a Transition for the padding-top
property specifying duration and delay
Create a Transition for the padding-top
property specifying duration, delay and timing function
Create a Transition for the right
property specifying only the duration
Create a Transition for the right
property specifying duration and delay
Create a Transition for the padding-right
property specifying duration, delay and timing function
Create a Transition for the tab-size
property specifying only the duration
Create a Transition for the tab-size
property specifying duration and delay
Create a Transition for the tab-size
property specifying duration, delay and timing function
Create a Transition for the text-indent
property specifying only the duration
Create a Transition for the text-indent
property specifying duration and delay
Create a Transition for the text-indent
property specifying duration, delay and timing function
Create a Transition for the text-shadow
property specifying only the duration
Create a Transition for the text-shadow
property specifying duration and delay
Create a Transition for the text-shadow
property specifying duration, delay and timing function
Create a Transition for the top
property specifying only the duration
Create a Transition for the top
property specifying duration and delay
Create a Transition for the top
property specifying duration, delay and timing function
Create a Transition for the transform
property specifying only the duration
Create a Transition for the transform
property specifying duration and delay
Create a Transition for the transform
property specifying duration, delay and timing function
Create a Transition for the transform-origin
property specifying only the duration
Create a Transition for the transform-origin
property specifying duration and delay
Create a Transition for the transform-origin
property specifying duration, delay and timing function
Create a Transition for the vertical-align
property specifying only the duration
Create a Transition for the vertical-align
property specifying duration and delay
Create a Transition for the vertical-align
property specifying duration, delay and timing function
Create a Transition for the visibility
property specifying only the duration
Create a Transition for the visibility
property specifying duration and delay
Create a Transition for the visibility
property specifying duration, delay and timing function
Create a Transition for the width
property specifying only the duration
Create a Transition for the width
property specifying duration and delay
Create a Transition for the width
property specifying duration, delay and timing function
Create a Transition for the word-spacing
property specifying only the duration
Create a Transition for the word-spacing
property specifying duration and delay
Create a Transition for the word-spacing
property specifying duration, delay and timing function
Create a Transition for the z-index
property specifying only the duration
Create a Transition for the z-index
property specifying duration and delay
Create a Transition for the z-index
property specifying duration, delay and timing function
This describes all of the aspects of a CSS transition, which will then be compiled down to a string and added as a style property on elements