mirror of https://github.com/twbs/ratchet.git
Build mobile apps with simple HTML, CSS, and JS components.
http://goratchet.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
578 lines
11 KiB
578 lines
11 KiB
11 years ago
|
@import "mixins.scss";
|
||
|
|
||
11 years ago
|
//
|
||
|
// iOS theme
|
||
11 years ago
|
// Visuals and interactions in the style of iOS
|
||
11 years ago
|
//
|
||
|
// --------------------------------------------------
|
||
|
|
||
|
|
||
11 years ago
|
// Variables
|
||
11 years ago
|
// --------------------------------------------------
|
||
|
|
||
11 years ago
|
// Colors
|
||
11 years ago
|
//
|
||
11 years ago
|
// Main theme colors
|
||
11 years ago
|
$primary-color: #007aff;
|
||
|
$chrome-color: rgba(247,247,247,.98);
|
||
11 years ago
|
|
||
|
// Action colors
|
||
|
$default-color: #929292;
|
||
|
$positive-color: #4cd964;
|
||
|
$negative-color: #dd524d;
|
||
|
|
||
11 years ago
|
// Bars
|
||
11 years ago
|
$bar-base-height: 44px;
|
||
|
$bar-tab-height: 50px;
|
||
11 years ago
|
|
||
11 years ago
|
// iOS style transitions
|
||
|
$timing-fuction: cubic-bezier(.1, .5, .1, 1); // Inspired by @c2prods
|
||
|
|
||
|
|
||
11 years ago
|
// Base
|
||
|
// --------------------------------------------------
|
||
|
|
||
11 years ago
|
// Universal link styling
|
||
11 years ago
|
a {
|
||
|
color: $primary-color;
|
||
11 years ago
|
|
||
|
&:active {
|
||
|
color: darken($primary-color, 10%);
|
||
|
}
|
||
11 years ago
|
}
|
||
11 years ago
|
|
||
|
// Content
|
||
11 years ago
|
.content {
|
||
|
background-color: #efeff4;
|
||
|
}
|
||
|
|
||
11 years ago
|
|
||
11 years ago
|
// Typography
|
||
|
// --------------------------------------------------
|
||
|
|
||
|
.h5, h5,
|
||
|
.h6, h6,
|
||
|
p {
|
||
|
color: #8f8f94;
|
||
|
}
|
||
|
.h5, h5,
|
||
|
.h6, h6, {
|
||
|
font-weight: normal;
|
||
|
text-transform: uppercase;
|
||
|
}
|
||
|
|
||
|
|
||
11 years ago
|
// Buttons
|
||
|
// --------------------------------------------------
|
||
|
|
||
11 years ago
|
.btn {
|
||
11 years ago
|
border: 1px solid $default-color;
|
||
11 years ago
|
color: $default-color;
|
||
11 years ago
|
background-color: $chrome-color;
|
||
|
@include transition(all);
|
||
11 years ago
|
@include transition-duration(.2s);
|
||
|
@include transition-timing-function(linear);
|
||
|
|
||
|
// Active & filled button styles
|
||
|
&:active,
|
||
11 years ago
|
&.active {
|
||
11 years ago
|
color: #fff;
|
||
|
background-color: $default-color;
|
||
|
}
|
||
|
}
|
||
|
|
||
11 years ago
|
|
||
|
// Other button types
|
||
|
// --------------------------------------------------
|
||
|
|
||
|
// Primary button (Default color is blue)
|
||
11 years ago
|
.btn-primary {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
border: 1px solid $primary-color;
|
||
11 years ago
|
background-color: $primary-color;
|
||
11 years ago
|
|
||
|
&:active,
|
||
11 years ago
|
&.active {
|
||
|
border: 1px solid darken($primary-color, 10%);
|
||
|
background-color: darken($primary-color, 10%);
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
// Positive button (Default color is green)
|
||
11 years ago
|
.btn-positive {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
border: 1px solid $positive-color;
|
||
11 years ago
|
background-color: $positive-color;
|
||
11 years ago
|
|
||
|
&:active,
|
||
11 years ago
|
&.active {
|
||
|
border: 1px solid darken($positive-color, 10%);
|
||
|
background-color: darken($positive-color, 10%);
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
// Negative button (Default color is red)
|
||
11 years ago
|
.btn-negative {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
border: 1px solid $negative-color;
|
||
11 years ago
|
background-color: $negative-color;
|
||
11 years ago
|
|
||
|
&:active,
|
||
11 years ago
|
&.active {
|
||
|
border: 1px solid darken($negative-color, 10%);
|
||
|
background-color: darken($negative-color, 10%);
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
11 years ago
|
// Outlined buttons
|
||
11 years ago
|
.btn-outlined {
|
||
11 years ago
|
background-color: transparent;
|
||
11 years ago
|
|
||
11 years ago
|
&.btn-primary {
|
||
11 years ago
|
color: $primary-color;
|
||
|
}
|
||
11 years ago
|
&.btn-positive {
|
||
11 years ago
|
color: $positive-color;
|
||
|
}
|
||
11 years ago
|
&.btn-negative {
|
||
11 years ago
|
color: $negative-color;
|
||
|
}
|
||
|
// Active states
|
||
11 years ago
|
&.btn-primary:active,
|
||
|
&.btn-positive:active,
|
||
|
&.btn-negative:active {
|
||
11 years ago
|
color: #fff;
|
||
|
}
|
||
11 years ago
|
}
|
||
|
|
||
11 years ago
|
// Link button (Buttons that look like links)
|
||
11 years ago
|
.btn-link {
|
||
11 years ago
|
color: $primary-color;
|
||
|
background-color: transparent;
|
||
|
border: none;
|
||
|
|
||
11 years ago
|
&:active,
|
||
|
&.active {
|
||
11 years ago
|
color: darken($primary-color, 10%);
|
||
|
background-color: transparent;
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
11 years ago
|
// Buttons with badges
|
||
|
.btn {
|
||
|
.badge {
|
||
|
background-color: rgba(0,0,0,.15);
|
||
|
|
||
|
&.badge-inverted {
|
||
|
background-color: transparent;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Active states
|
||
|
&:active .badge {
|
||
|
color: #fff;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
// Bars
|
||
11 years ago
|
// --------------------------------------------------
|
||
|
|
||
11 years ago
|
// 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;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Tab bar
|
||
|
.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 {
|
||
11 years ago
|
color: $primary-color;
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
// Nav bars with buttons
|
||
11 years ago
|
.bar-nav {
|
||
11 years ago
|
// Link buttons in nav bars
|
||
11 years ago
|
.btn-link {
|
||
11 years ago
|
color: $primary-color;
|
||
11 years ago
|
|
||
11 years ago
|
&:active {
|
||
|
color: $primary-color;
|
||
|
opacity: .6;
|
||
|
}
|
||
11 years ago
|
}
|
||
11 years ago
|
}
|
||
|
|
||
11 years ago
|
|
||
11 years ago
|
|
||
11 years ago
|
// Badges
|
||
|
// --------------------------------------------------
|
||
|
|
||
11 years ago
|
.badge {
|
||
11 years ago
|
&.badge-inverted {
|
||
11 years ago
|
color: $default-color;
|
||
11 years ago
|
background-color: transparent;
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
// Badge modifiers
|
||
11 years ago
|
//
|
||
11 years ago
|
// Main badge
|
||
|
.badge-primary {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
background-color: $primary-color;
|
||
11 years ago
|
|
||
11 years ago
|
&.badge-inverted {
|
||
|
color: $primary-color;
|
||
11 years ago
|
background-color: transparent;
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
// Positive badge
|
||
|
.badge-positive {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
background-color: $positive-color;
|
||
11 years ago
|
|
||
11 years ago
|
&.badge-inverted {
|
||
|
color: $positive-color;
|
||
11 years ago
|
background-color: transparent;
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
// Negative badge
|
||
|
.badge-negative {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
background-color: $negative-color;
|
||
11 years ago
|
|
||
11 years ago
|
&.badge-inverted {
|
||
|
color: $negative-color;
|
||
11 years ago
|
background-color: transparent;
|
||
11 years ago
|
}
|
||
|
}
|
||
11 years ago
|
|
||
11 years ago
|
|
||
11 years ago
|
// Cards
|
||
|
// --------------------------------------------------
|
||
|
|
||
|
// Cards with table-views
|
||
11 years ago
|
.card .table-view {
|
||
|
background-image: none;
|
||
|
}
|
||
11 years ago
|
.card .table-view-cell:last-child {
|
||
|
background-image: none;
|
||
|
}
|
||
|
|
||
|
// Table views
|
||
|
// --------------------------------------------------
|
||
|
|
||
|
.table-view {
|
||
11 years ago
|
border-top: 0;
|
||
|
border-bottom: 0;
|
||
|
@include hairline(double, #c8c7cc, 0); // Double grey border.
|
||
|
|
||
11 years ago
|
.table-view-cell {
|
||
|
border-bottom: 0;
|
||
11 years ago
|
@include hairline(single, #c8c7cc, 15px); // Single grey border with 15px offset.
|
||
11 years ago
|
|
||
|
// Remove the border from the last table view item
|
||
|
&:last-child {
|
||
|
background-image: none;
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
11 years ago
|
// 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.
|
||
11 years ago
|
}
|
||
11 years ago
|
}
|
||
|
|
||
11 years ago
|
|
||
11 years ago
|
// 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;
|
||
11 years ago
|
padding: 10px 15px;
|
||
|
border: 1px solid rgba(0, 0, 0, .2);
|
||
11 years ago
|
}
|
||
|
|
||
|
// 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;
|
||
11 years ago
|
border: 0;
|
||
|
@include hairline(double, #c8c7cc, 0); // Double grey border.
|
||
11 years ago
|
}
|
||
|
.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;
|
||
|
}
|
||
|
|
||
|
|
||
11 years ago
|
// Segmented controls
|
||
11 years ago
|
// --------------------------------------------------
|
||
|
|
||
11 years ago
|
.segmented-control {
|
||
11 years ago
|
background-color: transparent;
|
||
11 years ago
|
border: 1px solid $default-color;
|
||
11 years ago
|
|
||
11 years ago
|
.control-item {
|
||
|
color: $default-color;
|
||
11 years ago
|
border-color: $default-color;
|
||
11 years ago
|
@include transition(background-color .1s linear);
|
||
11 years ago
|
|
||
11 years ago
|
&:active {
|
||
|
background-color: lighten($default-color, 35%);
|
||
|
}
|
||
11 years ago
|
&.active {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
background-color: $default-color;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Other segmented controller types
|
||
11 years ago
|
//
|
||
11 years ago
|
// Primary
|
||
11 years ago
|
.segmented-control-primary {
|
||
11 years ago
|
border: 1px solid $primary-color;
|
||
|
|
||
11 years ago
|
.control-item {
|
||
|
color: $primary-color;
|
||
11 years ago
|
border-color: inherit;
|
||
|
|
||
|
&:active {
|
||
|
background-color: lighten($primary-color, 35%);
|
||
|
}
|
||
11 years ago
|
&.active {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
background-color: $primary-color;
|
||
11 years ago
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Positive
|
||
11 years ago
|
.segmented-control-positive {
|
||
11 years ago
|
border: 1px solid $positive-color;
|
||
|
|
||
11 years ago
|
.control-item {
|
||
|
color: $positive-color;
|
||
11 years ago
|
border-color: inherit;
|
||
11 years ago
|
|
||
11 years ago
|
&:active {
|
||
|
background-color: lighten($positive-color, 35%);
|
||
|
}
|
||
11 years ago
|
&.active {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
background-color: $positive-color;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Negative
|
||
11 years ago
|
.segmented-control-negative {
|
||
11 years ago
|
border: 1px solid $negative-color;
|
||
|
|
||
11 years ago
|
.control-item {
|
||
|
color: $negative-color;
|
||
11 years ago
|
border-color: inherit;
|
||
11 years ago
|
|
||
11 years ago
|
&:active {
|
||
|
background-color: lighten($negative-color, 35%);
|
||
|
}
|
||
11 years ago
|
&.active {
|
||
11 years ago
|
color: #fff;
|
||
11 years ago
|
background-color: $negative-color;
|
||
11 years ago
|
}
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
// 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);
|
||
11 years ago
|
|
||
11 years ago
|
&:before {
|
||
11 years ago
|
border-bottom: 15px solid $chrome-color;
|
||
|
}
|
||
11 years ago
|
}
|
||
|
|
||
|
// 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;
|
||
11 years ago
|
background-image: none;
|
||
11 years ago
|
}
|
||
|
|
||
11 years ago
|
|
||
|
// Modal styles
|
||
|
// --------------------------------------------------
|
||
|
|
||
|
.modal {
|
||
|
@include transition-timing-function($timing-fuction);
|
||
|
|
||
|
// Active modal
|
||
|
&.active {
|
||
|
@include transition-timing-function($timing-fuction);
|
||
|
}
|
||
|
}
|
||
|
|
||
11 years ago
|
|
||
11 years ago
|
// Toggles styles
|
||
|
// --------------------------------------------------
|
||
|
.toggle {
|
||
11 years ago
|
width: 47px;
|
||
11 years ago
|
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);
|
||
|
}
|
||
11 years ago
|
&:before {
|
||
|
display: none;
|
||
|
}
|
||
11 years ago
|
// Active state for toggle
|
||
|
&.active {
|
||
11 years ago
|
border: 2px solid $positive-color;
|
||
11 years ago
|
background-color: transparent;
|
||
|
@include box-shadow(inset 0 0 0 13px $positive-color);
|
||
|
|
||
11 years ago
|
.toggle-handle {
|
||
|
@include transform(translate3d(17px,0,0));
|
||
|
}
|
||
|
|
||
11 years ago
|
.toggle-handle {
|
||
|
border-color: $positive-color;
|
||
|
}
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
|
||
11 years ago
|
// 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)); }
|
||
|
}
|