styles.css 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. /* fonts */
  2. @font-face {
  3. font-family: 'PT Sans';
  4. src: url('fonts/pt_sans-web-bold.woff2') format('woff2'), url('fonts/pt_sans-web-bold.woff') format('woff');
  5. font-weight: bold;
  6. font-style: normal;
  7. }
  8. @font-face {
  9. font-family: 'PT Sans';
  10. src: url('fonts/pt_sans-web-italic.woff2') format('woff2'), url('fonts/pt_sans-web-italic.woff') format('woff');
  11. font-weight: normal;
  12. font-style: italic;
  13. }
  14. @font-face {
  15. font-family: 'PT Sans';
  16. src: url('fonts/pt_sans-web-regular.woff2') format('woff2'), url('fonts/pt_sans-web-regular.woff') format('woff');
  17. font-weight: normal;
  18. font-style: normal;
  19. }
  20. @font-face {
  21. font-family: 'Miriam Libre';
  22. src: url('fonts/miriamlibre-bold.woff2') format('woff2'), url('fonts/miriamlibre-bold.woff') format('woff');
  23. font-weight: bold;
  24. font-style: normal;
  25. }
  26. *,
  27. *::before,
  28. *::after {
  29. font-family: inherit;
  30. color: inherit;
  31. margin: 0;
  32. padding: 0;
  33. box-sizing: border-box;
  34. }
  35. html {
  36. font-size: calc(1em + 0.33vw);
  37. font-family: PT Sans, sans-serif;
  38. line-height: 1.5;
  39. color: #111;
  40. }
  41. * + * {
  42. margin-top: 2.25rem;
  43. }
  44. br,
  45. dt,
  46. dd,
  47. th,
  48. td,
  49. option,
  50. [hidden] + *,
  51. li + li,
  52. body,
  53. .main-and-footer {
  54. margin-top: 0;
  55. }
  56. p + p {
  57. margin-top: 0.75rem;
  58. }
  59. a {
  60. text-decoration: none;
  61. border-bottom: 1px solid;
  62. }
  63. abbr {
  64. text-decoration: none;
  65. cursor: help;
  66. border-bottom: 1px dashed;
  67. }
  68. img {
  69. max-width: 100%;
  70. }
  71. p img {
  72. margin: 0.75rem 0;
  73. }
  74. figure p img {
  75. margin: 0;
  76. }
  77. :focus:not([tabindex="-1"]),
  78. [data-expands]:focus svg,
  79. .patterns a:focus .text {
  80. outline: 3px solid #ccc;
  81. outline-offset: 2px;
  82. }
  83. /* fix for IE :( */
  84. [tabindex="-1"]:focus,
  85. div:not([tabindex]):focus {
  86. outline: none;
  87. }
  88. /* skip link */
  89. [href="#main"] {
  90. display: block;
  91. width: 100%;
  92. padding: 0.75rem;
  93. color: #fff;
  94. background: #000;
  95. position: absolute;
  96. top: -3rem;
  97. text-align: center;
  98. z-index: 1;
  99. }
  100. [href="#main"]:focus {
  101. top: 0;
  102. outline: none;
  103. }
  104. /* text styles */
  105. h1,
  106. h2,
  107. h3,
  108. h4 {
  109. font-family: Miriam Libre, serif;
  110. line-height: 1.125;
  111. }
  112. h1 {
  113. font-size: 2rem;
  114. }
  115. h2 {
  116. font-size: 1.66rem;
  117. }
  118. h3 {
  119. font-size: 1.25rem;
  120. }
  121. h4,
  122. h5 {
  123. font-size: 1rem;
  124. font-family: PT Sans, sans-serif;
  125. }
  126. h5 {
  127. font-size: 0.85rem;
  128. text-transform: uppercase;
  129. }
  130. kbd {
  131. line-height: 1;
  132. font-size: 0.66rem;
  133. padding: 0.1rem 0.33rem;
  134. border-radius: 0.25rem;
  135. border: 2px solid;
  136. box-shadow: 0.125rem 0.125rem 0 #111;
  137. vertical-align: 0.33em;
  138. }
  139. pre,
  140. .file-tree {
  141. overflow-x: auto;
  142. padding: 1.5rem;
  143. border: 1px solid;
  144. }
  145. code {
  146. font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  147. font-size: 0.85em;
  148. }
  149. .cmd {
  150. padding: 0.75rem;
  151. background: #111;
  152. }
  153. .cmd code {
  154. color: #fff;
  155. white-space: nowrap;
  156. }
  157. .cmd code::before {
  158. content: '$';
  159. font-weight: bold;
  160. padding-right: 0.25em;
  161. }
  162. /* Lists */
  163. main ul,
  164. main ol {
  165. margin-left: 2.25rem;
  166. }
  167. main li + li {
  168. margin-top: 0.5rem;
  169. }
  170. main ul ul {
  171. margin-top: 0;
  172. }
  173. /* Buttons */
  174. button {
  175. font-size: 1.25rem;
  176. font-family: inherit;
  177. font-weight: inherit;
  178. background: #111;
  179. color: #fff;
  180. padding: 0.75rem;
  181. border: 0;
  182. }
  183. /* Tables */
  184. table {
  185. text-align: left;
  186. table-layout: fixed;
  187. width: 100%;
  188. border-collapse: collapse;
  189. }
  190. th,
  191. td {
  192. border: 2px solid;
  193. padding: 0.5rem;
  194. line-height: 1.25;
  195. margin: 0;
  196. }
  197. th {
  198. font-weight: bold;
  199. }
  200. th:empty {
  201. border: 0;
  202. }
  203. /* Tested using... table */
  204. .tested {
  205. text-align: center;
  206. }
  207. .tested td {
  208. vertical-align: top;
  209. overflow: hidden;
  210. }
  211. .tested th {
  212. background-color: #111;
  213. border-color: #111;
  214. color: #fff;
  215. }
  216. .tested img {
  217. max-width: 3rem;
  218. }
  219. .tested span {
  220. display: block;
  221. margin: 0;
  222. }
  223. .tested .additional {
  224. font-size: 0.85rem;
  225. }
  226. caption {
  227. font-size: 1.125rem;
  228. padding-bottom: 0.25rem;
  229. font-style: italic;
  230. }
  231. /* Page structure */
  232. .wrapper {
  233. position: relative;
  234. margin-top: 0;
  235. overflow-x: hidden;
  236. }
  237. .intro-and-nav {
  238. font-size: 0.85rem;
  239. width: 15rem;
  240. height: 100vh;
  241. position: fixed;
  242. top: 0;
  243. left: 0;
  244. border-right: 2px solid;
  245. }
  246. .intro-and-nav > div {
  247. padding: 2.25rem;
  248. display: flex;
  249. flex-direction: column;
  250. height: 100%;
  251. }
  252. .logo {
  253. border: 0;
  254. }
  255. .logo img {
  256. width: 100%;
  257. max-width: 12rem;
  258. }
  259. .library-desc {
  260. font-style: italic;
  261. margin-top: 0.5rem;
  262. margin-left: auto;
  263. margin-right: auto;
  264. max-width: 30rem;
  265. }
  266. .main-and-footer {
  267. margin-left: 15rem;
  268. }
  269. .main-and-footer > div {
  270. max-width: 40rem;
  271. margin: 0 auto;
  272. padding: 2.25rem;
  273. }
  274. [role="contentinfo"] {
  275. font-size: 0.85rem;
  276. margin-top: 4rem;
  277. text-align: center;
  278. }
  279. /* Patterns navigation */
  280. .patterns {
  281. overflow: auto;
  282. margin-top: 1.5rem;
  283. }
  284. .patterns * {
  285. margin-top: 0;
  286. }
  287. .patterns h3 {
  288. font-size: 1rem;
  289. }
  290. .patterns h3 + ul {
  291. margin-top: 0.75rem;
  292. }
  293. .patterns li {
  294. line-height: 1.125;
  295. list-style: none;
  296. }
  297. .patterns li + li {
  298. margin-top: 0.75rem;
  299. }
  300. .patterns ul ul {
  301. margin-left: 0.75rem;
  302. }
  303. .pattern a {
  304. border: 0;
  305. display: flex;
  306. flex-wrap: nowrap;
  307. align-items: baseline;
  308. font-weight: bold;
  309. }
  310. .pattern a:focus {
  311. outline: none;
  312. }
  313. .pattern span {
  314. margin-left: 0.125rem;
  315. }
  316. .pattern [aria-current] {
  317. background-color: #111;
  318. background-image: url(images/arrow_effect.svg);
  319. background-position: right center;
  320. background-size: 125%;
  321. background-repeat: no-repeat;
  322. color: #fff;
  323. padding: 0.5em 1em 0.5em;
  324. }
  325. /* menu button */
  326. #menu-button {
  327. display: none;
  328. width: 100%;
  329. text-align: center;
  330. }
  331. #menu-button:focus {
  332. outline: none;
  333. box-shadow: inset 0 0 0 0.25rem #ccc;
  334. }
  335. /* Tables of contents */
  336. .toc {
  337. font-size: 0.85rem;
  338. border: 1px solid;
  339. padding: 1.5rem;
  340. }
  341. .toc h2 {
  342. font-size: 1rem;
  343. }
  344. .toc ol {
  345. margin-left: 0.75rem;
  346. margin-top: 0.5rem;
  347. }
  348. /* Pattern lists */
  349. .patterns-list {
  350. list-style: none;
  351. margin-left: 0;
  352. }
  353. .patterns-list h2 {
  354. font-size: 1.25rem;
  355. }
  356. .patterns-list li + li {
  357. margin-top: 1rem;
  358. padding-top: 1rem;
  359. border-top: 2px solid;
  360. }
  361. .patterns-list a {
  362. border: 0;
  363. }
  364. /* Tags */
  365. .tags {
  366. margin-top: 0;
  367. font-size: 0.85rem;
  368. }
  369. .tags * {
  370. display: inline;
  371. margin: 0;
  372. }
  373. .tags strong {
  374. margin-right: 0.25rem;
  375. }
  376. .tags li {
  377. white-space: nowrap;
  378. margin: 0 0.25rem 0 0;
  379. }
  380. /* Notes and warnings */
  381. .note {
  382. border-left: 0.5rem solid;
  383. font-size: 0.85rem;
  384. }
  385. .note svg {
  386. height: 2.25rem;
  387. width: auto;
  388. }
  389. .note > div {
  390. margin-left: 0.75rem;
  391. }
  392. .note > div > img:first-child {
  393. height: 1.5rem;
  394. }
  395. .note > div >:first-child + * {
  396. margin-top: 0;
  397. }
  398. .note.warning {
  399. border-left: 0;
  400. background-image: url(images/stripe.svg);
  401. background-size: 0.5rem auto;
  402. background-repeat: repeat-y;
  403. }
  404. .note.warning > div {
  405. margin-left: 1.25rem;
  406. }
  407. /* Tick lists */
  408. .ticks li {
  409. list-style: none;
  410. position: relative;
  411. }
  412. .ticks li::before {
  413. content: '';
  414. display: inline-block;
  415. width: 1rem;
  416. height: 1rem;
  417. margin-right: 0.25rem;
  418. background-image: url(images/icon-tick.svg);
  419. background-size: 100% auto;
  420. position: absolute;
  421. left: -1.25rem;
  422. top: 0.25rem;
  423. }
  424. /* Figures */
  425. figure {
  426. text-align: center;
  427. }
  428. figcaption {
  429. font-size: 0.85rem;
  430. font-style: italic;
  431. margin-top: 0.5rem;
  432. }
  433. main {
  434. display: block;
  435. counter-reset: fig;
  436. min-height: 100vh;
  437. }
  438. figcaption::before {
  439. counter-increment: fig;
  440. content: 'Figure ' counter(fig) ':\0020';
  441. font-weight: bold;
  442. }
  443. /* Code blocks */
  444. pre[class*=language-] {
  445. background: none;
  446. margin-top: 2.25rem;
  447. margin-bottom: 0;
  448. overflow-y: hidden;
  449. overflow-x: auto;
  450. }
  451. pre[class*=language-][data-line] {
  452. padding: 1em 0 0 2.25rem;
  453. }
  454. pre[class*=language-] code * {
  455. margin-top: 0 !important;
  456. }
  457. [data-codeblock-shortcode] {
  458. display: block;
  459. margin-top: -1rem;
  460. }
  461. .token.property,
  462. .token.tag,
  463. .token.boolean,
  464. .token.number,
  465. .token.constant,
  466. .token.symbol,
  467. .token.deleted {
  468. color: #888;
  469. }
  470. .token.selector,
  471. .token.attr-name,
  472. .token.string,
  473. .token.char,
  474. .token.builtin,
  475. .token.inserted {
  476. color: #111;
  477. }
  478. .token.operator,
  479. .token.entity,
  480. .token.url,
  481. .language-css .token.string,
  482. .style .token.string {
  483. color: #333;
  484. background: none;
  485. }
  486. .token.atrule,
  487. .token.attr-value,
  488. .token.keyword {
  489. color: #666;
  490. }
  491. .token.function {
  492. color: #888;
  493. }
  494. .line-numbers code {
  495. padding-left: 3rem;
  496. margin-top: -1rem;
  497. overflow-x: auto;
  498. overflow-y: hidden;
  499. }
  500. .line-numbers {
  501. padding: 1.5rem !important;
  502. }
  503. .line-numbers .line-numbers-rows {
  504. margin-left: 2.25rem;
  505. left: -3.5em;
  506. top: 1.25rem;
  507. color: #111;
  508. border-color: #111;
  509. }
  510. .line-numbers-rows > span:before {
  511. color: inherit;
  512. }
  513. /* file tree lists */
  514. .file-tree {
  515. overflow-x: auto;
  516. }
  517. .file-tree ul {
  518. font-family: Courier, monospace;
  519. margin: 0;
  520. padding: 0;
  521. padding-left: 3rem;
  522. list-style: none;
  523. line-height: 1.25;
  524. position: relative;
  525. }
  526. .file-tree > ul {
  527. padding-left: 0;
  528. overflow-x: auto;
  529. }
  530. .file-tree li {
  531. background: #fff;
  532. position: relative;
  533. white-space: nowrap;
  534. }
  535. .file-tree li + li {
  536. margin-top: 0;
  537. }
  538. .file-tree li:not(:last-child) > ul::before {
  539. content: '\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020\2502\0020';
  540. position: absolute;
  541. left: 0;
  542. top: 0;
  543. bottom: 0;
  544. width: 1em;
  545. white-space: normal;
  546. }
  547. .file-tree li::before {
  548. content: '\251C\2500\2500\0020';
  549. }
  550. .file-tree li:last-child::before {
  551. content: '\2514\2500\2500\0020';
  552. }
  553. /* Expandable sections */
  554. .expandable-section {
  555. border-top: 1px solid;
  556. border-bottom: 1px solid;
  557. padding: 0.75rem 0;
  558. }
  559. [id^="js-expandable-"] {
  560. margin: 0;
  561. padding: 1.5rem 0 0.75rem;
  562. }
  563. @media screen {
  564. .expandable-section + .expandable-section {
  565. margin-top: 0;
  566. border-top: 0;
  567. }
  568. }
  569. [data-expands] {
  570. text-align: left;
  571. color: #111;
  572. border: 0;
  573. background: none;
  574. width: 100%;
  575. padding: 0;
  576. margin: 0;
  577. display: flex;
  578. align-items: center;
  579. justify-content: space-between;
  580. cursor: pointer;
  581. }
  582. [data-expands] svg {
  583. margin-top: 0;
  584. width: 1em;
  585. height: 1em;
  586. }
  587. [data-expands][aria-expanded="true"] svg .up-strut {
  588. display: none;
  589. }
  590. [data-expands]:focus {
  591. outline: none;
  592. }
  593. p:empty {
  594. display: none;
  595. }
  596. *:not(p) + p:empty + p {
  597. margin-top: 2.25rem;
  598. }
  599. /* WCAG and principles */
  600. .wcag ul li {
  601. font-size: 0.85em;
  602. }
  603. .principles p {
  604. font-size: 0.85rem;
  605. margin-top: 0.75rem;
  606. }
  607. .principles.with-desc > li + li,
  608. .wcag.with-desc > li + li {
  609. border-top: 1px solid;
  610. margin-top: 0.75rem;
  611. padding-top: 0.75rem;
  612. }
  613. /* Site errors */
  614. .site-error {
  615. padding: 1.5rem;
  616. background: #efefef;
  617. }
  618. .site-error strong {
  619. color: #C83737;
  620. }
  621. /* SVG icons */
  622. a svg,
  623. button svg,
  624. h1 svg {
  625. height: 0.75em;
  626. width: auto;
  627. margin-right: 0.25em;
  628. }
  629. h1 svg,
  630. li > svg,
  631. h2 a svg {
  632. height: 1em;
  633. vertical-align: middle;
  634. }
  635. h1 svg {
  636. margin-right: 0;
  637. }
  638. .print {
  639. white-space: nowrap;
  640. }
  641. .svg-outer {
  642. width: 0.75em;
  643. display: inline-block;
  644. vertical-align: middle;
  645. }
  646. /* Color palettes */
  647. .colors {
  648. display: flex;
  649. height: 5rem;
  650. margin: -0.25rem;
  651. list-style: none;
  652. flex-wrap: nowrap;
  653. }
  654. .colors li {
  655. margin: 0.25rem;
  656. flex: 1 0 auto;
  657. position: relative;
  658. }
  659. .colors span {
  660. line-height: 1;
  661. background-color: #111;
  662. color: #fff;
  663. font-size: 0.75rem;
  664. padding: 0.25rem;
  665. position: absolute;
  666. bottom: 0.25rem;
  667. right: 0.25rem;
  668. }
  669. /* cross references */
  670. .pattern-link {
  671. font-weight: bold;
  672. }
  673. /* inline demos */
  674. [id^="js-demo-"] {
  675. all: initial;
  676. display: block;
  677. }
  678. /* Section links */
  679. .h2-container {
  680. position: relative;
  681. font-size: 1.66rem;
  682. }
  683. .h2-container a {
  684. position: absolute;
  685. margin-top: 0;
  686. top: 0;
  687. line-height: 1;
  688. left: -1em;
  689. border: 0;
  690. }
  691. /* Single page layout */
  692. .wrapper.print-version .main-and-footer {
  693. margin-left: 0;
  694. }
  695. .wrapper.print-version .intro-and-nav {
  696. position: static;
  697. border: 0;
  698. width: auto;
  699. text-align: center;
  700. display: flex;
  701. align-items: center;
  702. justify-content: center;
  703. }
  704. .wrapper.print-version main {
  705. min-height: 0;
  706. }
  707. .wrapper.print-version .library-desc {
  708. font-size: 1rem;
  709. }
  710. .wrapper.print-version .intro-and-nav > div {
  711. height: auto;
  712. }
  713. .wrapper.print-version #patterns-list {
  714. margin-left: 0;
  715. margin-top: 1.5rem;
  716. display: block;
  717. }
  718. .wrapper.print-version .toc {
  719. font-size: 1rem;
  720. }
  721. .wrapper.print-version .toc h2 {
  722. font-size: 1.66rem;
  723. }
  724. .wrapper.print-version #patterns-list h3 {
  725. font-size: 1.25rem;
  726. }
  727. .pattern-section:not(:last-child) {
  728. padding-bottom: 2.25rem;
  729. border-bottom: 2px solid;
  730. }
  731. .pattern-section h1 {
  732. padding: 0 !important;
  733. }
  734. @media screen and (max-width: 45em) {
  735. [role="banner"] {
  736. position: static;
  737. width: auto;
  738. height: auto;
  739. }
  740. .intro {
  741. text-align: center;
  742. }
  743. .intro-and-nav > div {
  744. padding: 1.5rem;
  745. }
  746. .main-and-footer {
  747. margin: 0;
  748. }
  749. .patterns h3 {
  750. font-size: 1.125rem;
  751. border-top: 4px solid;
  752. border-bottom: 4px solid;
  753. padding: 0.75rem 0;
  754. }
  755. .patterns li:not(.pattern) {
  756. margin-top: 0;
  757. }
  758. .patterns ul ul {
  759. margin: 0;
  760. }
  761. .patterns li {
  762. margin-top: 0;
  763. }
  764. .pattern {
  765. font-size: 1rem;
  766. }
  767. .pattern a {
  768. padding: 0.75rem 0;
  769. }
  770. .pattern [aria-current] {
  771. background-image: none;
  772. }
  773. .pattern + .pattern {
  774. border-top: 1px solid;
  775. margin-top: 0;
  776. }
  777. #menu-button {
  778. display: block;
  779. }
  780. #patterns-list {
  781. display: none;
  782. }
  783. [aria-expanded="true"] + #patterns-list {
  784. display: block;
  785. }
  786. .tested th,
  787. .tested td {
  788. display: block;
  789. }
  790. .tested td + td {
  791. border-top: 0;
  792. }
  793. }
  794. @media print {
  795. .wrapper:not(.print-version) .intro-and-nav,
  796. .wrapper:not(.print-version) [role="contentinfo"] {
  797. display: none;
  798. }
  799. .main-and-footer {
  800. margin-left: 0;
  801. }
  802. a {
  803. border: 0;
  804. }
  805. main a::after {
  806. content: " (" attr(href) ")";
  807. word-break: break-word;
  808. }
  809. main nav a::after {
  810. content: '';
  811. }
  812. .cmd {
  813. background: #fff;
  814. color: #111;
  815. }
  816. pre code {
  817. white-space: pre-wrap !important;
  818. }
  819. .line-numbers .line-numbers-rows {
  820. display: none;
  821. }
  822. .line-numbers code {
  823. padding-left: 0;
  824. }
  825. .expandable-section {
  826. border: 0;
  827. padding: 0;
  828. }
  829. .expandable-section + p {
  830. margin-top: 0.75rem;
  831. }
  832. [id^="js-expandable-"] {
  833. display: block;
  834. }
  835. [data-expands] svg {
  836. display: none;
  837. }
  838. main *:not(.with-desc) {
  839. page-break-inside: avoid;
  840. }
  841. .note.warning {
  842. border-left: 0.5rem solid;
  843. background: none;
  844. }
  845. }