/*----------------------------------------------------

Mixins available:
-   absoluteCenter          - arguments:
-   placeholder             - arguments:
-   font-smoothing          - arguments:
-   img-url                 - arguments:
-   font-url                - arguments:
-   webfont                 - arguments:
------------------------------------------------------------- */


absoluteCenter() {
    display block
    position absolute
    left 50%
    top 50%
    transform (translate(-50%, -50%))
}

placeholder()
    &::-webkit-input-placeholder
        {block}
    &:-moz-placeholder
        {block}
    &::-moz-placeholder
        {block}
    &:-ms-input-placeholder
        {block}

font-smoothing() {
    if current-property {
        -webkit-{current-property}: arguments
        if arguments == antialiased {
            -moz-osx-{current-property}: grayscale
        } else if arguments == subpixel-antialiased {
            -moz-osx-{current-property}: auto
        }
        {current-property}: arguments
    } else {
        error('font-smoothing() must be used within a property');
    }
}


img-url(file)
    return url("~assets/img/" + file)

font-url(file)
    return '~assets/fonts/' + file

webfont(family, file, hack-chrome-windows = false, weight = 'normal')
    @font-face
        font-family family
        src url(font-url(file + '.eot'))
        src url(font-url(file + '.eot?#iefix')) format('embedded-opentype'),
            url(font-url(file + '.woff')) format('woff'),
            url(font-url(file + '.ttf')) format('truetype'),
            url(font-url(file + '.svg#' + family)) format('svg')
        font-weight weight
        font-style normal
        if hack-chrome-windows
            @media screen and (-webkit-min-device-pixel-ratio: 0)
                @font-face
                    font-family family
                    src url(font-url(file + '.svg#' + family)) format('svg')
