@import "mixins.scss"; // // iOS theme // The visual and interaction styles from iOS // // -------------------------------------------------- // Variables // -------------------------------------------------- // Colors // Main theme colors $primary-color: #007aff; $chrome-color: rgba(247,247,247,.98); // Action colors $default-color: #929292; $positive-color: #4cd964; $negative-color: #dd524d; // Bars $bar-base-height: 44px; $bar-tab-height: 50px; // iOS style transitions $timing-fuction: cubic-bezier(.1, .5, .1, 1); // Inspired by @c2prods // Base // -------------------------------------------------- .content { background-color: #efeff4; } // Bars // -------------------------------------------------- [class*="bar-"] { border-bottom: 0; background-color: $chrome-color; @include box-shadow(0 0 1px rgba(0,0,0,.85)); // Modifier class to dock any bar below .bar-nav &.bar-header-secondary { top: $bar-base-height; } // Modifier class to dock any bar above a standard bar &.bar-footer-secondary { bottom: $bar-base-height; } // Modifier class to dock any bar above a .bar-tab &.bar-footer-secondary-tab { bottom: $bar-tab-height; } } .bar-tab { border-top: 0; @include box-shadow(0 0 -1px rgba(0,0,0,.85)); } .tab-item { // Active states for the tab bar &.active, &:active { .tab-label, .icon { color: $primary-color; } } } // Nav bar in popovers // -------------------------------------------------- .popover .bar-nav { border-bottom: 1px solid rgba(0,0,0,.15); } // Table views // -------------------------------------------------- .table-view { .table-view-cell { border-bottom: 0; @include hairline(single, #c8c7cc, 15px); // Single grey border with a 15px offset. // Remove the border from the last table view item &:last-child { background-image: none; } } // Table view dividers // -------------------------------------------------- .table-view-divider { border-top: 0; border-bottom: 0; @include hairline(double, #c8c7cc, 0); // Double (top and bottom) grey border with no offset. } } .popover .table-view { border-radius: 12px; } .card .table-view li:last-child { background-image: none; } // Forms // -------------------------------------------------- select, textarea, input[type="text"], input[type=search], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="tel"], input[type="color"], .input-group { height: 40px; padding: 10px 15px; border: 1px solid rgba(0, 0, 0, .2); } // Rounded search input input[type=search] { height: 34px; text-align: center; background-color: rgba(0,0,0,.1); border: 0; border-radius: 6px; } input[type=search]:focus { text-align: left; } select, textarea, .input-group { height: auto; } // Input groups (cluster multiple inputs together into a single group) // ------------------------------------------------------------------- .input-group { padding: 0; } .input-group input { border: 0; @include hairline(single, #c8c7cc, 15px); } // Remove bottom border on last input to avoid double bottom border .input-group input:last-child { background-image: none; } // Input groups with labels // -------------------------------------------------- // To use labels with input groups, wrap a label and an input in an .input-row .input-row { border-bottom: 0; @include hairline(single, #c8c7cc, 15px); // Single grey border with a 15px offset. } // Remove bottom border on last input-row to avoid double bottom border .input-row:last-child, .input-row label + input { background-image: none; } // Buttons // -------------------------------------------------- .btn { border: 1px solid $default-color; color: $default-color; background-color: $chrome-color; @include transition(all); @include transition-duration(.2s); @include transition-timing-function(linear); // Active & filled button styles &:active, &.active { color: #fff; background-color: $default-color; } } // Other button types // -------------------------------------------------- // Primary button (Default color is blue) .btn-primary { color: #fff; border: 1px solid $primary-color; background-color: $primary-color; &:active, &.active { border: 1px solid darken($primary-color, 10%); background-color: darken($primary-color, 10%); } } // Positive button (Default color is green) .btn-positive { color: #fff; border: 1px solid $positive-color; background-color: $positive-color; &:active, &.active { border: 1px solid darken($positive-color, 10%); background-color: darken($positive-color, 10%); } } // Negative button (Default color is red) .btn-negative { color: #fff; border: 1px solid $negative-color; background-color: $negative-color; &:active, &.active { border: 1px solid darken($negative-color, 10%); background-color: darken($negative-color, 10%); } } // Outlined buttons .btn-outlined { background-color: transparent; &.btn-primary { color: $primary-color; } &.btn-positive { color: $positive-color; } &.btn-negative { color: $negative-color; } // Active states &.btn-primary:active, &.btn-positive:active, &.btn-negative:active { color: #fff; } } // Link button (Buttons that look like links) .btn-link { color: $primary-color; background-color: transparent; border: none; &:active, &.active { color: darken($primary-color, 10%); background-color: transparent; } } // Buttons in nav bars // -------------------------------------------------- .bar-nav { .btn-link { color: $primary-color; &:active { color: $primary-color; opacity: .6; } } } // // Badges // -------------------------------------------------- .badge { &.badge-inverted { color: $default-color; } } // Badge modifiers // -------------------------------------------------- // Main badge .badge-primary { color: #fff; background-color: $primary-color; &.badge-inverted { color: $primary-color; } } // Positive badge .badge-positive { color: #fff; background-color: $positive-color; &.badge-inverted { color: $positive-color; } } // Negative badge .badge-negative { color: #fff; background-color: $negative-color; &.badge-inverted { color: $negative-color; } } // // Segmented controllers // -------------------------------------------------- .segmented-controller { color: $default-color; background-color: transparent; border: 1px solid $default-color; li { border-color: $default-color; @include transition(background-color .1s linear); &:active { background-color: lighten($default-color, 35%); } &.selected { background-color: $default-color; > a { color: #fff; } } } } // Other segmented controller types // -------------------------------------------------- // Primary .segmented-controller-primary { border: 1px solid $primary-color; li { border-color: inherit; > a { color: $primary-color; } &:active { background-color: lighten($primary-color, 35%); } &.selected { background-color: $primary-color; > a { color: #fff; } } } } // Positive .segmented-controller-positive { border: 1px solid $positive-color; li { border-color: inherit; > a { color: $positive-color; } &:active { background-color: lighten($positive-color, 35%); } &.selected { background-color: $positive-color; > a { color: #fff; } } } } // Negative .segmented-controller-negative { border: 1px solid $negative-color; li { border-color: inherit; > a { color: $negative-color; } &:active { background-color: lighten($negative-color, 35%); } &.selected { background-color: $negative-color; > a { color: #fff; } } } } // // Popovers // -------------------------------------------------- .popover { border-radius: 12px; @include transition(-webkit-transform 0.2s ease-in-out, transform 0.2s ease-in-out, opacity 0.2s ease-in-out); &:after { border-bottom: 15px solid $chrome-color; } } // // Modal styles // -------------------------------------------------- .modal { @include transition-timing-function($timing-fuction); // Active modal &.active { @include transition-timing-function($timing-fuction); } } // // Toggles styles // -------------------------------------------------- .toggle { width: 47px; border: 2px solid #e6e6e6; @include box-shadow(inset 0 0 0 0 #e1e1e1); @include transition-property(box-shadow, border); @include transition-duration(.2s); // Sliding handle .toggle-handle { border: 1px solid rgba(0, 0, 0, .2); @include box-shadow(0 3px 3px rgba(0,0,0,.08)); @include transition-property(-webkit-transform, border, width); } &:before { display: none; } &:active .toggle-handle { width: 35px; } // Active state for toggle &.active { border: 2px solid $positive-color; background-color: transparent; @include box-shadow(inset 0 0 0 13px $positive-color); .toggle-handle { @include transform(translate3d(17px,0,0)); } // When the handle and the container is active &:active .toggle-handle, .toggle-handle:active { @include transform(translate3d(10px,0,0) !important); // Evil important tag is used to overwrite js. } .toggle-handle { border-color: $positive-color; } } } // // Push styles // -------------------------------------------------- .content { // Fade animation &.fade { @include transition(opacity .2s ease-in-out); } // Slide animation &.slide { @include transition-timing-function ($timing-fuction); // Adding the overlay &.sliding-in, &.right:not([class*="sliding-in"]) { @include animation-name(fadeOverlay); @include animation-duration(.4s); } &.right:not([class*="sliding-in"]) { @include animation-direction(reverse); } &.left { @include transform(translate3d(-20%, 0, 0)); // Creates the parallax effect } } } // Overlay animation for the slide transition @-webkit-keyframes fadeOverlay { from { @include box-shadow(0 0 10px rgba(0,0,0,0), -320px 0 0 rgba(0,0,0,0)); } to { @include box-shadow(0 0 10px rgba(0,0,0,.3), -320px 0 0 rgba(0,0,0,.1)); } }