theme-android.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. @import "mixins.scss";
  2. //
  3. // Android theme
  4. // Visuals and interactions in the style of Android
  5. //
  6. // --------------------------------------------------
  7. // Variables
  8. // --------------------------------------------------
  9. // Type
  10. $font-family-default: 'Roboto', sans-serif !global;
  11. $font-size-default: 18px !global;
  12. $font-weight: 500 !global;
  13. $font-weight-light: 400 !global;
  14. $line-height-default: 22px !global;
  15. // Colors
  16. //
  17. // Main theme colors
  18. $primary-color: #33b5e5 !global;
  19. $chrome-color: #dddddd !global;
  20. $text-color: #222 !global;
  21. // Action colors
  22. $default-color: #999 !global;
  23. $positive-color: #99cc00 !global;
  24. $negative-color: #ff4444 !global;
  25. // Bars
  26. $bar-base-height: 50px !global;
  27. $bar-tab-height: 50px !global;
  28. // Borders
  29. $border-default: 1px solid #b1b1b1 !global;
  30. $border-radius: 2px !global;
  31. // Base
  32. // --------------------------------------------------
  33. body {
  34. font-family: $font-family-default;
  35. font-size: $font-size-default;
  36. line-height: $line-height-default;
  37. color: $text-color;
  38. }
  39. // Universal link styling
  40. a {
  41. color: $primary-color;
  42. &:active {
  43. color: darken($primary-color, 10%);
  44. }
  45. }
  46. // Content
  47. .content {
  48. background-color: #f2f2f2;
  49. }
  50. // Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab.
  51. // Note: For these to work, content must come after both bars in the markup
  52. .bar-nav ~ .content {
  53. padding-top: $bar-base-height;
  54. }
  55. .bar-header-secondary ~ .content {
  56. padding-top: $bar-base-height*2;
  57. }
  58. .bar-tab ~ .content {
  59. padding-top: $bar-tab-height;
  60. padding-bottom: 0;
  61. }
  62. .bar-footer ~ .content {
  63. padding-bottom: $bar-base-height;
  64. }
  65. .bar-footer-secondary ~ .content {
  66. padding-bottom: ($bar-base-height*2);
  67. }
  68. // Buttons
  69. // --------------------------------------------------
  70. .btn {
  71. padding: 8px 15px;
  72. font-size: 14px;
  73. color: $text-color;
  74. background-color: #cecece;
  75. border: 0;
  76. border-radius: $border-radius;
  77. @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));
  78. // Active & filled button styles
  79. &:active,
  80. &.active {
  81. color: $text-color;
  82. background-color: $default-color;
  83. border: 0;
  84. @include box-shadow(inset 0 -1px 0 rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.2));
  85. }
  86. }
  87. // Other button types
  88. // --------------------------------------------------
  89. // Primary button (Default color is blue)
  90. .btn-primary {
  91. color: #fff;
  92. background-color: $primary-color;
  93. border: 0;
  94. &:active,
  95. &.active {
  96. color: #fff;
  97. border: 0;
  98. background-color: darken($primary-color, 10%);
  99. }
  100. }
  101. // Positive button (Default color is green)
  102. .btn-positive {
  103. color: #fff;
  104. background-color: $positive-color;
  105. border: 0;
  106. &:active,
  107. &.active {
  108. color: #fff;
  109. background-color: darken($positive-color, 10%);
  110. border: 0;
  111. }
  112. }
  113. // Negative button (Default color is red)
  114. .btn-negative {
  115. color: #fff;
  116. background-color: $negative-color;
  117. border: 0;
  118. &:active,
  119. &.active {
  120. color: #fff;
  121. background-color: darken($negative-color, 10%);
  122. border: 0;
  123. }
  124. }
  125. // Outlined buttons
  126. .btn-outlined {
  127. background-color: transparent;
  128. border: 1px solid $default-color;
  129. @include box-shadow(none);
  130. &.btn-primary {
  131. color: $primary-color;
  132. border: 1px solid $primary-color;
  133. &:active {
  134. background-color: $primary-color;
  135. border: 1px solid $primary-color;
  136. }
  137. }
  138. &.btn-positive {
  139. color: $positive-color;
  140. border: 1px solid $positive-color;
  141. &:active {
  142. background-color: $positive-color;
  143. border: 1px solid $positive-color;
  144. }
  145. }
  146. &.btn-negative {
  147. color: $negative-color;
  148. border: 1px solid $negative-color;
  149. &:active {
  150. background-color: $negative-color;
  151. border: 1px solid $negative-color;
  152. }
  153. }
  154. // Active states
  155. &:active {
  156. background-color: $default-color;
  157. border: 1px solid $default-color;
  158. @include box-shadow(none);
  159. }
  160. &.btn-primary:active,
  161. &.btn-positive:active,
  162. &.btn-negative:active {
  163. color: #fff;
  164. @include box-shadow(none);
  165. }
  166. }
  167. // Link button (Buttons that look like links)
  168. .btn-link {
  169. color: $primary-color;
  170. background-color: transparent;
  171. border: none;
  172. @include box-shadow(none);
  173. &:active,
  174. &.active {
  175. color: darken($primary-color, 10%);
  176. background-color: transparent;
  177. @include box-shadow(none);
  178. }
  179. }
  180. // Block buttons
  181. .btn-block {
  182. padding: 15px 0;
  183. font-size: 18px;
  184. }
  185. // Buttons with badges
  186. .btn {
  187. .badge {
  188. background-color: rgba(0,0,0,.15);
  189. &.badge-inverted {
  190. background-color: transparent;
  191. }
  192. }
  193. // Active states
  194. &:active .badge {
  195. color: #fff;
  196. }
  197. }
  198. // Bars
  199. // --------------------------------------------------
  200. .bar {
  201. height: $bar-base-height;
  202. background-color: $chrome-color;
  203. border-bottom: $border-default;
  204. @include box-shadow(inset 0 -2px 0 #d2d2d2, 0 3px 3px rgba(0,0,0,.07));
  205. // Modifier class to dock any bar below .bar-nav
  206. &.bar-header-secondary {
  207. top: $bar-base-height;
  208. }
  209. // Modifier class to dock any bar above a standard bar
  210. &.bar-footer-secondary {
  211. bottom: $bar-base-height;
  212. }
  213. // Modifier class to dock any bar above a .bar-tab
  214. &.bar-footer-secondary-tab {
  215. bottom: $bar-tab-height;
  216. }
  217. // Give the footers the correct border
  218. .bar-footer,
  219. .bar-footer-secondary,
  220. .bar-footer-secondary-tab {
  221. border-top: $border-default;
  222. border-bottom: 0;
  223. @include box-shadow(inset 0 -2px 0 $primary-color);
  224. }
  225. }
  226. .bar-tab {
  227. top: 0;
  228. bottom: auto;
  229. height: $bar-tab-height;
  230. border-top: 0;
  231. .tab-item {
  232. color: #929292;
  233. // Active states for the tab bar
  234. &.active {
  235. color: $primary-color;
  236. @include box-shadow(inset 0 -2px 0 $primary-color);
  237. }
  238. //Pressed state
  239. &:active {
  240. color: #929292;
  241. background-color: #78c6e3;
  242. }
  243. .icon {
  244. top: 3px;
  245. padding-top: 0;
  246. padding-bottom: 0;
  247. }
  248. }
  249. }
  250. // Left aligned text in the .bar-nav
  251. .title {
  252. position: static;
  253. padding-left: 15px;
  254. font-size: $font-size-default;
  255. line-height: 49px;
  256. text-align: left;
  257. }
  258. // Bars with buttons
  259. .bar {
  260. .btn {
  261. top: 7px;
  262. padding-top: 10px;
  263. padding-bottom: 10px;
  264. }
  265. .btn-link {
  266. top: 0;
  267. padding: 0;
  268. font-size: $font-size-default;
  269. line-height: 49px;
  270. color: $primary-color;
  271. &:active,
  272. &.active {
  273. color: darken($primary-color, 10%);
  274. }
  275. // Make sure link buttons w/ icons line up with the content correctly
  276. .icon {
  277. top: 2px;
  278. padding: 0;
  279. }
  280. }
  281. .btn-block {
  282. top: 4px;
  283. }
  284. }
  285. // Bars with segmented-controls
  286. //
  287. // Remove standard segmented bottom margin
  288. .bar .segmented-control {
  289. top: 7px;
  290. }
  291. // Bars with Ratchicons
  292. .bar {
  293. .icon {
  294. padding-top: 13px;
  295. padding-bottom: 13px;
  296. }
  297. // Handle carets in the titles
  298. .title .icon {
  299. padding: 0;
  300. &.icon-caret {
  301. top: 10px;
  302. color: #777;
  303. }
  304. }
  305. }
  306. // Standard bars with search forms
  307. //
  308. // Position/size search bar within the bar
  309. .bar input[type="search"] {
  310. height: 35px;
  311. }
  312. // Badges
  313. // --------------------------------------------------
  314. .badge {
  315. &.badge-inverted {
  316. color: $default-color;
  317. background-color: transparent;
  318. }
  319. }
  320. // Badge modifiers
  321. //
  322. // Main badge
  323. .badge-primary {
  324. color: #fff;
  325. background-color: $primary-color;
  326. &.badge-inverted {
  327. color: $primary-color;
  328. background-color: transparent;
  329. }
  330. }
  331. // Positive badge
  332. .badge-positive {
  333. color: #fff;
  334. background-color: $positive-color;
  335. &.badge-inverted {
  336. color: $positive-color;
  337. background-color: transparent;
  338. }
  339. }
  340. // Negative badge
  341. .badge-negative {
  342. color: #fff;
  343. background-color: $negative-color;
  344. &.badge-inverted {
  345. color: $negative-color;
  346. background-color: transparent;
  347. }
  348. }
  349. // Cards
  350. // --------------------------------------------------
  351. .card {
  352. background-color: transparent;
  353. border-color: #d9d9d9;
  354. border-radius: $border-radius;
  355. }
  356. // Table views
  357. // --------------------------------------------------
  358. .table-view {
  359. background-color: transparent;
  360. .table-view-cell {
  361. border-bottom: 1px solid #d9d9d9;
  362. // Remove the border from the last table view item
  363. &:last-child {
  364. background-image: none;
  365. }
  366. > a:not(.btn):active {
  367. color: inherit;
  368. background-color: #e0e0e0;
  369. .icon {
  370. color: #fff;
  371. }
  372. }
  373. }
  374. // Table view dividers
  375. .table-view-divider {
  376. padding-top: 25px;
  377. font-size: 12px;
  378. font-weight: bold;
  379. text-transform: uppercase;
  380. background-color: transparent;
  381. border-top: 0;
  382. border-bottom: 2px solid #a9a9a9;
  383. }
  384. }
  385. // Table-views with buttons, badges and toggles
  386. // --------------------------------------------------
  387. .table-view-cell,
  388. .table-view-cell > a {
  389. // Android has no cheverons so don't bump the buttons, badges, or toggles over.
  390. .navigate-left,
  391. .navigate-right,
  392. .push-left,
  393. .push-right {
  394. > .btn,
  395. > .badge,
  396. > .toggle {
  397. right: 15px;
  398. }
  399. }
  400. }
  401. // Forms
  402. // --------------------------------------------------
  403. select,
  404. textarea,
  405. input[type="text"],
  406. input[type="search"],
  407. input[type="password"],
  408. input[type="datetime"],
  409. input[type="datetime-local"],
  410. input[type="date"],
  411. input[type="month"],
  412. input[type="time"],
  413. input[type="week"],
  414. input[type="number"],
  415. input[type="email"],
  416. input[type="url"],
  417. input[type="tel"],
  418. input[type="color"],
  419. .input-group {
  420. height: 40px;
  421. padding: 10px 15px;
  422. border: 1px solid rgba(0, 0, 0, .2);
  423. @include box-shadow(0 1px 1px rgba(0,0,0,.1));
  424. }
  425. input[type="search"] {
  426. border-radius: $border-radius;
  427. }
  428. select,
  429. textarea,
  430. .input-group {
  431. height: auto;
  432. }
  433. // Input groups (cluster multiple inputs together into a single group)
  434. // -------------------------------------------------------------------
  435. .input-group {
  436. padding: 0;
  437. border: 0;
  438. }
  439. .input-group input {
  440. border: 0;
  441. border-bottom: 1px solid #d9d9d9;
  442. @include box-shadow(none);
  443. }
  444. // Remove bottom border on last input to avoid double bottom border
  445. .input-group input:last-child {
  446. background-image: none;
  447. }
  448. // Input groups with labels
  449. // --------------------------------------------------
  450. // To use labels with input groups, wrap a label and an input in an .input-row
  451. .input-row {
  452. height: 40px; // Matches the height of inputs.
  453. border-bottom: 1px solid #d9d9d9;
  454. }
  455. .input-row label {
  456. padding-top: 10px;
  457. padding-bottom: 10px;
  458. }
  459. // Remove bottom border on last input-row to avoid double bottom border
  460. .input-row label + input {
  461. background-image: none;
  462. border-bottom: 0;
  463. }
  464. // Segmented controllers
  465. // --------------------------------------------------
  466. .segmented-control {
  467. font-size: 14px;
  468. background-color: #cecece;
  469. border: 0;
  470. border-radius: $border-radius;
  471. @include box-shadow(0 1px 1px rgba(0,0,0,.25));
  472. .control-item {
  473. padding-top: 10px;
  474. padding-bottom: 10px;
  475. color: $text-color;
  476. border-left: 1px solid #999;
  477. @include box-shadow(inset 0 -1px 0 rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.2));
  478. // Remove border-left and shadow from first section
  479. &:first-child {
  480. border-left-width: 0;
  481. }
  482. &:active,
  483. &.active {
  484. background-color: $default-color;
  485. }
  486. }
  487. }
  488. // Other segmented controller types
  489. // --------------------------------------------------
  490. // Primary
  491. .segmented-control-primary {
  492. border: 0;
  493. .control-item {
  494. color: #fff;
  495. border-color: inherit;
  496. &:active,
  497. &.active {
  498. color: #fff;
  499. background-color: $primary-color;
  500. }
  501. }
  502. }
  503. // Positive
  504. .segmented-control-positive {
  505. border: 0;
  506. .control-item {
  507. color: #fff;
  508. border-color: inherit;
  509. &:active,
  510. &.active {
  511. color: #fff;
  512. background-color: $positive-color;
  513. }
  514. }
  515. }
  516. // Negative
  517. .segmented-control-negative {
  518. border: 0;
  519. .control-item {
  520. color: #fff;
  521. border-color: inherit;
  522. &:active,
  523. &.active {
  524. color: #fff;
  525. background-color: $negative-color;
  526. }
  527. }
  528. }
  529. // Popovers
  530. // --------------------------------------------------
  531. .popover {
  532. top: 47px;
  533. left: 15px;
  534. width: 200px;
  535. margin-left: 0;
  536. border: 1px solid #9b9b9b;
  537. border-radius: 0;
  538. -webkit-transition: -webkit-transform .1s ease-in-out, opacity .2s ease-in-out;
  539. -moz-transition: -moz-transform .1s ease-in-out, opacity .2s ease-in-out;
  540. transition: transform .1s ease-in-out, opacity .2s ease-in-out;
  541. @include box-shadow(0 0 3px rgba(0,0,0,.2));
  542. @include transform(scale(.75));
  543. &:before {
  544. display: none;
  545. }
  546. &.visible {
  547. @include transform(scale(1));
  548. }
  549. }
  550. // Remove the popover's backdrop
  551. .backdrop {
  552. background-color: transparent;
  553. }
  554. // Popovers with bars
  555. .popover {
  556. .bar {
  557. border-radius: 0;
  558. }
  559. // Padding the content correctly.
  560. .bar-nav ~ .table-view {
  561. padding-top: $bar-base-height;
  562. }
  563. }
  564. // Popovers with table-views
  565. .popover .table-view {
  566. border-radius: 12px;
  567. }
  568. // Toggles styles
  569. // --------------------------------------------------
  570. .toggle {
  571. width: 104px;
  572. height: 28px;
  573. background-color: #d7d7d7;
  574. border: 2px solid #d7d7d7;
  575. border-radius: 0;
  576. // Sliding handle
  577. .toggle-handle {
  578. top: 0;
  579. left: 0;
  580. width: 50px;
  581. height: 24px;
  582. background-color: #bebebe;
  583. border: 1px solid #b5b5b5;
  584. border-radius: 2px;
  585. @include box-shadow(inset 0 1px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.1));
  586. }
  587. &:before {
  588. top: 1px;
  589. right: auto;
  590. left: 11px;
  591. z-index: 3;
  592. color: #fff;
  593. }
  594. // Active state for toggle
  595. &.active {
  596. background-color: #d7d7d7;
  597. border: 2px solid #d7d7d7;
  598. .toggle-handle {
  599. margin-right: 2px;
  600. background-color: $primary-color;
  601. border-color: $primary-color;
  602. @include transform(translate3d(50px,0,0));
  603. }
  604. &:before {
  605. right: 14px;
  606. left: auto;
  607. color: #fff;
  608. }
  609. }
  610. }
  611. // Push icons
  612. // --------------------------------------------------
  613. // Deprecated `push-left` and `push-right` as of 2.0.2
  614. .navigate-left:after,
  615. .push-left:after {
  616. content: '';
  617. }
  618. .navigate-right:after,
  619. .push-right:after {
  620. content: '';
  621. }
  622. // Ratchicons for Android
  623. // --------------------------------------------------
  624. .icon-caret:before { content: '\e800'; }
  625. .icon-down:before,
  626. .icon-down-nav:before { content: '\e801'; }
  627. .icon-download:before { content: '\e802'; }
  628. .icon-left:before,
  629. .icon-left-nav:before { content: '\e803'; }
  630. .icon-more-vertical:before { content: '\e804'; }
  631. .icon-more:before { content: '\e805'; }
  632. .icon-right:before,
  633. .icon-right-nav:before { content: '\e806'; }
  634. .icon-search:before { content: '\e807'; }
  635. .icon-share:before { content: '\e808'; }
  636. .icon-up:before,
  637. .icon-up-nav:before { content: '\e809'; }