bsw/jbe@1309: /** bsw/jbe@1309: * Copyright 2015 Google Inc. All Rights Reserved. bsw/jbe@1309: * bsw/jbe@1309: * Licensed under the Apache License, Version 2.0 (the "License"); bsw/jbe@1309: * you may not use this file except in compliance with the License. bsw/jbe@1309: * You may obtain a copy of the License at bsw/jbe@1309: * bsw/jbe@1309: * http://www.apache.org/licenses/LICENSE-2.0 bsw/jbe@1309: * bsw/jbe@1309: * Unless required by applicable law or agreed to in writing, software bsw/jbe@1309: * distributed under the License is distributed on an "AS IS" BASIS, bsw/jbe@1309: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. bsw/jbe@1309: * See the License for the specific language governing permissions and bsw/jbe@1309: * limitations under the License. bsw/jbe@1309: */ bsw/jbe@1309: bsw/jbe@1309: /* Typography */ bsw/jbe@1309: bsw/jbe@1309: @mixin typo-preferred-font($usePreferred: true) { bsw/jbe@1309: @if $usePreferred { bsw/jbe@1309: font-family: $preferred_font; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-display-4($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 112px; bsw/jbe@1309: font-weight: 300; bsw/jbe@1309: line-height: 1; bsw/jbe@1309: letter-spacing: -0.04em; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.54; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-display-3($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 56px; bsw/jbe@1309: font-weight: 400; bsw/jbe@1309: line-height: 1.35; bsw/jbe@1309: letter-spacing: -0.02em; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.54; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-display-2($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 45px; bsw/jbe@1309: font-weight: 400; bsw/jbe@1309: line-height: 48px; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.54; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-display-1($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 34px; bsw/jbe@1309: font-weight: 400; bsw/jbe@1309: line-height: 40px; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.54; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-headline($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 24px; bsw/jbe@1309: font-weight: 400; bsw/jbe@1309: line-height: 32px; bsw/jbe@1309: -moz-osx-font-smoothing: grayscale; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.87; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-title($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 20px; bsw/jbe@1309: font-weight: 500; bsw/jbe@1309: line-height: 1; bsw/jbe@1309: letter-spacing: 0.02em; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.87; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-subhead($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 16px; bsw/jbe@1309: font-weight: 400; bsw/jbe@1309: line-height: 24px; bsw/jbe@1309: letter-spacing: 0.04em; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.87; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-subhead-2($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 16px; bsw/jbe@1309: font-weight: 400; bsw/jbe@1309: line-height: 28px; bsw/jbe@1309: letter-spacing: 0.04em; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.87; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-body-2($colorContrast: false, $usePreferred: false) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 14px; bsw/jbe@1309: @if $usePreferred { bsw/jbe@1309: font-weight: 500; bsw/jbe@1309: } @else { bsw/jbe@1309: font-weight: bold; bsw/jbe@1309: } bsw/jbe@1309: line-height: 24px; bsw/jbe@1309: letter-spacing: 0; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.87; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-body-1($colorContrast: false, $usePreferred: false) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 14px; bsw/jbe@1309: font-weight: 400; bsw/jbe@1309: line-height: 24px; bsw/jbe@1309: letter-spacing: 0; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.87; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-caption($colorContrast: false, $usePreferred: false) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 12px; bsw/jbe@1309: font-weight: 400; bsw/jbe@1309: line-height: 1; bsw/jbe@1309: letter-spacing: 0; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.54; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-blockquote($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: position: relative; bsw/jbe@1309: font-size: 24px; bsw/jbe@1309: font-weight: 300; bsw/jbe@1309: font-style: italic; bsw/jbe@1309: line-height: 1.35; bsw/jbe@1309: letter-spacing: 0.08em; bsw/jbe@1309: bsw/jbe@1309: &:before { bsw/jbe@1309: position: absolute; bsw/jbe@1309: left: -0.5em; bsw/jbe@1309: content: '“'; bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: &:after { bsw/jbe@1309: content: '”'; bsw/jbe@1309: margin-left: -0.05em; bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.54; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-menu($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 14px; bsw/jbe@1309: font-weight: 500; bsw/jbe@1309: line-height: 1; bsw/jbe@1309: letter-spacing: 0; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.87; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-button($colorContrast: false, $usePreferred: true) { bsw/jbe@1309: @include typo-preferred-font($usePreferred); bsw/jbe@1309: font-size: 14px; bsw/jbe@1309: font-weight: 500; bsw/jbe@1309: text-transform: uppercase; bsw/jbe@1309: line-height: 1; bsw/jbe@1309: letter-spacing: 0; bsw/jbe@1309: bsw/jbe@1309: @if $colorContrast { bsw/jbe@1309: opacity: 0.87; bsw/jbe@1309: } bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin typo-icon() { bsw/jbe@1309: font-family: 'Material Icons'; bsw/jbe@1309: font-weight: normal; bsw/jbe@1309: font-style: normal; bsw/jbe@1309: font-size: 24px; bsw/jbe@1309: line-height: 1; bsw/jbe@1309: letter-spacing: normal; bsw/jbe@1309: text-transform: none; bsw/jbe@1309: display: inline-block; bsw/jbe@1309: word-wrap: normal; bsw/jbe@1309: font-feature-settings: 'liga'; bsw/jbe@1309: -webkit-font-feature-settings: 'liga'; bsw/jbe@1309: -webkit-font-smoothing: antialiased; bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: /* Shadows */ bsw/jbe@1309: bsw/jbe@1309: // Focus shadow mixin. bsw/jbe@1309: @mixin focus-shadow() { bsw/jbe@1309: box-shadow: 0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36); bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin shadow-2dp() { bsw/jbe@1309: box-shadow: 0 2px 2px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity), bsw/jbe@1309: 0 3px 1px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity), bsw/jbe@1309: 0 1px 5px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity); bsw/jbe@1309: } bsw/jbe@1309: @mixin shadow-3dp() { bsw/jbe@1309: box-shadow: 0 3px 4px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity), bsw/jbe@1309: 0 3px 3px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity), bsw/jbe@1309: 0 1px 8px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity); bsw/jbe@1309: } bsw/jbe@1309: @mixin shadow-4dp() { bsw/jbe@1309: box-shadow: 0 4px 5px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity), bsw/jbe@1309: 0 1px 10px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity), bsw/jbe@1309: 0 2px 4px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity); bsw/jbe@1309: } bsw/jbe@1309: @mixin shadow-6dp() { bsw/jbe@1309: box-shadow: 0 6px 10px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity), bsw/jbe@1309: 0 1px 18px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity), bsw/jbe@1309: 0 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity); bsw/jbe@1309: } bsw/jbe@1309: @mixin shadow-8dp() { bsw/jbe@1309: box-shadow: 0 8px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), bsw/jbe@1309: 0 3px 14px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity), bsw/jbe@1309: 0 5px 5px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity); bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin shadow-16dp() { bsw/jbe@1309: box-shadow: 0 16px 24px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), bsw/jbe@1309: 0 6px 30px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity), bsw/jbe@1309: 0 8px 10px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity); bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin shadow-24dp() { bsw/jbe@1309: box-shadow: 0 9px 46px 8px rgba(0, 0, 0, $shadow-key-penumbra-opacity), bsw/jbe@1309: 0 11px 15px -7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity), bsw/jbe@1309: 0 24px 38px 3px rgba(0, 0, 0, $shadow-key-umbra-opacity); bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: /* Animations */ bsw/jbe@1309: bsw/jbe@1309: @mixin material-animation-fast-out-slow-in($duration:0.2s) { bsw/jbe@1309: transition-duration: $duration; bsw/jbe@1309: transition-timing-function: $animation-curve-fast-out-slow-in; bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin material-animation-linear-out-slow-in($duration:0.2s) { bsw/jbe@1309: transition-duration: $duration; bsw/jbe@1309: transition-timing-function: $animation-curve-linear-out-slow-in; bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin material-animation-fast-out-linear-in($duration:0.2s) { bsw/jbe@1309: transition-duration: $duration; bsw/jbe@1309: transition-timing-function: $animation-curve-fast-out-linear-in; bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: @mixin material-animation-default($duration:0.2s) { bsw/jbe@1309: transition-duration: $duration; bsw/jbe@1309: transition-timing-function: $animation-curve-default; bsw/jbe@1309: } bsw/jbe@1309: bsw/jbe@1309: /* Dialog */ bsw/jbe@1309: bsw/jbe@1309: @mixin dialog-width($units:5) { bsw/jbe@1309: @if(type_of($units) != 'number') { bsw/jbe@1309: @error "The unit given to dialog-width should be a number."; bsw/jbe@1309: } bsw/jbe@1309: // 56dp is the base unit width for Dialogs. bsw/jbe@1309: // With 5 units being the number of units for a mobile device. bsw/jbe@1309: // https://goo.gl/sK2O5o bsw/jbe@1309: width: $units * 56px; bsw/jbe@1309: }