123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755 |
- @import "mixins.scss";
- //
- // Android theme
- // Visuals and interactions in the style of Android
- //
- // --------------------------------------------------
- // Variables
- // --------------------------------------------------
- // Type
- $font-family-default: 'Roboto', sans-serif !global;
- $font-size-default: 18px !global;
- $font-weight: 500 !global;
- $font-weight-light: 400 !global;
- $line-height-default: 22px !global;
- // Colors
- //
- // Main theme colors
- $primary-color: #33b5e5 !global;
- $chrome-color: #dddddd !global;
- $text-color: #222 !global;
- // Action colors
- $default-color: #999 !global;
- $positive-color: #99cc00 !global;
- $negative-color: #ff4444 !global;
- // Bars
- $bar-base-height: 50px !global;
- $bar-tab-height: 50px !global;
- // Borders
- $border-default: 1px solid #b1b1b1 !global;
- $border-radius: 2px !global;
- // 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-header-secondary ~ .content {
- padding-top: $bar-base-height*2;
- }
- .bar-tab ~ .content {
- padding-top: $bar-tab-height;
- padding-bottom: 0;
- }
- .bar-footer ~ .content {
- padding-bottom: $bar-base-height;
- }
- .bar-footer-secondary ~ .content {
- padding-bottom: ($bar-base-height*2);
- }
- // Buttons
- // --------------------------------------------------
- .btn {
- padding: 8px 15px;
- font-size: 14px;
- color: $text-color;
- background-color: #cecece;
- border: 0;
- border-radius: $border-radius;
- @include 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;
- background-color: $default-color;
- border: 0;
- @include 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;
- background-color: $primary-color;
- border: 0;
- &:active,
- &.active {
- color: #fff;
- border: 0;
- background-color: darken($primary-color, 10%);
- }
- }
- // Positive button (Default color is green)
- .btn-positive {
- color: #fff;
- background-color: $positive-color;
- border: 0;
- &:active,
- &.active {
- color: #fff;
- background-color: darken($positive-color, 10%);
- border: 0;
- }
- }
- // Negative button (Default color is red)
- .btn-negative {
- color: #fff;
- background-color: $negative-color;
- border: 0;
- &:active,
- &.active {
- color: #fff;
- background-color: darken($negative-color, 10%);
- border: 0;
- }
- }
- // Outlined buttons
- .btn-outlined {
- background-color: transparent;
- border: 1px solid $default-color;
- @include box-shadow(none);
- &.btn-primary {
- color: $primary-color;
- border: 1px solid $primary-color;
- &:active {
- background-color: $primary-color;
- border: 1px solid $primary-color;
- }
- }
- &.btn-positive {
- color: $positive-color;
- border: 1px solid $positive-color;
- &:active {
- background-color: $positive-color;
- border: 1px solid $positive-color;
- }
- }
- &.btn-negative {
- color: $negative-color;
- border: 1px solid $negative-color;
- &:active {
- background-color: $negative-color;
- border: 1px solid $negative-color;
- }
- }
- // Active states
- &:active {
- background-color: $default-color;
- border: 1px solid $default-color;
- @include box-shadow(none);
- }
- &.btn-primary:active,
- &.btn-positive:active,
- &.btn-negative:active {
- color: #fff;
- @include box-shadow(none);
- }
- }
- // Link button (Buttons that look like links)
- .btn-link {
- color: $primary-color;
- background-color: transparent;
- border: none;
- @include box-shadow(none);
- &:active,
- &.active {
- color: darken($primary-color, 10%);
- background-color: transparent;
- @include 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;
- @include 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;
- }
- // Give the footers the correct border
- .bar-footer,
- .bar-footer-secondary,
- .bar-footer-secondary-tab {
- border-top: $border-default;
- border-bottom: 0;
- @include box-shadow(inset 0 -2px 0 $primary-color);
- }
- }
- .bar-tab {
- top: 0;
- bottom: auto;
- height: $bar-tab-height;
- border-top: 0;
- .tab-item {
- color: #929292;
- // Active states for the tab bar
- &.active {
- color: $primary-color;
- @include box-shadow(inset 0 -2px 0 $primary-color);
- }
- //Pressed state
- &:active {
- color: #929292;
- background-color: #78c6e3;
- }
- .icon {
- top: 3px;
- padding-top: 0;
- padding-bottom: 0;
- }
- }
- }
- // 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 {
- top: 7px;
- padding-top: 10px;
- padding-bottom: 10px;
- }
- .btn-link {
- top: 0;
- padding: 0;
- font-size: $font-size-default;
- line-height: 49px;
- color: $primary-color;
- &:active,
- &.active {
- color: darken($primary-color, 10%);
- }
- // Make sure link buttons w/ icons line up with the content correctly
- .icon {
- top: 2px;
- padding: 0;
- }
- }
- .btn-block {
- top: 4px;
- }
- }
- // Bars with segmented-controls
- //
- // Remove standard segmented bottom margin
- .bar .segmented-control {
- top: 7px;
- }
- // Bars with Ratchicons
- .bar {
- .icon {
- padding-top: 13px;
- padding-bottom: 13px;
- }
- // Handle carets in the titles
- .title .icon {
- padding: 0;
- &.icon-caret {
- top: 10px;
- color: #777;
- }
- }
- }
- // Standard bars with search forms
- //
- // Position/size search bar within the bar
- .bar input[type="search"] {
- height: 35px;
- }
- // 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 {
- background-color: transparent;
- border-color: #d9d9d9;
- border-radius: $border-radius;
- }
- // 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 {
- color: inherit;
- background-color: #e0e0e0;
- .icon {
- color: #fff;
- }
- }
- }
- // Table view dividers
- .table-view-divider {
- padding-top: 25px;
- font-size: 12px;
- font-weight: bold;
- text-transform: uppercase;
- background-color: transparent;
- border-top: 0;
- border-bottom: 2px solid #a9a9a9;
- }
- }
- // Table-views with buttons, badges and toggles
- // --------------------------------------------------
- .table-view-cell,
- .table-view-cell > a {
- // Android has no cheverons so don't bump the buttons, badges, or toggles over.
- .navigate-left,
- .navigate-right,
- .push-left,
- .push-right {
- > .btn,
- > .badge,
- > .toggle {
- right: 15px;
- }
- }
- }
- // 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);
- @include 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;
- @include 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 {
- height: 40px; // Matches the height of inputs.
- border-bottom: 1px solid #d9d9d9;
- }
- .input-row label {
- padding-top: 10px;
- padding-bottom: 10px;
- }
- // 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;
- @include 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;
- @include 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: 47px;
- left: 15px;
- width: 200px;
- margin-left: 0;
- border: 1px solid #9b9b9b;
- border-radius: 0;
- -webkit-transition: -webkit-transform .1s ease-in-out, opacity .2s ease-in-out;
- -moz-transition: -moz-transform .1s ease-in-out, opacity .2s ease-in-out;
- transition: transform .1s ease-in-out, opacity .2s ease-in-out;
- @include box-shadow(0 0 3px rgba(0,0,0,.2));
- @include transform(scale(.75));
- &:before {
- display: none;
- }
- &.visible {
- @include transform(scale(1));
- }
- }
- // Remove the popover's backdrop
- .backdrop {
- background-color: transparent;
- }
- // 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;
- background-color: #d7d7d7;
- border: 2px solid #d7d7d7;
- border-radius: 0;
- // Sliding handle
- .toggle-handle {
- top: 0;
- left: 0;
- width: 50px;
- height: 24px;
- background-color: #bebebe;
- border: 1px solid #b5b5b5;
- border-radius: 2px;
- @include 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;
- border: 2px solid #d7d7d7;
- .toggle-handle {
- margin-right: 2px;
- background-color: $primary-color;
- border-color: $primary-color;
- @include transform(translate3d(50px,0,0));
- }
- &:before {
- right: 14px;
- left: auto;
- color: #fff;
- }
- }
- }
- // Push icons
- // --------------------------------------------------
- // Deprecated `push-left` and `push-right` as of 2.0.2
- .navigate-left:after,
- .push-left:after {
- content: '';
- }
- .navigate-right:after,
- .push-right:after {
- content: '';
- }
- // Ratchicons for Android
- // --------------------------------------------------
- .icon-caret:before { content: '\e800'; }
- .icon-down:before,
- .icon-down-nav:before { content: '\e801'; }
- .icon-download:before { content: '\e802'; }
- .icon-left:before,
- .icon-left-nav:before { content: '\e803'; }
- .icon-more-vertical:before { content: '\e804'; }
- .icon-more:before { content: '\e805'; }
- .icon-right:before,
- .icon-right-nav:before { content: '\e806'; }
- .icon-search:before { content: '\e807'; }
- .icon-share:before { content: '\e808'; }
- .icon-up:before,
- .icon-up-nav:before { content: '\e809'; }
|