screen.css.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. @charset "utf-8";
  2. @import 'normalize';
  3. @import 'variables';
  4. @import 'icon-font';
  5. // @import 'rtl'; // uncomment to switch to RTL format
  6. /*
  7. Copyright 2008-2013 Concur Technologies, Inc.
  8. Licensed under the Apache License, Version 2.0 (the "License"); you may
  9. not use this file except in compliance with the License. You may obtain
  10. a copy of the License at
  11. http://www.apache.org/licenses/LICENSE-2.0
  12. Unless required by applicable law or agreed to in writing, software
  13. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  14. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  15. License for the specific language governing permissions and limitations
  16. under the License.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // GENERAL STUFF
  20. ////////////////////////////////////////////////////////////////////////////////
  21. html, body {
  22. color: $main-text;
  23. padding: 0;
  24. margin: 0;
  25. -webkit-font-smoothing: antialiased;
  26. -moz-osx-font-smoothing: grayscale;
  27. @extend %default-font;
  28. background-color: $main-bg;
  29. height: 100%;
  30. -webkit-text-size-adjust: none; /* Never autoresize text */
  31. }
  32. ////////////////////////////////////////////////////////////////////////////////
  33. // TABLE OF CONTENTS
  34. ////////////////////////////////////////////////////////////////////////////////
  35. #toc > ul > li > a > span {
  36. float: right;
  37. background-color: #2484FF;
  38. border-radius: 40px;
  39. width: 20px;
  40. }
  41. .toc-wrapper {
  42. transition: left 0.3s ease-in-out;
  43. overflow-y: auto;
  44. overflow-x: hidden;
  45. position: fixed;
  46. z-index: 30;
  47. top: 0;
  48. left: 0;
  49. bottom: 0;
  50. width: $nav-width;
  51. background-color: $nav-bg;
  52. font-size: 13px;
  53. font-weight: bold;
  54. // language selector for mobile devices
  55. .lang-selector {
  56. display: none;
  57. a {
  58. padding-top: 0.5em;
  59. padding-bottom: 0.5em;
  60. }
  61. }
  62. // This is the logo at the top of the ToC
  63. .logo {
  64. display: block;
  65. max-width: 100%;
  66. margin-bottom: $logo-margin;
  67. }
  68. &>.search {
  69. position: relative;
  70. input {
  71. background: $nav-bg;
  72. border-width: 0 0 1px 0;
  73. border-color: $search-box-border-color;
  74. padding: 6px 0 6px 20px;
  75. box-sizing: border-box;
  76. margin: $nav-v-padding $nav-padding;
  77. width: $nav-width - ($nav-padding*2);
  78. outline: none;
  79. color: $nav-text;
  80. border-radius: 0; /* ios has a default border radius */
  81. }
  82. &:before {
  83. position: absolute;
  84. top: 17px;
  85. left: $nav-padding;
  86. color: $nav-text;
  87. @extend %icon-search;
  88. }
  89. }
  90. .search-results {
  91. margin-top: 0;
  92. box-sizing: border-box;
  93. height: 0;
  94. overflow-y: auto;
  95. overflow-x: hidden;
  96. transition-property: height, margin;
  97. transition-duration: 180ms;
  98. transition-timing-function: ease-in-out;
  99. background: $nav-subitem-bg;
  100. &.visible {
  101. height: 30%;
  102. margin-bottom: 1em;
  103. }
  104. li {
  105. margin: 1em $nav-padding;
  106. line-height: 1;
  107. }
  108. a {
  109. color: $nav-text;
  110. text-decoration: none;
  111. &:hover {
  112. text-decoration: underline;
  113. }
  114. }
  115. }
  116. // The Table of Contents is composed of multiple nested
  117. // unordered lists. These styles remove the default
  118. // styling of an unordered list because it is ugly.
  119. ul, li {
  120. list-style: none;
  121. margin: 0;
  122. padding: 0;
  123. line-height: 28px;
  124. }
  125. li {
  126. color: $nav-text;
  127. transition-property: background;
  128. transition-timing-function: linear;
  129. transition-duration: 200ms;
  130. }
  131. // This is the currently selected ToC entry
  132. .toc-link.active {
  133. background-color: $nav-active-bg;
  134. color: $nav-active-text;
  135. }
  136. // this is parent links of the currently selected ToC entry
  137. .toc-link.active-parent {
  138. background-color: $nav-active-parent-bg;
  139. color: $nav-active-parent-text;
  140. }
  141. .toc-list-h2 {
  142. display: none;
  143. background-color: $nav-subitem-bg;
  144. font-weight: 500;
  145. }
  146. .toc-h2 {
  147. padding-left: $nav-padding + $nav-indent;
  148. font-size: 12px;
  149. }
  150. .toc-footer {
  151. padding: 1em 0;
  152. margin-top: 1em;
  153. border-top: 1px dashed $nav-footer-border-color;
  154. li,a {
  155. color: $nav-text;
  156. text-decoration: none;
  157. }
  158. a:hover {
  159. text-decoration: underline;
  160. }
  161. li {
  162. font-size: 0.8em;
  163. line-height: 1.7;
  164. text-decoration: none;
  165. }
  166. }
  167. }
  168. .toc-link, .toc-footer li {
  169. padding: 0 $nav-padding 0 $nav-padding;
  170. display: block;
  171. overflow-x: hidden;
  172. white-space: nowrap;
  173. text-overflow: ellipsis;
  174. text-decoration: none;
  175. color: $nav-text;
  176. transition-property: background;
  177. transition-timing-function: linear;
  178. transition-duration: 130ms;
  179. }
  180. // button to show navigation on mobile devices
  181. #nav-button {
  182. span {
  183. display: block;
  184. $side-pad: $main-padding / 2 - 8px;
  185. padding: $side-pad $side-pad $side-pad;
  186. background-color: rgba($main-bg, 0.7);
  187. transform-origin: 0 0;
  188. transform: rotate(-90deg) translate(-100%, 0);
  189. border-radius: 0 0 0 5px;
  190. }
  191. padding: 0 1.5em 5em 0; // increase touch size area
  192. display: none;
  193. position: fixed;
  194. top: 0;
  195. left: 0;
  196. z-index: 100;
  197. color: #000;
  198. text-decoration: none;
  199. font-weight: bold;
  200. opacity: 0.7;
  201. line-height: 16px;
  202. img {
  203. height: 16px;
  204. vertical-align: bottom;
  205. }
  206. transition: left 0.3s ease-in-out;
  207. &:hover { opacity: 1; }
  208. &.open {left: $nav-width}
  209. }
  210. ////////////////////////////////////////////////////////////////////////////////
  211. // PAGE LAYOUT AND CODE SAMPLE BACKGROUND
  212. ////////////////////////////////////////////////////////////////////////////////
  213. .page-wrapper {
  214. margin-left: $nav-width;
  215. position: relative;
  216. z-index: 10;
  217. background-color: $main-bg;
  218. min-height: 100%;
  219. padding-bottom: 1px; // prevent margin overflow
  220. // The dark box is what gives the code samples their dark background.
  221. // It sits essentially under the actual content block, which has a
  222. // transparent background.
  223. // I know, it's hackish, but it's the simplist way to make the left
  224. // half of the content always this background color.
  225. .dark-box {
  226. width: $examples-width;
  227. background-color: $examples-bg;
  228. position: absolute;
  229. right: 0;
  230. top: 0;
  231. bottom: 0;
  232. }
  233. .lang-selector {
  234. position: fixed;
  235. z-index: 50;
  236. border-bottom: 5px solid $lang-select-active-bg;
  237. }
  238. }
  239. .lang-selector {
  240. display: flex;
  241. background-color: $lang-select-bg;
  242. width: 100%;
  243. font-weight: bold;
  244. overflow-x: auto;
  245. a {
  246. display: inline;
  247. color: $lang-select-text;
  248. text-decoration: none;
  249. padding: 0 10px;
  250. line-height: 30px;
  251. outline: 0;
  252. &:active, &:focus {
  253. background-color: $lang-select-pressed-bg;
  254. color: $lang-select-pressed-text;
  255. }
  256. &.active {
  257. background-color: $lang-select-active-bg;
  258. color: $lang-select-active-text;
  259. }
  260. }
  261. &:after {
  262. content: '';
  263. clear: both;
  264. display: block;
  265. }
  266. }
  267. ////////////////////////////////////////////////////////////////////////////////
  268. // CONTENT STYLES
  269. ////////////////////////////////////////////////////////////////////////////////
  270. // This is all the stuff with the light background in the left half of the page
  271. .content {
  272. // fixes webkit rendering bug for some: see #538
  273. -webkit-transform: translateZ(0);
  274. // to place content above the dark box
  275. position: relative;
  276. z-index: 30;
  277. &:after {
  278. content: '';
  279. display: block;
  280. clear: both;
  281. }
  282. &>h1, &>h2, &>h3, &>h4, &>h5, &>h6, &>p, &>table, &>ul, &>ol, &>aside, &>dl {
  283. margin-right: $examples-width;
  284. padding: 0 $main-padding;
  285. box-sizing: border-box;
  286. display: block;
  287. @extend %left-col;
  288. }
  289. &>ul, &>ol {
  290. padding-left: $main-padding + 15px;
  291. }
  292. // the div is the tocify hidden div for placeholding stuff
  293. &>h1, &>h2, &>div {
  294. clear:both;
  295. }
  296. h1 {
  297. @extend %header-font;
  298. font-size: 25px;
  299. padding-top: 0.5em;
  300. padding-bottom: 0.5em;
  301. margin-bottom: $h1-margin-bottom;
  302. margin-top: 2em;
  303. border-top: 1px solid #ccc;
  304. border-bottom: 1px solid #ccc;
  305. background-color: #fdfdfd;
  306. }
  307. h1:first-child, div:first-child + h1 {
  308. border-top-width: 0;
  309. margin-top: 0;
  310. }
  311. h2 {
  312. @extend %header-font;
  313. font-size: 19px;
  314. margin-top: 4em;
  315. margin-bottom: 0;
  316. border-top: 1px solid #ccc;
  317. padding-top: 1.2em;
  318. padding-bottom: 1.2em;
  319. background-image: linear-gradient(to bottom, rgba(#fff, 0.2), rgba(#fff, 0));
  320. }
  321. // h2s right after h1s should bump right up
  322. // against the h1s.
  323. h1 + h2, h1 + div + h2 {
  324. margin-top: $h1-margin-bottom * -1;
  325. border-top: none;
  326. }
  327. h3, h4, h5, h6 {
  328. @extend %header-font;
  329. font-size: 15px;
  330. margin-top: 2.5em;
  331. margin-bottom: 0.8em;
  332. }
  333. h4, h5, h6 {
  334. font-size: 10px;
  335. }
  336. hr {
  337. margin: 2em 0;
  338. border-top: 2px solid $examples-bg;
  339. border-bottom: 2px solid $main-bg;
  340. }
  341. table {
  342. margin-bottom: 1em;
  343. overflow: auto;
  344. th,td {
  345. text-align: left;
  346. vertical-align: top;
  347. line-height: 1.6;
  348. code {
  349. white-space: nowrap;
  350. }
  351. }
  352. th {
  353. padding: 5px 10px;
  354. border-bottom: 1px solid #ccc;
  355. vertical-align: bottom;
  356. }
  357. td {
  358. padding: 10px;
  359. }
  360. tr:last-child {
  361. border-bottom: 1px solid #ccc;
  362. }
  363. tr:nth-child(odd)>td {
  364. background-color: lighten($main-bg,4.2%);
  365. }
  366. tr:nth-child(even)>td {
  367. background-color: lighten($main-bg,2.4%);
  368. }
  369. }
  370. dt {
  371. font-weight: bold;
  372. }
  373. dd {
  374. margin-left: 15px;
  375. }
  376. p, li, dt, dd {
  377. line-height: 1.6;
  378. margin-top: 0;
  379. }
  380. img {
  381. max-width: 100%;
  382. }
  383. code {
  384. background-color: rgba(0,0,0,0.05);
  385. padding: 3px;
  386. border-radius: 3px;
  387. @extend %break-words;
  388. @extend %code-font;
  389. }
  390. pre>code {
  391. background-color: transparent;
  392. padding: 0;
  393. }
  394. aside {
  395. padding-top: 1em;
  396. padding-bottom: 1em;
  397. margin-top: 1.5em;
  398. margin-bottom: 1.5em;
  399. background: $aside-notice-bg;
  400. line-height: 1.6;
  401. &.warning {
  402. background-color: $aside-warning-bg;
  403. }
  404. &.success {
  405. background-color: $aside-success-bg;
  406. }
  407. }
  408. aside:before {
  409. vertical-align: middle;
  410. padding-right: 0.5em;
  411. font-size: 14px;
  412. }
  413. aside.notice:before {
  414. @extend %icon-info-sign;
  415. }
  416. aside.warning:before {
  417. @extend %icon-exclamation-sign;
  418. }
  419. aside.success:before {
  420. @extend %icon-ok-sign;
  421. }
  422. .search-highlight {
  423. padding: 2px;
  424. margin: -3px;
  425. border-radius: 4px;
  426. border: 1px solid #F7E633;
  427. background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%);
  428. }
  429. }
  430. ////////////////////////////////////////////////////////////////////////////////
  431. // CODE SAMPLE STYLES
  432. ////////////////////////////////////////////////////////////////////////////////
  433. // This is all the stuff that appears in the right half of the page
  434. .content {
  435. &>div.highlight {
  436. clear:none;
  437. }
  438. pre, blockquote {
  439. background-color: $code-bg;
  440. color: #fff;
  441. margin: 0;
  442. width: $examples-width;
  443. float:right;
  444. clear:right;
  445. box-sizing: border-box;
  446. @extend %right-col;
  447. &>p { margin: 0; }
  448. a {
  449. color: #fff;
  450. text-decoration: none;
  451. border-bottom: dashed 1px #ccc;
  452. }
  453. }
  454. pre {
  455. @extend %code-font;
  456. padding-top: 2em;
  457. padding-bottom: 2em;
  458. padding: 2em $main-padding;
  459. }
  460. blockquote {
  461. &>p {
  462. background-color: $code-annotation-bg;
  463. padding: $code-annotation-padding 2em;
  464. color: #eee;
  465. }
  466. }
  467. }
  468. ////////////////////////////////////////////////////////////////////////////////
  469. // RESPONSIVE DESIGN
  470. ////////////////////////////////////////////////////////////////////////////////
  471. // These are the styles for phones and tablets
  472. // There are also a couple styles disperesed
  473. @media (max-width: $tablet-width) {
  474. .toc-wrapper {
  475. left: -$nav-width;
  476. &.open {
  477. left: 0;
  478. }
  479. }
  480. .page-wrapper {
  481. margin-left: 0;
  482. }
  483. #nav-button {
  484. display: block;
  485. }
  486. .toc-link {
  487. padding-top: 0.3em;
  488. padding-bottom: 0.3em;
  489. }
  490. }
  491. @media (max-width: $phone-width) {
  492. .dark-box {
  493. display: none;
  494. }
  495. %left-col {
  496. margin-right: 0;
  497. }
  498. .toc-wrapper .lang-selector {
  499. display: block;
  500. }
  501. .page-wrapper .lang-selector {
  502. display: none;
  503. }
  504. %right-col {
  505. width: auto;
  506. float: none;
  507. }
  508. %right-col + %left-col {
  509. margin-top: $main-padding;
  510. }
  511. }
  512. .highlight .c, .highlight .cm, .highlight .c1, .highlight .cs {
  513. color: #909090;
  514. }
  515. .highlight, .highlight .w {
  516. background-color: $code-bg;
  517. }
  518. .copy-clipboard {
  519. float: right;
  520. fill: #9DAAB6;
  521. cursor: pointer;
  522. opacity: 0.4;
  523. height: 18px;
  524. width: 18px;
  525. }
  526. .copy-clipboard:hover {
  527. opacity: 0.8;
  528. }