123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591 |
- @import "mixins.scss";
- //
- // iOS theme
- // Visuals and interactions in the style of iOS
- //
- // --------------------------------------------------
- // Variables
- // --------------------------------------------------
- // Colors
- //
- // Main theme colors
- $primary-color: #007aff !global;
- $chrome-color: rgba(247,247,247,.98) !global;
- // Action colors
- $default-color: #929292 !global;
- $positive-color: #4cd964 !global;
- $negative-color: #dd524d !global;
- // Bars
- $bar-base-height: 44px !global;
- $bar-tab-height: 50px !global;
- // iOS style transitions
- $timing-fuction: cubic-bezier(.1, .5, .1, 1) !global; // Inspired by @c2prods
- // Base
- // --------------------------------------------------
- // Universal link styling
- a {
- color: $primary-color;
- &:active {
- color: darken($primary-color, 10%);
- }
- }
- // Content
- .content {
- background-color: #efeff4;
- }
- // Typography
- // --------------------------------------------------
- .h5, h5,
- .h6, h6,
- p {
- color: #8f8f94;
- }
- .h5, h5,
- .h6, h6 {
- font-weight: normal;
- text-transform: uppercase;
- }
- // Buttons
- // --------------------------------------------------
- .btn {
- color: $default-color;
- background-color: $chrome-color;
- border: 1px solid $default-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;
- background-color: $primary-color;
- border: 1px solid $primary-color;
- &:active,
- &.active {
- background-color: darken($primary-color, 10%);
- border: 1px solid darken($primary-color, 10%);
- }
- }
- // Positive button (Default color is green)
- .btn-positive {
- color: #fff;
- background-color: $positive-color;
- border: 1px solid $positive-color;
- &:active,
- &.active {
- background-color: darken($positive-color, 10%);
- border: 1px solid darken($positive-color, 10%);
- }
- }
- // Negative button (Default color is red)
- .btn-negative {
- color: #fff;
- background-color: $negative-color;
- border: 1px solid $negative-color;
- &:active,
- &.active {
- background-color: darken($negative-color, 10%);
- border: 1px solid 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 with badges
- .btn {
- .badge {
- background-color: rgba(0,0,0,.15);
- &.badge-inverted {
- background-color: transparent;
- }
- }
- // Active states
- &:active .badge {
- color: #fff;
- }
- }
- // Bars
- // --------------------------------------------------
- // Default bar
- .bar {
- background-color: $chrome-color;
- border-bottom: 0;
- @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;
- }
- // Give the footers the correct border
- &.bar-footer,
- &.bar-footer-secondary,
- &.bar-footer-secondary-tab {
- border-top: 0;
- }
- }
- // Tab bar
- .bar-tab {
- border-top: 0;
- }
- .tab-item {
- color: #929292;
- // Active states for the tab bar
- &.active,
- &:active {
- color: $primary-color;
- }
- }
- // Nav bars with buttons
- .bar-nav {
- // Link buttons in nav bars
- .btn-link {
- color: $primary-color;
- &:active {
- color: $primary-color;
- opacity: .6;
- }
- }
- }
- // Badges
- // --------------------------------------------------
- .badge {
- &.badge-inverted {
- color: $default-color;
- background-color: transparent;
- }
- }
- // Badge modifiers
- //
- // Main badge
- .badge-primary {
- color: #fff;
- background-color: $primary-color;
- &.badge-inverted {
- color: $primary-color;
- background-color: transparent;
- }
- }
- // Positive badge
- .badge-positive {
- color: #fff;
- background-color: $positive-color;
- &.badge-inverted {
- color: $positive-color;
- background-color: transparent;
- }
- }
- // Negative badge
- .badge-negative {
- color: #fff;
- background-color: $negative-color;
- &.badge-inverted {
- color: $negative-color;
- background-color: transparent;
- }
- }
- // Cards
- // --------------------------------------------------
- // Cards with table-views
- .card .table-view {
- background-image: none;
- }
- .card .table-view-cell:last-child {
- background-image: none;
- }
- // Table views
- // --------------------------------------------------
- .table-view {
- border-top: 0;
- border-bottom: 0;
- @include hairline(double, #c8c7cc, 0); // Double grey border.
- .table-view-cell {
- border-bottom: 0;
- @include hairline(single, #c8c7cc, 15px); // Single grey border with 15px offset.
- // Remove the border from the last table view item
- &:last-child {
- background-image: none;
- }
- > a:not(.btn):active {
- color: inherit;
- }
- }
- // 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.
- }
- }
- // 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;
- border: 0;
- @include hairline(double, #c8c7cc, 0); // Double grey border.
- }
- .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;
- }
- // Segmented controls
- // --------------------------------------------------
- .segmented-control {
- background-color: transparent;
- border: 1px solid $default-color;
- .control-item {
- color: $default-color;
- border-color: $default-color;
- @include transition(background-color .1s linear);
- &:active {
- background-color: lighten($default-color, 35%);
- }
- &.active {
- color: #fff;
- background-color: $default-color;
- }
- }
- }
- // Other segmented controller types
- //
- // Primary
- .segmented-control-primary {
- border: 1px solid $primary-color;
- .control-item {
- color: $primary-color;
- border-color: inherit;
- &:active {
- background-color: lighten($primary-color, 35%);
- }
- &.active {
- color: #fff;
- background-color: $primary-color;
- }
- }
- }
- // Positive
- .segmented-control-positive {
- border: 1px solid $positive-color;
- .control-item {
- color: $positive-color;
- border-color: inherit;
- &:active {
- background-color: lighten($positive-color, 35%);
- }
- &.active {
- color: #fff;
- background-color: $positive-color;
- }
- }
- }
- // Negative
- .segmented-control-negative {
- border: 1px solid $negative-color;
- .control-item {
- color: $negative-color;
- border-color: inherit;
- &:active {
- background-color: lighten($negative-color, 35%);
- }
- &.active {
- color: #fff;
- background-color: $negative-color;
- }
- }
- }
- // Popovers
- // --------------------------------------------------
- .popover {
- border-radius: 12px;
- @include transition(-webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in-out);
- &:before {
- border-bottom: 15px solid $chrome-color;
- }
- }
- // Popovers with `bar`
- .popover .bar {
- @include box-shadow(none);
- }
- // Popovers with `bar-nav`
- .popover .bar-nav {
- border-bottom: 1px solid rgba(0,0,0,.15);
- }
- // Popovers with `table-views`
- .popover .table-view {
- background-image: none;
- border-radius: 12px;
- }
- // 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);
- -webkit-transition-property: -webkit-transform, border, width;
- -moz-transition-property: -moz-transform, border, width;
- transition-property: transform, border, width;
- @include box-shadow(0 3px 3px rgba(0,0,0,.08));
- }
- &:before {
- display: none;
- }
- // Active state for toggle
- &.active {
- background-color: transparent;
- border: 2px solid $positive-color;
- @include box-shadow(inset 0 0 0 13px $positive-color);
- .toggle-handle {
- @include transform(translate3d(17px,0,0));
- }
- .toggle-handle {
- border-color: $positive-color;
- }
- }
- }
- // Push styles
- // --------------------------------------------------
- .content {
- // Fade animation
- &.fade {
- @include transition(opacity .2s ease-in-out);
- }
- // Slide animation
- &.sliding {
- @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
- @at-root {
- @-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)); }
- }
- }
|