styles.css 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  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. overflow-y: hidden;
  513. }
  514. .file-tree li {
  515. background: #fff;
  516. position: relative;
  517. white-space: nowrap;
  518. }
  519. .file-tree li + li {
  520. margin-top: 0;
  521. }
  522. .file-tree li:not(:last-child) > ul::before {
  523. 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';
  524. position: absolute;
  525. left: 0;
  526. top: 0;
  527. bottom: 0;
  528. width: 1em;
  529. white-space: normal;
  530. }
  531. .file-tree li::before {
  532. content: '\251C\2500\2500\0020';
  533. }
  534. .file-tree li:last-child::before {
  535. content: '\2514\2500\2500\0020';
  536. }
  537. /* Expandable sections */
  538. .expandable-section {
  539. border-top: 1px solid;
  540. border-bottom: 1px solid;
  541. padding: 0.75rem 0;
  542. }
  543. [id^="js-expandable-"] {
  544. margin: 0;
  545. padding: 1.5rem 0 0.75rem;
  546. }
  547. @media screen {
  548. .expandable-section + .expandable-section {
  549. margin-top: 0;
  550. border-top: 0;
  551. }
  552. }
  553. [data-expands] {
  554. text-align: left;
  555. color: #111;
  556. border: 0;
  557. background: none;
  558. width: 100%;
  559. padding: 0;
  560. margin: 0;
  561. display: flex;
  562. align-items: center;
  563. justify-content: space-between;
  564. cursor: pointer;
  565. }
  566. [data-expands] svg {
  567. margin-top: 0;
  568. width: 1em;
  569. height: 1em;
  570. }
  571. [data-expands][aria-expanded="true"] svg .up-strut {
  572. display: none;
  573. }
  574. [data-expands]:focus {
  575. outline: none;
  576. }
  577. p:empty {
  578. display: none;
  579. }
  580. *:not(p) + p:empty + p {
  581. margin-top: 2.25rem;
  582. }
  583. /* WCAG and principles */
  584. .wcag ul li {
  585. font-size: 0.85em;
  586. }
  587. .principles p {
  588. font-size: 0.85rem;
  589. margin-top: 0.75rem;
  590. }
  591. .principles.with-desc > li + li,
  592. .wcag.with-desc > li + li {
  593. border-top: 1px solid;
  594. margin-top: 0.75rem;
  595. padding-top: 0.75rem;
  596. }
  597. /* Site errors */
  598. .site-error {
  599. padding: 1.5rem;
  600. background: #efefef;
  601. }
  602. .site-error strong {
  603. color: #C83737;
  604. }
  605. /* SVG icons */
  606. a svg,
  607. button svg,
  608. h1 svg {
  609. height: 0.75em;
  610. width: auto;
  611. margin-right: 0.25em;
  612. }
  613. h1 svg,
  614. li > svg,
  615. h2 a svg {
  616. height: 1em;
  617. vertical-align: middle;
  618. }
  619. h1 svg {
  620. margin-right: 0;
  621. }
  622. .print {
  623. white-space: nowrap;
  624. }
  625. .svg-outer {
  626. width: 0.75em;
  627. display: inline-block;
  628. vertical-align: middle;
  629. }
  630. /* Color palettes */
  631. .colors {
  632. display: flex;
  633. height: 5rem;
  634. margin: -0.25rem;
  635. list-style: none;
  636. flex-wrap: nowrap;
  637. }
  638. .colors li {
  639. margin: 0.25rem;
  640. flex: 1 0 auto;
  641. position: relative;
  642. }
  643. .colors span {
  644. line-height: 1;
  645. background-color: #111;
  646. color: #fff;
  647. font-size: 0.75rem;
  648. padding: 0.25rem;
  649. position: absolute;
  650. bottom: 0.25rem;
  651. right: 0.25rem;
  652. }
  653. /* cross references */
  654. .pattern-link {
  655. font-weight: bold;
  656. }
  657. /* inline demos */
  658. [id^="js-demo-"] {
  659. all: initial;
  660. display: block;
  661. }
  662. /* Section links */
  663. .h2-container {
  664. position: relative;
  665. font-size: 1.66rem;
  666. }
  667. .h2-container a {
  668. position: absolute;
  669. margin-top: 0;
  670. top: 0;
  671. line-height: 1;
  672. left: -1em;
  673. border: 0;
  674. }
  675. /* Single page layout */
  676. .wrapper.print-version .main-and-footer {
  677. margin-left: 0;
  678. }
  679. .wrapper.print-version .intro-and-nav {
  680. position: static;
  681. border: 0;
  682. width: auto;
  683. text-align: center;
  684. display: flex;
  685. align-items: center;
  686. justify-content: center;
  687. }
  688. .wrapper.print-version main {
  689. min-height: 0;
  690. }
  691. .wrapper.print-version .library-desc {
  692. font-size: 1rem;
  693. }
  694. .wrapper.print-version .intro-and-nav > div {
  695. height: auto;
  696. }
  697. .wrapper.print-version #patterns-list {
  698. margin-left: 0;
  699. margin-top: 1.5rem;
  700. display: block;
  701. }
  702. .wrapper.print-version .toc {
  703. font-size: 1rem;
  704. }
  705. .wrapper.print-version .toc h2 {
  706. font-size: 1.66rem;
  707. }
  708. .wrapper.print-version #patterns-list h3 {
  709. font-size: 1.25rem;
  710. }
  711. .wrapper.print-version .patterns {
  712. margin-top: 0;
  713. }
  714. .pattern-section:not(:last-child) {
  715. padding-bottom: 2.25rem;
  716. border-bottom: 2px solid;
  717. }
  718. .pattern-section h1 {
  719. padding: 0 !important;
  720. }
  721. @media screen and (max-width: 45em) {
  722. [role="banner"] {
  723. position: static;
  724. width: auto;
  725. height: auto;
  726. }
  727. .intro {
  728. text-align: center;
  729. }
  730. .intro-and-nav > div {
  731. padding: 1.5rem;
  732. }
  733. .main-and-footer {
  734. margin: 0;
  735. }
  736. .patterns h3 {
  737. font-size: 1.125rem;
  738. border-top: 4px solid;
  739. border-bottom: 4px solid;
  740. padding: 0.75rem 0;
  741. }
  742. .patterns li:not(.pattern) {
  743. margin-top: 0;
  744. }
  745. .patterns ul ul {
  746. margin: 0;
  747. }
  748. .patterns li {
  749. margin-top: 0;
  750. }
  751. .pattern {
  752. font-size: 1rem;
  753. }
  754. .pattern a {
  755. padding: 0.75rem 0;
  756. }
  757. .pattern [aria-current] {
  758. background-image: none;
  759. }
  760. .pattern + .pattern {
  761. border-top: 1px solid;
  762. margin-top: 0;
  763. }
  764. #menu-button {
  765. display: block;
  766. }
  767. #patterns-list {
  768. display: none;
  769. }
  770. .toc-link {
  771. display: none;
  772. }
  773. [aria-expanded="true"] + #patterns-list {
  774. display: block;
  775. }
  776. code {
  777. word-break: break-all;
  778. }
  779. .tested th,
  780. .tested td {
  781. display: block;
  782. }
  783. .tested td + td {
  784. border-top: 0;
  785. }
  786. }
  787. @media print {
  788. .wrapper:not(.print-version) .intro-and-nav,
  789. .wrapper:not(.print-version) [role="contentinfo"] {
  790. display: none;
  791. }
  792. .main-and-footer {
  793. margin-left: 0;
  794. }
  795. a {
  796. border: 0;
  797. }
  798. main a::after {
  799. content: " (" attr(href) ")";
  800. word-break: break-word;
  801. }
  802. main nav a::after {
  803. content: '';
  804. }
  805. .cmd {
  806. background: #fff;
  807. color: #111;
  808. }
  809. pre code {
  810. white-space: pre-wrap !important;
  811. }
  812. .line-numbers .line-numbers-rows {
  813. display: none;
  814. }
  815. .line-numbers code {
  816. padding-left: 0;
  817. }
  818. .expandable-section {
  819. border: 0;
  820. padding: 0;
  821. }
  822. .expandable-section + p {
  823. margin-top: 0.75rem;
  824. }
  825. [id^="js-expandable-"] {
  826. display: block;
  827. }
  828. [data-expands] svg {
  829. display: none;
  830. }
  831. main *:not(.with-desc) {
  832. page-break-inside: avoid;
  833. }
  834. .note.warning {
  835. border-left: 0.5rem solid;
  836. background: none;
  837. }
  838. }