styles.css 15 KB

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