styles.css 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  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. .library-desc {
  249. font-style: italic;
  250. margin-top: 0.5rem;
  251. margin-left: auto;
  252. margin-right: auto;
  253. max-width: 30rem;
  254. }
  255. .main-and-footer {
  256. margin-left: 15rem;
  257. }
  258. .main-and-footer > div {
  259. max-width: 40rem;
  260. margin: 0 auto;
  261. padding: 2.25rem;
  262. }
  263. [role="contentinfo"] {
  264. font-size: 0.85rem;
  265. margin-top: 4rem;
  266. text-align: center;
  267. }
  268. /* Patterns navigation */
  269. .patterns {
  270. overflow: auto;
  271. margin-top: 1.5rem;
  272. }
  273. .patterns * {
  274. margin-top: 0;
  275. }
  276. .patterns h3 {
  277. font-size: 1rem;
  278. }
  279. .patterns h3 + ul {
  280. margin-top: 0.75rem;
  281. }
  282. .patterns li {
  283. line-height: 1.125;
  284. list-style: none;
  285. }
  286. .patterns li + li {
  287. margin-top: 0.75rem;
  288. }
  289. .patterns ul ul {
  290. margin-left: 0.75rem;
  291. }
  292. .pattern a {
  293. border: 0;
  294. display: flex;
  295. flex-wrap: nowrap;
  296. align-items: baseline;
  297. font-weight: bold;
  298. }
  299. .pattern a:focus {
  300. outline: none;
  301. }
  302. .pattern a:focus span {
  303. outline:
  304. }
  305. .pattern span {
  306. margin-left: 0.125rem;
  307. }
  308. .pattern [aria-current] {
  309. background-color: #111;
  310. background-image: url(images/arrow_effect.svg);
  311. background-position: right center;
  312. background-size: 125%;
  313. background-repeat: no-repeat;
  314. color: #fff;
  315. padding: 0.5em 1em 0.5em;
  316. }
  317. /* menu button */
  318. #menu-button {
  319. display: none;
  320. width: 100%;
  321. text-align: center;
  322. }
  323. #menu-button:focus {
  324. outline: none;
  325. box-shadow: inset 0 0 0 0.25rem #ccc;
  326. }
  327. /* Tables of contents */
  328. .toc {
  329. font-size: 0.85rem;
  330. border: 1px solid;
  331. padding: 1.5rem;
  332. }
  333. .toc h2 {
  334. font-size: 1rem;
  335. }
  336. .toc ol {
  337. margin-left: 0.75rem;
  338. margin-top: 0.5rem;
  339. }
  340. /* Pattern lists */
  341. .patterns-list {
  342. list-style: none;
  343. margin-left: 0;
  344. }
  345. .patterns-list h2 {
  346. font-size: 1.25rem;
  347. }
  348. .patterns-list li + li {
  349. margin-top: 1rem;
  350. padding-top: 1rem;
  351. border-top: 2px solid;
  352. }
  353. .patterns-list a {
  354. border: 0;
  355. }
  356. /* Tags */
  357. .tags {
  358. margin-top: 0;
  359. font-size: 0.85rem;
  360. }
  361. .tags * {
  362. display: inline;
  363. margin: 0;
  364. }
  365. .tag-icon {
  366. height: 1em;
  367. width: auto;
  368. vertical-align: middle;
  369. }
  370. .tags strong {
  371. margin-right: 0.25rem;
  372. }
  373. .tags li {
  374. white-space: nowrap;
  375. margin: 0 0.25rem 0 0;
  376. }
  377. /* Notes and warnings */
  378. .note {
  379. border-left: 0.5rem solid;
  380. font-size: 0.85rem;
  381. }
  382. .note svg {
  383. height: 2.25rem;
  384. width: auto;
  385. }
  386. .note > div {
  387. margin-left: 0.75rem;
  388. }
  389. .note > div > img:first-child {
  390. height: 1.5rem;
  391. }
  392. .note > div > :first-child + * {
  393. margin-top: 0;
  394. }
  395. .note.warning {
  396. border-left: 0;
  397. background-image: url(images/stripe.svg);
  398. background-size: 0.5rem auto;
  399. background-repeat: repeat-y;
  400. }
  401. .note.warning > div {
  402. margin-left: 1.25rem;
  403. }
  404. /* Tick lists */
  405. .ticks li {
  406. list-style: none;
  407. position: relative;
  408. }
  409. .ticks li::before {
  410. content: '';
  411. display: inline-block;
  412. width: 1rem;
  413. height: 1rem;
  414. margin-right: 0.25rem;
  415. background-image: url(images/icon-tick.svg);
  416. background-size: 100% auto;
  417. position: absolute;
  418. left: -1.25rem;
  419. top: 0.25rem;
  420. }
  421. /* Figures */
  422. figure {
  423. text-align: center;
  424. }
  425. figcaption {
  426. font-size: 0.85rem;
  427. font-style: italic;
  428. margin-top: 0.5rem;
  429. }
  430. main {
  431. display: block;
  432. counter-reset: fig;
  433. min-height: 100vh;
  434. }
  435. figcaption::before {
  436. counter-increment: fig;
  437. content: 'Figure ' counter(fig) ':\0020';
  438. font-weight: bold;
  439. }
  440. /* Code blocks */
  441. pre[class*=language-] {
  442. background: none;
  443. margin-top: 2.25rem;
  444. margin-bottom: 0;
  445. overflow-y: hidden;
  446. overflow-x: auto;
  447. }
  448. pre[class*=language-][data-line] {
  449. padding: 1em 0 0 2.25rem;
  450. }
  451. pre[class*=language-] code * {
  452. margin-top: 0 !important;
  453. }
  454. [data-codeblock-shortcode] {
  455. display: block;
  456. margin-top: -1rem;
  457. }
  458. *:not(pre) > code {
  459. white-space: nowrap;
  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 ul {
  515. font-family: courier;
  516. margin: 0;
  517. padding-left: 3rem;
  518. list-style: none;
  519. line-height: 1.25;
  520. position: relative;
  521. overflow: hidden;
  522. }
  523. .file-tree li:not(:last-child) > ul::before {
  524. 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';
  525. position: absolute;
  526. left: 0;
  527. top: 0;
  528. bottom: 0;
  529. width: 1em;
  530. }
  531. .file-tree > ul {
  532. margin: 0;
  533. padding: 0;
  534. }
  535. .file-tree li {
  536. background: #fff;
  537. position: relative;
  538. }
  539. .file-tree li + li {
  540. margin-top: 0;
  541. }
  542. .file-tree li::before {
  543. content: '\251C\2500\2500\0020';
  544. }
  545. .file-tree li:last-child::before {
  546. content: '\2514\2500\2500\0020';
  547. }
  548. /* Expandable sections */
  549. .expandable-section {
  550. border-top: 1px solid;
  551. border-bottom: 1px solid;
  552. padding: 0.75rem 0;
  553. }
  554. [id^="expandable-"] {
  555. margin: 0;
  556. padding: 1.5rem 0 0.75rem;
  557. }
  558. @media screen {
  559. .expandable-section + .expandable-section {
  560. margin-top: 0;
  561. border-top: 0;
  562. }
  563. }
  564. [data-expands] {
  565. text-align: left;
  566. color: #111;
  567. border: 0;
  568. background: none;
  569. width: 100%;
  570. padding: 0;
  571. margin: 0;
  572. display: flex;
  573. align-items: center;
  574. justify-content: space-between;
  575. cursor: pointer;
  576. }
  577. [data-expands] svg {
  578. margin-top: 0;
  579. width: 1em;
  580. height: 1em;
  581. }
  582. [data-expands][aria-expanded="true"] svg .up-strut {
  583. display: none;
  584. }
  585. [data-expands]:focus {
  586. outline: none;
  587. }
  588. p:empty {
  589. display: none;
  590. }
  591. *:not(p) + p:empty + p {
  592. margin-top: 2.25rem;
  593. }
  594. /* WCAG and principles */
  595. .wcag ul li {
  596. font-size: 0.85em;
  597. }
  598. .principles p {
  599. font-size: 0.85rem;
  600. margin-top: 0.75rem;
  601. }
  602. .principles.with-desc > li + li,
  603. .wcag.with-desc > li + li {
  604. border-top: 1px solid;
  605. margin-top: 0.75rem;
  606. padding-top: 0.75rem;
  607. }
  608. /* Site errors */
  609. .site-error {
  610. padding: 1.5rem;
  611. background: #efefef;
  612. }
  613. .site-error strong {
  614. color: #C83737;
  615. }
  616. /* SVG icons */
  617. a svg, button svg {
  618. height: 0.75em;
  619. width: auto;
  620. margin-right: 0.25em;
  621. }
  622. h1 svg {
  623. vertical-align: -0.5rem;
  624. }
  625. /* color palettes */
  626. .colors {
  627. display: flex;
  628. height: 5rem;
  629. margin: -0.25rem;
  630. list-style: none;
  631. flex-wrap: nowrap;
  632. }
  633. .colors li {
  634. margin: 0.25rem;
  635. flex: 1 0 auto;
  636. position: relative;
  637. }
  638. .colors span {
  639. line-height: 1;
  640. background-color: #111;
  641. color: #fff;
  642. font-size: 0.75rem;
  643. padding: 0.25rem;
  644. position: absolute;
  645. bottom: 0.25rem;
  646. right: 0.25rem;
  647. }
  648. /* cross references */
  649. .pattern-link {
  650. font-weight: bold;
  651. }
  652. /* inline demos */
  653. [id^="demo-"] {
  654. all: initial;
  655. display: block;
  656. }
  657. /* Section links */
  658. .h2-container {
  659. position: relative;
  660. font-size: 1.66rem;
  661. }
  662. .h2-container a {
  663. position: absolute;
  664. margin-top: 0;
  665. top: 0;
  666. line-height: 1;
  667. left: -1em;
  668. border: 0;
  669. }
  670. @media (max-width: 45em) {
  671. [role="banner"] {
  672. position: static;
  673. width: auto;
  674. height: auto;
  675. }
  676. .intro {
  677. text-align: center;
  678. }
  679. .intro-and-nav > div {
  680. padding: 1.5rem;
  681. }
  682. .logo img {
  683. max-width: 15rem;
  684. }
  685. .main-and-footer {
  686. margin: 0;
  687. }
  688. .patterns h3 {
  689. font-size: 1.125rem;
  690. border-top: 4px solid;
  691. border-bottom: 4px solid;
  692. padding: 0.75rem 0;
  693. }
  694. .patterns li:not(.pattern) {
  695. margin-top: 0;
  696. }
  697. .patterns ul ul {
  698. margin: 0;
  699. }
  700. .patterns li {
  701. margin-top: 0;
  702. }
  703. .pattern {
  704. font-size: 1rem;
  705. }
  706. .pattern a {
  707. padding: 0.75rem 0;
  708. }
  709. .pattern [aria-current] {
  710. background-image: none;
  711. }
  712. .pattern + .pattern {
  713. border-top: 1px solid;
  714. margin-top: 0;
  715. }
  716. #menu-button {
  717. display: block;
  718. }
  719. #patterns-list {
  720. display: none;
  721. }
  722. [aria-expanded="true"] + #patterns-list {
  723. display: block;
  724. }
  725. .tested th, .tested td {
  726. display: block;
  727. }
  728. .tested td + td {
  729. border-top: 0;
  730. }
  731. }
  732. @media print {
  733. .intro-and-nav, [role="contentinfo"] {
  734. display: none;
  735. }
  736. .main-and-footer {
  737. margin-left: 0;
  738. }
  739. a {
  740. border: 0;
  741. }
  742. a::after {
  743. content:" (" attr(href) ")";
  744. word-break: break-word;
  745. }
  746. nav a::after, .tags a::after {
  747. content: '';
  748. }
  749. .cmd {
  750. background: #fff;
  751. color: #111;
  752. }
  753. pre code {
  754. white-space: pre-wrap !important;
  755. }
  756. .line-numbers .line-numbers-rows {
  757. display: none;
  758. }
  759. .line-numbers code {
  760. padding-left: 0;
  761. }
  762. .expandable-section {
  763. border: 0;
  764. padding: 0;
  765. }
  766. .expandable-section + p {
  767. margin-top: 0.75rem;
  768. }
  769. [id^="expandable-"] {
  770. display: block;
  771. }
  772. [data-expands] svg {
  773. display: none;
  774. }
  775. main * {
  776. page-break-inside: avoid;
  777. }
  778. }