Skip to content

Instantly share code, notes, and snippets.

@RafaelCz
Last active September 12, 2015 15:04
Show Gist options
  • Select an option

  • Save RafaelCz/06c06494e97f49b343ee to your computer and use it in GitHub Desktop.

Select an option

Save RafaelCz/06c06494e97f49b343ee to your computer and use it in GitHub Desktop.

Revisions

  1. RafaelCz revised this gist Sep 12, 2015. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions _mixins.scss
    Original file line number Diff line number Diff line change
    @@ -32,14 +32,14 @@ Usage:
    @extend %clearfix;
    } */
    %clearfix {
    *zoom: 1;
    &:before, &:after {
    content: " ";
    display: table;
    }
    &:after {
    clear: both;
    }
    *zoom: 1;
    &:before, &:after {
    content: " ";
    display: table;
    }
    &:after {
    clear: both;
    }
    }


  2. RafaelCz created this gist Sep 12, 2015.
    71 changes: 71 additions & 0 deletions _mixins.scss
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,71 @@
    /* Set a rem font size with pixel fallback */
    @function calculateRem($size) {
    $remSize: $size / 16px;
    @return $remSize * 1rem;
    }

    @mixin font-size($size) {
    font-size: $size;
    font-size: calculateRem($size);
    }

    /* border radius */
    @mixin border-radius($radius) {
    -webkit-border-radius: $radius;
    -moz-border-radius: $radius;
    -ms-border-radius: $radius;
    border-radius: $radius;
    }

    /* Transitions */
    @mixin transition($args...) {
    -webkit-transition: $args;
    -moz-transition: $args;
    -ms-transition: $args;
    -o-transition: $args;
    transition: $args;
    }

    /* Clearfix
    Usage:
    .container-with-floated-children {
    @extend %clearfix;
    } */
    %clearfix {
    *zoom: 1;
    &:before, &:after {
    content: " ";
    display: table;
    }
    &:after {
    clear: both;
    }
    }


    /* Animations and keyframes */
    @mixin keyframes($animation-name) {
    @-webkit-keyframes $animation-name {
    @content;
    }
    @-moz-keyframes $animation-name {
    @content;
    }
    @-ms-keyframes $animation-name {
    @content;
    }
    @-o-keyframes $animation-name {
    @content;
    }
    @keyframes $animation-name {
    @content;
    }
    }

    @mixin animation($str) {
    -webkit-animation: #{$str};
    -moz-animation: #{$str};
    -ms-animation: #{$str};
    -o-animation: #{$str};
    animation: #{$str};
    }