ratchet/sass/theme-ios.scss

589 строки
11 KiB
SCSS
Исходник Обычный вид История

2013-12-15 04:24:35 +04:00
@import "mixins.scss";
//
// iOS theme
2014-02-10 03:37:38 +04:00
// Visuals and interactions in the style of iOS
//
// --------------------------------------------------
2013-12-20 22:30:00 +04:00
// Variables
// --------------------------------------------------
2013-12-20 22:30:00 +04:00
// Colors
2014-02-10 03:52:06 +04:00
//
// Main theme colors
2014-03-11 11:22:47 +04:00
$primary-color: #007aff !global;
$chrome-color: rgba(247,247,247,.98) !global;
// Action colors
2014-03-11 11:22:47 +04:00
$default-color: #929292 !global;
$positive-color: #4cd964 !global;
$negative-color: #dd524d !global;
2013-12-20 22:53:50 +04:00
// Bars
2014-03-11 11:22:47 +04:00
$bar-base-height: 44px !global;
$bar-tab-height: 50px !global;
2013-12-20 22:53:50 +04:00
// iOS style transitions
2014-03-11 11:22:47 +04:00
$timing-fuction: cubic-bezier(.1, .5, .1, 1) !global; // Inspired by @c2prods
2013-12-20 22:30:00 +04:00
// Base
// --------------------------------------------------
2014-02-10 03:52:06 +04:00
// Universal link styling
2014-02-02 02:36:05 +04:00
a {
color: $primary-color;
2014-02-10 03:52:06 +04:00
&:active {
color: darken($primary-color, 10%);
}
2014-02-02 02:36:05 +04:00
}
2014-02-10 03:52:06 +04:00
// Content
2013-12-20 22:30:00 +04:00
.content {
background-color: #efeff4;
}
2014-02-12 09:11:19 +04:00
2014-02-12 08:56:26 +04:00
// Typography
// --------------------------------------------------
2014-02-26 14:07:55 +04:00
.h5, h5,
2014-02-12 08:56:26 +04:00
.h6, h6,
p {
color: #8f8f94;
}
2014-02-26 14:07:55 +04:00
.h5, h5,
.h6, h6 {
2014-02-12 08:56:26 +04:00
font-weight: normal;
text-transform: uppercase;
}
2013-12-15 02:46:56 +04:00
// Buttons
// --------------------------------------------------
2014-02-01 05:32:16 +04:00
.btn {
2013-12-15 04:53:11 +04:00
border: 1px solid $default-color;
2013-12-15 02:46:56 +04:00
color: $default-color;
background-color: $chrome-color;
@include transition(all);
2013-12-15 02:46:56 +04:00
@include transition-duration(.2s);
@include transition-timing-function(linear);
// Active & filled button styles
&:active,
&.active {
2013-12-15 02:46:56 +04:00
color: #fff;
background-color: $default-color;
}
}
2013-12-15 04:53:11 +04:00
// Other button types
// --------------------------------------------------
// Primary button (Default color is blue)
2014-02-01 05:32:16 +04:00
.btn-primary {
color: #fff;
2013-12-15 04:53:11 +04:00
border: 1px solid $primary-color;
background-color: $primary-color;
2013-12-15 04:53:11 +04:00
&:active,
&.active {
border: 1px solid darken($primary-color, 10%);
background-color: darken($primary-color, 10%);
2013-12-15 04:53:11 +04:00
}
}
// Positive button (Default color is green)
2014-02-01 05:32:16 +04:00
.btn-positive {
color: #fff;
2013-12-15 04:53:11 +04:00
border: 1px solid $positive-color;
background-color: $positive-color;
2013-12-15 04:53:11 +04:00
&:active,
&.active {
border: 1px solid darken($positive-color, 10%);
background-color: darken($positive-color, 10%);
2013-12-15 04:53:11 +04:00
}
}
// Negative button (Default color is red)
2014-02-01 05:32:16 +04:00
.btn-negative {
color: #fff;
2013-12-15 04:53:11 +04:00
border: 1px solid $negative-color;
background-color: $negative-color;
2013-12-15 04:53:11 +04:00
&:active,
&.active {
border: 1px solid darken($negative-color, 10%);
background-color: darken($negative-color, 10%);
2013-12-15 04:53:11 +04:00
}
}
2014-02-26 14:07:55 +04:00
// Outlined buttons
2014-02-01 05:32:16 +04:00
.btn-outlined {
background-color: transparent;
2013-12-15 04:53:11 +04:00
2014-02-01 05:32:16 +04:00
&.btn-primary {
2013-12-15 04:53:11 +04:00
color: $primary-color;
}
2014-02-01 05:32:16 +04:00
&.btn-positive {
color: $positive-color;
}
2014-02-01 05:32:16 +04:00
&.btn-negative {
color: $negative-color;
}
// Active states
2014-02-01 05:32:16 +04:00
&.btn-primary:active,
&.btn-positive:active,
&.btn-negative:active {
color: #fff;
}
2013-12-15 04:53:11 +04:00
}
2013-12-15 02:46:56 +04:00
// Link button (Buttons that look like links)
2014-02-01 05:32:16 +04:00
.btn-link {
color: $primary-color;
background-color: transparent;
border: none;
2013-12-15 02:46:56 +04:00
&:active,
&.active {
color: darken($primary-color, 10%);
background-color: transparent;
2013-12-15 02:46:56 +04:00
}
}
2014-02-10 03:37:38 +04:00
// Buttons with badges
.btn {
.badge {
background-color: rgba(0,0,0,.15);
&.badge-inverted {
background-color: transparent;
}
}
// Active states
&:active .badge {
color: #fff;
}
}
// Bars
2013-12-15 04:16:25 +04:00
// --------------------------------------------------
2014-02-10 03:37:38 +04:00
// Default bar
.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;
}
// Give the footers the correct border
&.bar-footer,
&.bar-footer-secondary,
&.bar-footer-secondary-tab {
border-top: 0;
}
2014-02-10 03:37:38 +04:00
}
// Tab bar
.bar-tab {
2014-02-21 06:02:13 +04:00
border-top: 0;
2014-02-10 03:37:38 +04:00
}
.tab-item {
2014-02-21 06:02:13 +04:00
color: #929292;
2014-02-10 03:37:38 +04:00
// Active states for the tab bar
&.active,
&:active {
2014-02-12 11:05:57 +04:00
color: $primary-color;
2014-02-10 03:37:38 +04:00
}
}
// Nav bars with buttons
2013-12-15 04:16:25 +04:00
.bar-nav {
2014-02-02 02:25:13 +04:00
// Link buttons in nav bars
2014-02-01 05:32:16 +04:00
.btn-link {
2013-12-15 04:53:11 +04:00
color: $primary-color;
2014-02-26 14:07:55 +04:00
&:active {
color: $primary-color;
opacity: .6;
}
2013-12-15 04:53:11 +04:00
}
2013-12-15 04:16:25 +04:00
}
2014-02-10 03:37:38 +04:00
2013-12-15 02:46:56 +04:00
// Badges
// --------------------------------------------------
.badge {
2013-12-21 03:06:50 +04:00
&.badge-inverted {
2013-12-15 04:53:11 +04:00
color: $default-color;
2014-02-01 23:57:22 +04:00
background-color: transparent;
2013-12-15 04:53:11 +04:00
}
}
// Badge modifiers
2014-02-10 03:37:38 +04:00
//
2013-12-15 04:53:11 +04:00
// Main badge
.badge-primary {
2013-12-21 03:06:50 +04:00
color: #fff;
2014-02-01 23:57:22 +04:00
background-color: $primary-color;
2013-12-15 04:53:11 +04:00
2013-12-21 03:06:50 +04:00
&.badge-inverted {
color: $primary-color;
2014-02-01 23:57:22 +04:00
background-color: transparent;
2013-12-15 04:53:11 +04:00
}
}
// Positive badge
.badge-positive {
2013-12-21 03:06:50 +04:00
color: #fff;
2014-02-01 23:57:22 +04:00
background-color: $positive-color;
2013-12-15 04:53:11 +04:00
2013-12-21 03:06:50 +04:00
&.badge-inverted {
color: $positive-color;
2014-02-01 23:57:22 +04:00
background-color: transparent;
2013-12-15 04:53:11 +04:00
}
}
// Negative badge
.badge-negative {
2013-12-21 03:06:50 +04:00
color: #fff;
2014-02-01 23:57:22 +04:00
background-color: $negative-color;
2013-12-15 04:53:11 +04:00
2013-12-21 03:06:50 +04:00
&.badge-inverted {
color: $negative-color;
2014-02-01 23:57:22 +04:00
background-color: transparent;
2013-12-15 02:46:56 +04:00
}
}
2014-02-01 23:57:22 +04:00
2014-02-10 03:37:38 +04:00
// Cards
// --------------------------------------------------
// Cards with table-views
2014-02-15 23:38:08 +04:00
.card .table-view {
background-image: none;
}
2014-02-10 03:37:38 +04:00
.card .table-view-cell:last-child {
background-image: none;
}
// Table views
// --------------------------------------------------
.table-view {
2014-02-15 23:30:18 +04:00
border-top: 0;
border-bottom: 0;
@include hairline(double, #c8c7cc, 0); // Double grey border.
2014-02-10 03:37:38 +04:00
.table-view-cell {
border-bottom: 0;
2014-02-15 23:54:49 +04:00
@include hairline(single, #c8c7cc, 15px); // Single grey border with 15px offset.
2014-02-26 14:07:55 +04:00
2014-02-10 03:37:38 +04:00
// Remove the border from the last table view item
&:last-child {
background-image: none;
2014-02-01 23:57:22 +04:00
}
}
2014-02-10 03:37:38 +04:00
// 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.
2014-02-01 23:57:22 +04:00
}
2014-02-01 23:49:06 +04:00
}
2014-02-10 03:37:38 +04:00
// 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;
2014-02-15 23:30:18 +04:00
padding: 10px 15px;
border: 1px solid rgba(0, 0, 0, .2);
2014-02-10 03:37:38 +04:00
}
// 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;
2014-02-15 23:30:18 +04:00
border: 0;
@include hairline(double, #c8c7cc, 0); // Double grey border.
2014-02-10 03:37:38 +04:00
}
.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;
}
2014-02-10 08:47:10 +04:00
// Segmented controls
// --------------------------------------------------
2014-02-01 05:57:47 +04:00
.segmented-control {
background-color: transparent;
border: 1px solid $default-color;
2014-02-11 07:37:39 +04:00
.control-item {
color: $default-color;
border-color: $default-color;
@include transition(background-color .1s linear);
2014-02-10 08:47:10 +04:00
&:active {
background-color: lighten($default-color, 35%);
}
2014-02-01 06:02:18 +04:00
&.active {
2014-02-11 07:37:39 +04:00
color: #fff;
background-color: $default-color;
}
}
}
// Other segmented controller types
2014-02-10 03:37:38 +04:00
//
// Primary
2014-02-01 05:57:47 +04:00
.segmented-control-primary {
border: 1px solid $primary-color;
2014-02-11 07:37:39 +04:00
.control-item {
color: $primary-color;
border-color: inherit;
2014-02-26 14:07:55 +04:00
&:active {
background-color: lighten($primary-color, 35%);
}
2014-02-01 06:02:18 +04:00
&.active {
2014-02-11 07:37:39 +04:00
color: #fff;
2013-12-15 04:53:11 +04:00
background-color: $primary-color;
}
}
}
// Positive
2014-02-01 05:57:47 +04:00
.segmented-control-positive {
border: 1px solid $positive-color;
2014-02-11 07:37:39 +04:00
.control-item {
color: $positive-color;
border-color: inherit;
2014-02-11 07:37:39 +04:00
&:active {
background-color: lighten($positive-color, 35%);
}
2014-02-01 06:02:18 +04:00
&.active {
2014-02-11 07:37:39 +04:00
color: #fff;
background-color: $positive-color;
}
}
}
// Negative
2014-02-01 05:57:47 +04:00
.segmented-control-negative {
border: 1px solid $negative-color;
2014-02-11 07:37:39 +04:00
.control-item {
color: $negative-color;
border-color: inherit;
2014-02-11 07:37:39 +04:00
&:active {
background-color: lighten($negative-color, 35%);
}
2014-02-01 06:02:18 +04:00
&.active {
2014-02-11 07:37:39 +04:00
color: #fff;
background-color: $negative-color;
2013-12-15 04:53:11 +04:00
}
}
}
// Popovers
// --------------------------------------------------
.popover {
border-radius: 12px;
@include transition(-webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in-out);
2013-12-15 05:06:28 +04:00
2014-02-09 03:20:58 +04:00
&:before {
2013-12-15 05:06:28 +04:00
border-bottom: 15px solid $chrome-color;
}
2014-02-10 03:37:38 +04:00
}
// 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-views1
.popover .table-view {
border-radius: 12px;
2014-02-16 01:06:24 +04:00
background-image: none;
}
2013-12-15 04:16:25 +04:00
// Modal styles
// --------------------------------------------------
.modal {
@include transition-timing-function($timing-fuction);
// Active modal
&.active {
@include transition-timing-function($timing-fuction);
}
}
2014-02-10 03:37:38 +04:00
2013-12-15 04:16:25 +04:00
// Toggles styles
// --------------------------------------------------
.toggle {
2013-12-21 23:17:43 +04:00
width: 47px;
2013-12-15 04:16:25 +04:00
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;
2013-12-15 04:16:25 +04:00
@include box-shadow(0 3px 3px rgba(0,0,0,.08));
}
2013-12-21 23:17:43 +04:00
&:before {
display: none;
}
2013-12-15 04:16:25 +04:00
// Active state for toggle
&.active {
2013-12-15 04:53:11 +04:00
border: 2px solid $positive-color;
2013-12-15 04:16:25 +04:00
background-color: transparent;
@include box-shadow(inset 0 0 0 13px $positive-color);
2013-12-21 23:17:43 +04:00
.toggle-handle {
2014-02-26 14:07:55 +04:00
@include transform(translate3d(17px,0,0));
2013-12-21 23:17:43 +04:00
}
2013-12-15 04:53:11 +04:00
.toggle-handle {
border-color: $positive-color;
}
2013-12-15 04:16:25 +04:00
}
}
// Push styles
// --------------------------------------------------
.content {
2014-02-26 14:07:55 +04:00
// Fade animation
&.fade {
@include transition(opacity .2s ease-in-out);
}
// Slide animation
2014-02-25 07:13:59 +04:00
&.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)); }
}
}