// /** // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved. // * Licensed under GNU General Public License version 2 or later; see LICENSE.txt // */ @if $trace-imports { @debug 'imported'; } // ========================================================================== // Mixin reset-baseline // ========================================================================== @mixin reset-baseline { /* * IE 6 refuses to resize fonts set in pixels and it weirdly resizes fonts * whose root is set in ems. So we set the root font size in percentages of * the default font size. */ * html { font-size: 100% * $base-font-size / $browser-default-font-size; } /* * Set the font properties on the html tag. */ html { $fs: px-to-relative-font-size($base-font-size, $browser-default-font-size); $lh: px-to-relative-line-height($base-line-height, $base-font-size); @include font($type-default, $fs, $lh); } } // ========================================================================== // Mixin reset-html-background // ========================================================================== @mixin reset-html-background($color-background: $color-background) { /* * It's good practice to set the background color of the html tag */ background-color: $color-background; } // ========================================================================== // Mixin reset-html-color // ========================================================================== @mixin reset-html-color($color-body: $color-body) { /* * Set the default color */ color: $color-body; } // ========================================================================== // Mixin reset-box-sizing // ========================================================================== @mixin reset-box-sizing { /* * Reset to box-sizing to border-box */ @include box-sizing(border-box); } // ========================================================================== // Mixin reset-text-rendering // ========================================================================== @mixin reset-text-rendering { /* * See: http://www.usabilitypost.com/2012/11/06/optimize-legibility/ */ text-rendering: optimizeLegibility; /* * Prevents the browser from using synthesized font-weights. */ font-synthesis: none; // @todo: these next two settings influences the appearance and should be moved to Base /* * See: http://meyerweb.com/eric/css/tests/css3/font-variant-ligatures.html */ font-variant-ligatures: common-ligatures; /* * See: http://meyerweb.com/eric/css/tests/css3/font-variant-numeric.html */ font-variant-numeric: oldstyle-nums diagonal-fractions; } // ========================================================================== // Mixin reset-html5 // ========================================================================== @mixin reset-html5 { /** * Correct `block` display not defined in IE 8/9. */ article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } /** * Correct `inline-block` display not defined in IE 8/9. */ audio, canvas, video { display: inline-block; } /** * Prevent modern browsers from displaying `audio` without controls. * Remove excess height in iOS 5 devices. */ audio:not([controls]) { display: none; height: 0; } /** * Address `[hidden]` styling not present in IE 8/9. * Hide the `template` element in IE, Safari, and Firefox < 22. */ [hidden], template { display: none; } } // ========================================================================== // Mixin reset-ios // ========================================================================== @mixin reset-ios { /** * Prevent iOS text size adjust after orientation change, * without disabling user zoom. */ -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } // ========================================================================== // Mixin reset-anchor // ========================================================================== @mixin reset-anchor { /** * 1. Remove the gray background color from active links in IE 10. * 2. Address `outline` inconsistency between Chrome and other browsers. * 3. Improve readability when focused and also mouse hovered in all browsers. */ a { background: transparent; /* 1 */ &:focus { outline: thin dotted; /* 2 */ } &:active, &:hover { outline: 0; /* 3 */ } } } // ========================================================================== // Mixin reset-media // ========================================================================== @mixin reset-media { /** * Remove border when inside `a` element in IE 8/9. */ img { border: 0; } /** * Correct overflow displayed oddly in IE 9. */ svg:not(:root) { overflow: hidden; } } // ========================================================================== // Mixin reset-list-style // ========================================================================== @mixin reset-list-style { /* * Render lists without list style */ list-style: none; } // ========================================================================== // Mixin reset-table // ========================================================================== @mixin reset-table { /** * Remove most spacing between table cells. */ border-collapse: collapse; border-spacing: 0; } // ========================================================================== // Mixin reset-table-cell // ========================================================================== @mixin reset-table-cell { /** * 1. Align all content to the left. * 2. Set font-weight to default font and weight * 3. Re-align vertically */ text-align: left; /* 1 */ @include font-weight($type-default); /* 2 */ vertical-align: middle; /* 3 */ } // ========================================================================== // Mixin reset-input // ========================================================================== @mixin reset-input { /** * 1. Prepare for easy styling * 2. Address margins set differently in Firefox 4+, Safari 5, and Chrome. * 3. Correct font family not being inherited in all browsers. * 4. Correct font size not being inherited in all browsers. */ button, input, select, textarea { display: inline-block; /* 1 */ @include box-sizing(border-box); /* 1 */ margin: 0; /* 2 */ font-family: inherit; /* 3 */ font-size: 100%; /* 4 */ } /** * Address Firefox 4+ setting `line-height` on `input` using `!important` in * the UA stylesheet. */ button, input { line-height: inherit; } /** * Address inconsistent `text-transform` inheritance for `button` and `select`. * All other form control elements do not inherit `text-transform` values. * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. * Correct `select` style inheritance in Firefox 4+ and Opera. */ button, select { text-transform: none; } /** * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` * and `video` controls. * 2. Correct inability to style clickable `input` types in iOS. * 3. Improve usability and consistency of cursor style between image-type * `input` and others. */ button, html input[type="button"], /* 1 */ input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ } /** * Re-set default cursor for disabled elements. */ button[disabled], html input[disabled] { cursor: default; } /** * 1. Address box sizing set to `content-box` in IE 8/9. * 2. Remove excess padding in IE 8/9. */ input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } /** * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome * (include `-moz` to future-proof). */ input[type="search"] { -webkit-appearance: textfield; /* 1 */ // @include box-sizing(content-box); /* 2 */ } /** * Remove inner padding and search cancel button in Safari 5 and Chrome * on OS X. */ input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } /** * Remove inner padding and border in Firefox 4+. */ button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } /** * 1. Remove default vertical scrollbar in IE 8/9. * 2. Improve readability and alignment in all browsers. */ textarea { overflow: auto; /* 1 */ vertical-align: top; /* 2 */ } } // ========================================================================== // Mixin reset-quotation // ========================================================================== @mixin reset-quotation { /** * 1. Strip quotes. * 2. Some browsers do not support the quote attribute. */ quotes: none; &:before, &::after { content: ""; /* 2 */ content: none; /* 2 */ } }