theme-ios.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. @import "mixins.scss";
  2. //
  3. // iOS theme
  4. // Visuals and interactions in the style of iOS
  5. //
  6. // --------------------------------------------------
  7. // Variables
  8. // --------------------------------------------------
  9. // Colors
  10. //
  11. // Main theme colors
  12. $primary-color: #007aff !global;
  13. $chrome-color: rgba(247,247,247,.98) !global;
  14. // Action colors
  15. $default-color: #929292 !global;
  16. $positive-color: #4cd964 !global;
  17. $negative-color: #dd524d !global;
  18. // Bars
  19. $bar-base-height: 44px !global;
  20. $bar-tab-height: 50px !global;
  21. // iOS style transitions
  22. $timing-fuction: cubic-bezier(.1, .5, .1, 1) !global; // Inspired by @c2prods
  23. // Base
  24. // --------------------------------------------------
  25. // Universal link styling
  26. a {
  27. color: $primary-color;
  28. &:active {
  29. color: darken($primary-color, 10%);
  30. }
  31. }
  32. // Content
  33. .content {
  34. background-color: #efeff4;
  35. }
  36. // Typography
  37. // --------------------------------------------------
  38. .h5, h5,
  39. .h6, h6,
  40. p {
  41. color: #8f8f94;
  42. }
  43. .h5, h5,
  44. .h6, h6 {
  45. font-weight: normal;
  46. text-transform: uppercase;
  47. }
  48. // Buttons
  49. // --------------------------------------------------
  50. .btn {
  51. color: $default-color;
  52. background-color: $chrome-color;
  53. border: 1px solid $default-color;
  54. @include transition(all);
  55. @include transition-duration(.2s);
  56. @include transition-timing-function(linear);
  57. // Active & filled button styles
  58. &:active,
  59. &.active {
  60. color: #fff;
  61. background-color: $default-color;
  62. }
  63. }
  64. // Other button types
  65. // --------------------------------------------------
  66. // Primary button (Default color is blue)
  67. .btn-primary {
  68. color: #fff;
  69. background-color: $primary-color;
  70. border: 1px solid $primary-color;
  71. &:active,
  72. &.active {
  73. background-color: darken($primary-color, 10%);
  74. border: 1px solid darken($primary-color, 10%);
  75. }
  76. }
  77. // Positive button (Default color is green)
  78. .btn-positive {
  79. color: #fff;
  80. background-color: $positive-color;
  81. border: 1px solid $positive-color;
  82. &:active,
  83. &.active {
  84. background-color: darken($positive-color, 10%);
  85. border: 1px solid darken($positive-color, 10%);
  86. }
  87. }
  88. // Negative button (Default color is red)
  89. .btn-negative {
  90. color: #fff;
  91. background-color: $negative-color;
  92. border: 1px solid $negative-color;
  93. &:active,
  94. &.active {
  95. background-color: darken($negative-color, 10%);
  96. border: 1px solid darken($negative-color, 10%);
  97. }
  98. }
  99. // Outlined buttons
  100. .btn-outlined {
  101. background-color: transparent;
  102. &.btn-primary {
  103. color: $primary-color;
  104. }
  105. &.btn-positive {
  106. color: $positive-color;
  107. }
  108. &.btn-negative {
  109. color: $negative-color;
  110. }
  111. // Active states
  112. &.btn-primary:active,
  113. &.btn-positive:active,
  114. &.btn-negative:active {
  115. color: #fff;
  116. }
  117. }
  118. // Link button (Buttons that look like links)
  119. .btn-link {
  120. color: $primary-color;
  121. background-color: transparent;
  122. border: none;
  123. &:active,
  124. &.active {
  125. color: darken($primary-color, 10%);
  126. background-color: transparent;
  127. }
  128. }
  129. // Buttons with badges
  130. .btn {
  131. .badge {
  132. background-color: rgba(0,0,0,.15);
  133. &.badge-inverted {
  134. background-color: transparent;
  135. }
  136. }
  137. // Active states
  138. &:active .badge {
  139. color: #fff;
  140. }
  141. }
  142. // Bars
  143. // --------------------------------------------------
  144. // Default bar
  145. .bar {
  146. background-color: $chrome-color;
  147. border-bottom: 0;
  148. @include box-shadow(0 0 1px rgba(0,0,0,.85));
  149. // Modifier class to dock any bar below .bar-nav
  150. &.bar-header-secondary {
  151. top: $bar-base-height;
  152. }
  153. // Modifier class to dock any bar above a standard bar
  154. &.bar-footer-secondary {
  155. bottom: $bar-base-height;
  156. }
  157. // Modifier class to dock any bar above a .bar-tab
  158. &.bar-footer-secondary-tab {
  159. bottom: $bar-tab-height;
  160. }
  161. // Give the footers the correct border
  162. &.bar-footer,
  163. &.bar-footer-secondary,
  164. &.bar-footer-secondary-tab {
  165. border-top: 0;
  166. }
  167. }
  168. // Tab bar
  169. .bar-tab {
  170. border-top: 0;
  171. }
  172. .tab-item {
  173. color: #929292;
  174. // Active states for the tab bar
  175. &.active,
  176. &:active {
  177. color: $primary-color;
  178. }
  179. }
  180. // Nav bars with buttons
  181. .bar-nav {
  182. // Link buttons in nav bars
  183. .btn-link {
  184. color: $primary-color;
  185. &:active {
  186. color: $primary-color;
  187. opacity: .6;
  188. }
  189. }
  190. }
  191. // Badges
  192. // --------------------------------------------------
  193. .badge {
  194. &.badge-inverted {
  195. color: $default-color;
  196. background-color: transparent;
  197. }
  198. }
  199. // Badge modifiers
  200. //
  201. // Main badge
  202. .badge-primary {
  203. color: #fff;
  204. background-color: $primary-color;
  205. &.badge-inverted {
  206. color: $primary-color;
  207. background-color: transparent;
  208. }
  209. }
  210. // Positive badge
  211. .badge-positive {
  212. color: #fff;
  213. background-color: $positive-color;
  214. &.badge-inverted {
  215. color: $positive-color;
  216. background-color: transparent;
  217. }
  218. }
  219. // Negative badge
  220. .badge-negative {
  221. color: #fff;
  222. background-color: $negative-color;
  223. &.badge-inverted {
  224. color: $negative-color;
  225. background-color: transparent;
  226. }
  227. }
  228. // Cards
  229. // --------------------------------------------------
  230. // Cards with table-views
  231. .card .table-view {
  232. background-image: none;
  233. }
  234. .card .table-view-cell:last-child {
  235. background-image: none;
  236. }
  237. // Table views
  238. // --------------------------------------------------
  239. .table-view {
  240. border-top: 0;
  241. border-bottom: 0;
  242. @include hairline(double, #c8c7cc, 0); // Double grey border.
  243. .table-view-cell {
  244. border-bottom: 0;
  245. @include hairline(single, #c8c7cc, 15px); // Single grey border with 15px offset.
  246. // Remove the border from the last table view item
  247. &:last-child {
  248. background-image: none;
  249. }
  250. > a:not(.btn):active {
  251. color: inherit;
  252. }
  253. }
  254. // Table view dividers
  255. .table-view-divider {
  256. border-top: 0;
  257. border-bottom: 0;
  258. @include hairline(double, #c8c7cc, 0); // Double (top and bottom) grey border with no offset.
  259. }
  260. }
  261. // Forms
  262. // --------------------------------------------------
  263. select,
  264. textarea,
  265. input[type="text"],
  266. input[type="search"],
  267. input[type="password"],
  268. input[type="datetime"],
  269. input[type="datetime-local"],
  270. input[type="date"],
  271. input[type="month"],
  272. input[type="time"],
  273. input[type="week"],
  274. input[type="number"],
  275. input[type="email"],
  276. input[type="url"],
  277. input[type="tel"],
  278. input[type="color"],
  279. .input-group {
  280. height: 40px;
  281. padding: 10px 15px;
  282. border: 1px solid rgba(0, 0, 0, .2);
  283. }
  284. // Rounded search input
  285. input[type="search"] {
  286. height: 34px;
  287. text-align: center;
  288. background-color: rgba(0,0,0,.1);
  289. border: 0;
  290. border-radius: 6px;
  291. }
  292. input[type="search"]:focus {
  293. text-align: left;
  294. }
  295. select,
  296. textarea,
  297. .input-group {
  298. height: auto;
  299. }
  300. // Input groups (cluster multiple inputs together into a single group)
  301. // -------------------------------------------------------------------
  302. .input-group {
  303. padding: 0;
  304. border: 0;
  305. @include hairline(double, #c8c7cc, 0); // Double grey border.
  306. }
  307. .input-group input {
  308. border: 0;
  309. @include hairline(single, #c8c7cc, 15px);
  310. }
  311. // Remove bottom border on last input to avoid double bottom border
  312. .input-group input:last-child {
  313. background-image: none;
  314. }
  315. // Input groups with labels
  316. // --------------------------------------------------
  317. // To use labels with input groups, wrap a label and an input in an .input-row
  318. .input-row {
  319. border-bottom: 0;
  320. @include hairline(single, #c8c7cc, 15px); // Single grey border with a 15px offset.
  321. }
  322. // Remove bottom border on last input-row to avoid double bottom border
  323. .input-row:last-child,
  324. .input-row label + input {
  325. background-image: none;
  326. }
  327. // Segmented controls
  328. // --------------------------------------------------
  329. .segmented-control {
  330. background-color: transparent;
  331. border: 1px solid $default-color;
  332. .control-item {
  333. color: $default-color;
  334. border-color: $default-color;
  335. @include transition(background-color .1s linear);
  336. &:active {
  337. background-color: lighten($default-color, 35%);
  338. }
  339. &.active {
  340. color: #fff;
  341. background-color: $default-color;
  342. }
  343. }
  344. }
  345. // Other segmented controller types
  346. //
  347. // Primary
  348. .segmented-control-primary {
  349. border: 1px solid $primary-color;
  350. .control-item {
  351. color: $primary-color;
  352. border-color: inherit;
  353. &:active {
  354. background-color: lighten($primary-color, 35%);
  355. }
  356. &.active {
  357. color: #fff;
  358. background-color: $primary-color;
  359. }
  360. }
  361. }
  362. // Positive
  363. .segmented-control-positive {
  364. border: 1px solid $positive-color;
  365. .control-item {
  366. color: $positive-color;
  367. border-color: inherit;
  368. &:active {
  369. background-color: lighten($positive-color, 35%);
  370. }
  371. &.active {
  372. color: #fff;
  373. background-color: $positive-color;
  374. }
  375. }
  376. }
  377. // Negative
  378. .segmented-control-negative {
  379. border: 1px solid $negative-color;
  380. .control-item {
  381. color: $negative-color;
  382. border-color: inherit;
  383. &:active {
  384. background-color: lighten($negative-color, 35%);
  385. }
  386. &.active {
  387. color: #fff;
  388. background-color: $negative-color;
  389. }
  390. }
  391. }
  392. // Popovers
  393. // --------------------------------------------------
  394. .popover {
  395. border-radius: 12px;
  396. @include transition(-webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in-out);
  397. &:before {
  398. border-bottom: 15px solid $chrome-color;
  399. }
  400. }
  401. // Popovers with `bar`
  402. .popover .bar {
  403. @include box-shadow(none);
  404. }
  405. // Popovers with `bar-nav`
  406. .popover .bar-nav {
  407. border-bottom: 1px solid rgba(0,0,0,.15);
  408. }
  409. // Popovers with `table-views`
  410. .popover .table-view {
  411. background-image: none;
  412. border-radius: 12px;
  413. }
  414. // Modal styles
  415. // --------------------------------------------------
  416. .modal {
  417. @include transition-timing-function($timing-fuction);
  418. // Active modal
  419. &.active {
  420. @include transition-timing-function($timing-fuction);
  421. }
  422. }
  423. // Toggles styles
  424. // --------------------------------------------------
  425. .toggle {
  426. width: 47px;
  427. border: 2px solid #e6e6e6;
  428. @include box-shadow(inset 0 0 0 0 #e1e1e1);
  429. @include transition-property(box-shadow, border);
  430. @include transition-duration(.2s);
  431. // Sliding handle
  432. .toggle-handle {
  433. border: 1px solid rgba(0, 0, 0, .2);
  434. -webkit-transition-property: -webkit-transform, border, width;
  435. -moz-transition-property: -moz-transform, border, width;
  436. transition-property: transform, border, width;
  437. @include box-shadow(0 3px 3px rgba(0,0,0,.08));
  438. }
  439. &:before {
  440. display: none;
  441. }
  442. // Active state for toggle
  443. &.active {
  444. background-color: transparent;
  445. border: 2px solid $positive-color;
  446. @include box-shadow(inset 0 0 0 13px $positive-color);
  447. .toggle-handle {
  448. @include transform(translate3d(17px,0,0));
  449. }
  450. .toggle-handle {
  451. border-color: $positive-color;
  452. }
  453. }
  454. }
  455. // Push styles
  456. // --------------------------------------------------
  457. .content {
  458. // Fade animation
  459. &.fade {
  460. @include transition(opacity .2s ease-in-out);
  461. }
  462. // Slide animation
  463. &.sliding {
  464. @include transition-timing-function ($timing-fuction);
  465. // Adding the overlay
  466. &.sliding-in,
  467. &.right:not([class*="sliding-in"]) {
  468. @include animation-name(fadeOverlay);
  469. @include animation-duration(.4s);
  470. }
  471. &.right:not([class*="sliding-in"]) {
  472. @include animation-direction(reverse);
  473. }
  474. &.left {
  475. @include transform(translate3d(-20%, 0, 0)); // Creates the parallax effect
  476. }
  477. }
  478. }
  479. // Overlay animation for the slide transition
  480. @at-root {
  481. @-webkit-keyframes fadeOverlay {
  482. from { @include box-shadow(0 0 10px rgba(0,0,0,0), -320px 0 0 rgba(0,0,0,0)); }
  483. to { @include box-shadow(0 0 10px rgba(0,0,0,.3), -320px 0 0 rgba(0,0,0,.1)); }
  484. }
  485. }