styles.css 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982
  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. .tags strong {
  366. margin-right: 0.25rem;
  367. }
  368. .tags li {
  369. white-space: nowrap;
  370. margin: 0 0.25rem 0 0;
  371. }
  372. /* Notes and warnings */
  373. .note {
  374. border-left: 0.5rem solid;
  375. font-size: 0.85rem;
  376. }
  377. .note svg {
  378. height: 2.25rem;
  379. width: auto;
  380. }
  381. .note > div {
  382. margin-left: 0.75rem;
  383. }
  384. .note > div > img:first-child {
  385. height: 1.5rem;
  386. }
  387. .note > div > :first-child + * {
  388. margin-top: 0;
  389. }
  390. .note.warning {
  391. border-left: 0;
  392. background-image: url(images/stripe.svg);
  393. background-size: 0.5rem auto;
  394. background-repeat: repeat-y;
  395. }
  396. .note.warning > div {
  397. margin-left: 1.25rem;
  398. }
  399. /* Tick lists */
  400. .ticks li {
  401. list-style: none;
  402. position: relative;
  403. }
  404. .ticks li::before {
  405. content: '';
  406. display: inline-block;
  407. width: 1rem;
  408. height: 1rem;
  409. margin-right: 0.25rem;
  410. background-image: url(images/icon-tick.svg);
  411. background-size: 100% auto;
  412. position: absolute;
  413. left: -1.25rem;
  414. top: 0.25rem;
  415. }
  416. /* Figures */
  417. figure {
  418. text-align: center;
  419. }
  420. figcaption {
  421. font-size: 0.85rem;
  422. font-style: italic;
  423. margin-top: 0.5rem;
  424. }
  425. main {
  426. display: block;
  427. counter-reset: fig;
  428. min-height: 100vh;
  429. }
  430. figcaption::before {
  431. counter-increment: fig;
  432. content: 'Figure ' counter(fig) ':\0020';
  433. font-weight: bold;
  434. }
  435. /* Code blocks */
  436. pre[class*=language-] {
  437. background: none;
  438. margin-top: 2.25rem;
  439. margin-bottom: 0;
  440. overflow-y: hidden;
  441. overflow-x: auto;
  442. }
  443. pre[class*=language-][data-line] {
  444. padding: 1em 0 0 2.25rem;
  445. }
  446. pre[class*=language-] code * {
  447. margin-top: 0 !important;
  448. }
  449. [data-codeblock-shortcode] {
  450. display: block;
  451. margin-top: -1rem;
  452. }
  453. *:not(pre) > code {
  454. white-space: nowrap;
  455. }
  456. .token.property,
  457. .token.tag,
  458. .token.boolean,
  459. .token.number,
  460. .token.constant,
  461. .token.symbol,
  462. .token.deleted {
  463. color: #888;
  464. }
  465. .token.selector,
  466. .token.attr-name,
  467. .token.string,
  468. .token.char,
  469. .token.builtin,
  470. .token.inserted {
  471. color: #111;
  472. }
  473. .token.operator,
  474. .token.entity,
  475. .token.url,
  476. .language-css .token.string,
  477. .style .token.string {
  478. color: #333;
  479. background: none;
  480. }
  481. .token.atrule,
  482. .token.attr-value,
  483. .token.keyword {
  484. color: #666;
  485. }
  486. .token.function {
  487. color: #888;
  488. }
  489. .line-numbers code {
  490. padding-left: 3rem;
  491. margin-top: -1rem;
  492. overflow-x: auto;
  493. overflow-y: hidden;
  494. }
  495. .line-numbers {
  496. padding: 1.5rem !important;
  497. }
  498. .line-numbers .line-numbers-rows {
  499. margin-left: 2.25rem;
  500. left: -3.5em;
  501. top: 1.25rem;
  502. color: #111;
  503. border-color: #111;
  504. }
  505. .line-numbers-rows > span:before {
  506. color: inherit;
  507. }
  508. /* file tree lists */
  509. .file-tree ul {
  510. font-family: courier;
  511. margin: 0;
  512. padding-left: 3rem;
  513. list-style: none;
  514. line-height: 1.25;
  515. position: relative;
  516. overflow: hidden;
  517. }
  518. .file-tree li:not(:last-child) > ul::before {
  519. 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';
  520. position: absolute;
  521. left: 0;
  522. top: 0;
  523. bottom: 0;
  524. width: 1em;
  525. }
  526. .file-tree > ul {
  527. margin: 0;
  528. padding: 0;
  529. }
  530. .file-tree li {
  531. background: #fff;
  532. position: relative;
  533. }
  534. .file-tree li + li {
  535. margin-top: 0;
  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^="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, button svg, h1 svg {
  613. height: 0.75em;
  614. width: auto;
  615. margin-right: 0.125em;
  616. }
  617. h1 svg, li > svg, h2 a svg {
  618. height: 1em;
  619. vertical-align: middle;
  620. }
  621. h1 svg {
  622. margin-right: 0;
  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^="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. @media (max-width: 45em) {
  675. [role="banner"] {
  676. position: static;
  677. width: auto;
  678. height: auto;
  679. }
  680. .intro {
  681. text-align: center;
  682. }
  683. .intro-and-nav > div {
  684. padding: 1.5rem;
  685. }
  686. .logo img {
  687. max-width: 15rem;
  688. }
  689. .main-and-footer {
  690. margin: 0;
  691. }
  692. .patterns h3 {
  693. font-size: 1.125rem;
  694. border-top: 4px solid;
  695. border-bottom: 4px solid;
  696. padding: 0.75rem 0;
  697. }
  698. .patterns li:not(.pattern) {
  699. margin-top: 0;
  700. }
  701. .patterns ul ul {
  702. margin: 0;
  703. }
  704. .patterns li {
  705. margin-top: 0;
  706. }
  707. .pattern {
  708. font-size: 1rem;
  709. }
  710. .pattern a {
  711. padding: 0.75rem 0;
  712. }
  713. .pattern [aria-current] {
  714. background-image: none;
  715. }
  716. .pattern + .pattern {
  717. border-top: 1px solid;
  718. margin-top: 0;
  719. }
  720. #menu-button {
  721. display: block;
  722. }
  723. #patterns-list {
  724. display: none;
  725. }
  726. [aria-expanded="true"] + #patterns-list {
  727. display: block;
  728. }
  729. .tested th, .tested td {
  730. display: block;
  731. }
  732. .tested td + td {
  733. border-top: 0;
  734. }
  735. }
  736. @media print {
  737. .intro-and-nav, [role="contentinfo"] {
  738. display: none;
  739. }
  740. .main-and-footer {
  741. margin-left: 0;
  742. }
  743. a {
  744. border: 0;
  745. }
  746. a::after {
  747. content:" (" attr(href) ")";
  748. word-break: break-word;
  749. }
  750. nav a::after, .tags a::after {
  751. content: '';
  752. }
  753. .cmd {
  754. background: #fff;
  755. color: #111;
  756. }
  757. pre code {
  758. white-space: pre-wrap !important;
  759. }
  760. .line-numbers .line-numbers-rows {
  761. display: none;
  762. }
  763. .line-numbers code {
  764. padding-left: 0;
  765. }
  766. .expandable-section {
  767. border: 0;
  768. padding: 0;
  769. }
  770. .expandable-section + p {
  771. margin-top: 0.75rem;
  772. }
  773. [id^="expandable-"] {
  774. display: block;
  775. }
  776. [data-expands] svg {
  777. display: none;
  778. }
  779. main * {
  780. page-break-inside: avoid;
  781. }
  782. }