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.

650 lines
12 KiB

@import "mixins.scss";
//
// Android theme
// Visuals and interactions in the style of Android
//
// --------------------------------------------------
// Variables
// --------------------------------------------------
// Type
$font-family-default: 'Roboto', sans-serif;
$font-size-default: 18px;
$font-weight: 500;
$font-weight-light: 400;
$line-height-default: 22px;
// Colors
//
// Main theme colors
$primary-color: #33b5e5;
$chrome-color: #dddddd;
$text-color: #222;
// Action colors
$default-color: #999;
$positive-color: #99cc00;
$negative-color: #ff4444;
// Bars
$bar-base-height: 50px;
$bar-tab-height: 50px;
// Borders
$border-default: 1px solid #b1b1b1;
$border-radius: 2px;
// Base
// --------------------------------------------------
body {
font-family: $font-family-default;
font-size: $font-size-default;
line-height: $line-height-default;
color: $text-color;
}
// Universal link styling
a {
color: $primary-color;
&:active {
color: darken($primary-color, 10%);
}
}
// Content
.content {
background-color: #f2f2f2;
}
// Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab.
// Note: For these to work, content must come after both bars in the markup
.bar-nav ~ .content {
padding-top: $bar-base-height;
}
.bar-tab ~ .content {
padding-bottom: $bar-tab-height;
}
.bar-header-secondary ~ .content {
padding-top: $bar-base-height*2;
}
// Buttons
// --------------------------------------------------
.btn {
padding: 8px 15px;
font-size: 14px;
color: $text-color;
background-color: #cecece;
border: 0;
border-radius: $border-radius;
box-shadow: inset 0 -1px 0 rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 1px rgba(0,0,0,.25);
// Active & filled button styles
&:active,
&.active {
color: $text-color;
border: 0;
background-color: $default-color;
box-shadow: inset 0 -1px 0 rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.2);
}
}
// Other button types
// --------------------------------------------------
// Primary button (Default color is blue)
.btn-primary {
color: #fff;
border: 0;
background-color: $primary-color;
&:active,
&.active {
color: #fff;
border: 0;
background-color: darken($primary-color, 10%);
}
}
// Positive button (Default color is green)
.btn-positive {
color: #fff;
border: 0;
background-color: $positive-color;
&:active,
&.active {
color: #fff;
border: 0;
background-color: darken($positive-color, 10%);
}
}
// Negative button (Default color is red)
.btn-negative {
color: #fff;
border: 0;
background-color: $negative-color;
&:active,
&.active {
color: #fff;
border: 0;
background-color: darken($negative-color, 10%);
}
}
// Outlined buttons
.btn-outlined {
border: 1px solid $default-color;
background-color: transparent;
box-shadow: none;
&.btn-primary {
border: 1px solid $primary-color;
color: $primary-color;
&:active {
border: 1px solid $primary-color;
background-color: $primary-color;
}
}
&.btn-positive {
border: 1px solid $positive-color;
color: $positive-color;
&:active {
border: 1px solid $positive-color;
background-color: $positive-color;
}
}
&.btn-negative {
border: 1px solid $negative-color;
color: $negative-color;
&:active {
border: 1px solid $negative-color;
background-color: $negative-color;
}
}
// Active states
&:active {
border: 1px solid $default-color;
background-color: $default-color;
box-shadow: none;
}
&.btn-primary:active,
&.btn-positive:active,
&.btn-negative:active {
color: #fff;
box-shadow: none;
}
}
// Link button (Buttons that look like links)
.btn-link {
color: $primary-color;
background-color: transparent;
border: none;
box-shadow: none;
&:active,
&.active {
color: darken($primary-color, 10%);
background-color: transparent;
box-shadow: none;
}
}
// Block buttons
.btn-block {
padding: 15px 0;
font-size: 18px;
}
// Buttons with badges
.btn {
.badge {
background-color: rgba(0,0,0,.15);
&.badge-inverted {
background-color: transparent;
}
}
// Active states
&:active .badge {
color: #fff;
}
}
// Bars
// --------------------------------------------------
.bar {
height: $bar-base-height;
background-color: $chrome-color;
border-bottom: $border-default;
box-shadow: inset 0 -2px 0 #d2d2d2, 0 3px 3px rgba(0,0,0,.07);
// 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 {
top: 0;
bottom: auto;
height: $bar-tab-height;
border-top: 0;
.tab-item {
.icon {
margin-top: 5px;
}
// Active states for the tab bar
&.active,
&:active {
.tab-label,
.icon {
color: $primary-color;
}
}
}
}
// Left aligned text in the .bar-nav
.title {
position: static;
padding-left: 15px;
font-size: $font-size-default;
line-height: 49px;
text-align: left;
}
// Bars with buttons
.bar {
.btn {
padding-top: 9px;
padding-bottom: 9px;
}
.btn-link {
padding: 0;
color: $primary-color;
font-size: $font-size-default;
line-height: 49px;
&:active,
&.active {
color: darken($primary-color, 10%);
}
}
}
// Nav bars with buttons
.bar-nav {
.btn {
margin-top: 7px;
}
.btn-link {
margin-top: 0;
color: $primary-color;
&:active {
color: $primary-color;
opacity: .6;
}
}
}
// Bars with segmented-controls
//
// Remove standard segmented bottom margin
.bar .segmented-control {
top: 7px;
}
// Bars with Ratchicons
.bar .icon {
margin-top: 13px;
}
// 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
// --------------------------------------------------
.card {
border-color: #d9d9d9;
border-radius: $border-radius;
background-color: transparent;
}
// Table views
// --------------------------------------------------
.table-view {
background-color: transparent;
.table-view-cell {
border-bottom: 1px solid #d9d9d9;
// Remove the border from the last table view item
&:last-child {
background-image: none;
}
> a:not(.btn):active {
background-color: $primary-color;
.icon {
color: #fff;
}
}
}
// Table view dividers
.table-view-divider {
padding-top: 25px;
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
border-top: 0;
border-bottom: 2px solid #a9a9a9;
background-color: transparent;
}
}
// 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);
box-shadow: 0 1px 1px rgba(0,0,0,.1);
}
input[type="search"] {
border-radius: $border-radius;
}
select,
textarea,
.input-group {
height: auto;
}
// Input groups (cluster multiple inputs together into a single group)
// -------------------------------------------------------------------
.input-group {
padding: 0;
border: 0;
}
.input-group input {
border: 0;
border-bottom: 1px solid #d9d9d9;
box-shadow: none;
}
// 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: 1px solid #d9d9d9;
}
// Remove bottom border on last input-row to avoid double bottom border
.input-row label + input {
background-image: none;
border-bottom: 0;
}
// Segmented controllers
// --------------------------------------------------
.segmented-control {
font-size: 14px;
background-color: #cecece;
border: 0;
border-radius: $border-radius;
box-shadow: 0 1px 1px rgba(0,0,0,.25);
.control-item {
padding-top: 10px;
padding-bottom: 10px;
color: $text-color;
border-left: 1px solid #999;
box-shadow: inset 0 -1px 0 rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.2);
// Remove border-left and shadow from first section
&:first-child {
border-left-width: 0;
}
&:active,
&.active {
background-color: $default-color;
}
}
}
// Other segmented controller types
// --------------------------------------------------
// Primary
.segmented-control-primary {
border: 0;
.control-item {
color: #fff;
border-color: inherit;
&:active,
&.active {
color: #fff;
background-color: $primary-color;
}
}
}
// Positive
.segmented-control-positive {
border: 0;
.control-item {
color: #fff;
border-color: inherit;
&:active,
&.active {
color: #fff;
background-color: $positive-color;
}
}
}
// Negative
.segmented-control-negative {
border: 0;
.control-item {
color: #fff;
border-color: inherit;
&:active,
&.active {
color: #fff;
background-color: $negative-color;
}
}
}
// Popovers
// --------------------------------------------------
.popover {
top: 90px;
border: 1px solid #9b9b9b;
border-radius: 0;
box-shadow: 0 0 3px rgba(0,0,0,.2);
@include transition(-webkit-transform 0.2s ease-in-out, transform 0.2s ease-in-out, opacity 0.2s ease-in-out);
&:before {
display: none;
}
}
// Popovers with bars
.popover {
.bar {
border-radius: 0;
}
// Padding the content correctly.
.bar-nav ~ .table-view {
padding-top: $bar-base-height;
}
}
// Popovers with table-views
.popover .table-view {
border-radius: 12px;
}
//
// Toggles styles
// --------------------------------------------------
.toggle {
width: 104px;
height: 28px;
border: 2px solid #d7d7d7;
border-radius: 0;
background-color: #d7d7d7;
// Sliding handle
.toggle-handle {
top: 0;
left: 0;
width: 50px;
height: 24px;
border: 1px solid #b5b5b5;
border-radius: 0;
background-color: #bebebe;
box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.1);
}
&:before {
top: 1px;
right: auto;
left: 11px;
z-index: 3;
color: #fff;
}
// Active state for toggle
&.active {
background-color: #d7d7d7;
.toggle-handle {
margin-right: 2px;
background-color: $primary-color;
border-color: $primary-color;
@include transform(translate3d(50px,0,0));
}
&:before {
left: auto;
right: 14px;
color: #fff;
content: "On";
}
}
}