Created
November 22, 2017 01:23
-
-
Save thegrid22593/ee01520ad1ed8a7d5679616870a79cba to your computer and use it in GitHub Desktop.
Base mixin file I like to use for my scss projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// iOS issue where native components in forms scale view port fix | |
@mixin nativeiOScomponentScale() { | |
input[type="text"], input[type="text"]:focus, select:focus, textarea:focus, input:focus { | |
font-size: 16px !important; | |
} | |
} | |
@mixin fontSmoothing() { | |
-webkit-font-smoothing: antialiased; | |
-moz-font-smoothing: none; | |
-moz-osx-font-smoothing: grayscale; | |
font-smoothing: antialiased; | |
} | |
// Alignments | |
@mixin vertical-align { | |
position: absolute; | |
top: 50%; | |
transform: translateY(-50%); | |
} | |
@mixin horizontal-align { | |
position: absolute; | |
left: 50%; | |
transform: translateX(-50%); | |
} | |
@mixin center-align { | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
} | |
// General Box Shadow | |
@mixin box-shadow($args) { | |
-webkit-box-shadow: #{$args}; | |
-moz-box-shadow: #{$args}; | |
-ms-box-shadow: #{$args}; | |
-o-box-shadow: #{$args}; | |
box-shadow: #{$args}; | |
} | |
// Responsive | |
@mixin mq-xs { | |
@media (min-width: #{$screen-xs}) { | |
@content; | |
} | |
} | |
@mixin mq-sm { | |
@media (min-width: #{$screen-sm}) { | |
@content; | |
} | |
} | |
@mixin mq-md { | |
@media (min-width: #{$screen-md}) { | |
@content; | |
} | |
} | |
@mixin mq-lg { | |
@media (min-width: #{$screen-lg}) { | |
@content; | |
} | |
} | |
@mixin mq-xlg { | |
@media (min-width: #{$screen-xlg}) { | |
@content; | |
} | |
} | |
// General Transitions | |
@mixin transition($args) { | |
-webkit-transition: #{$args}; | |
-moz-transition: #{$args}; | |
-ms-transition: #{$args}; | |
-o-transition: #{$args}; | |
transition: #{$args}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment