styles.css 14 KB

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