styles.css 15 KB

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