styles.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  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] span {
  309. text-decoration: underline;
  310. text-decoration-skip: ink;
  311. }
  312. /* menu button */
  313. #menu-button {
  314. display: none;
  315. width: 100%;
  316. text-align: center;
  317. }
  318. #menu-button:focus {
  319. outline: none;
  320. box-shadow: inset 0 0 0 0.25rem #ccc;
  321. }
  322. /* Tables of contents */
  323. .toc {
  324. font-size: 0.85rem;
  325. border: 1px solid;
  326. padding: 1.5rem;
  327. }
  328. .toc h2 {
  329. font-size: 1rem;
  330. }
  331. .toc ol {
  332. margin-left: 0.75rem;
  333. margin-top: 0.5rem;
  334. }
  335. /* Pattern lists */
  336. .patterns-list {
  337. list-style: none;
  338. margin-left: 0;
  339. }
  340. .patterns-list h2 {
  341. font-size: 1.25rem;
  342. }
  343. .patterns-list li + li {
  344. margin-top: 1rem;
  345. padding-top: 1rem;
  346. border-top: 2px solid;
  347. }
  348. .patterns-list a {
  349. border: 0;
  350. }
  351. /* Tags */
  352. .tags {
  353. margin-top: 0;
  354. font-size: 0.85rem;
  355. }
  356. .tags * {
  357. display: inline;
  358. margin: 0;
  359. }
  360. .tag-icon {
  361. height: 1em;
  362. width: auto;
  363. vertical-align: middle;
  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. .expandable-section + .expandable-section {
  554. margin-top: 0;
  555. border-top: 0;
  556. }
  557. [data-expands] {
  558. text-align: left;
  559. color: #111;
  560. border: 0;
  561. background: none;
  562. width: 100%;
  563. padding: 0;
  564. margin: 0;
  565. display: flex;
  566. align-items: center;
  567. justify-content: space-between;
  568. cursor: pointer;
  569. }
  570. [data-expands] svg {
  571. margin-top: 0;
  572. width: 1em;
  573. height: 1em;
  574. }
  575. [data-expands][aria-expanded="true"] svg .up-strut {
  576. display: none;
  577. }
  578. [data-expands]:focus {
  579. outline: none;
  580. }
  581. p:empty {
  582. display: none;
  583. }
  584. *:not(p) + p:empty + p {
  585. margin-top: 2.25rem;
  586. }
  587. /* WCAG and principles */
  588. .wcag ul li {
  589. font-size: 0.85em;
  590. }
  591. .principles p {
  592. font-size: 0.85rem;
  593. margin-top: 0.75rem;
  594. }
  595. .principles.with-desc > li + li,
  596. .wcag.with-desc > li + li {
  597. border-top: 1px solid;
  598. margin-top: 0.75rem;
  599. padding-top: 0.75rem;
  600. }
  601. /* Site errors */
  602. .site-error {
  603. padding: 1.5rem;
  604. background: #efefef;
  605. }
  606. .site-error strong {
  607. color: #C83737;
  608. }
  609. /* SVG icons */
  610. a svg, button svg {
  611. height: 0.75em;
  612. width: auto;
  613. margin-right: 0.25em;
  614. }
  615. h1 svg {
  616. vertical-align: -0.5rem;
  617. }
  618. /* color palettes */
  619. .colors {
  620. display: flex;
  621. height: 5rem;
  622. margin: -0.25rem;
  623. list-style: none;
  624. flex-wrap: nowrap;
  625. }
  626. .colors li {
  627. margin: 0.25rem;
  628. flex: 1 0 auto;
  629. position: relative;
  630. }
  631. .colors span {
  632. line-height: 1;
  633. background-color: #111;
  634. color: #fff;
  635. font-size: 0.75rem;
  636. padding: 0.25rem;
  637. position: absolute;
  638. bottom: 0.25rem;
  639. right: 0.25rem;
  640. }
  641. /* cross references */
  642. .pattern-link {
  643. font-weight: bold;
  644. }
  645. /* inline demos */
  646. [id^="demo-"] {
  647. all: initial;
  648. display: block;
  649. }
  650. @media (max-width: 45em) {
  651. [role="banner"] {
  652. position: static;
  653. width: auto;
  654. height: auto;
  655. }
  656. .intro {
  657. text-align: center;
  658. }
  659. .intro-and-nav > div {
  660. padding: 1.5rem;
  661. }
  662. .logo img {
  663. max-width: 15rem;
  664. }
  665. .main-and-footer {
  666. margin: 0;
  667. }
  668. .patterns h3 {
  669. font-size: 1.125rem;
  670. border-top: 4px solid;
  671. border-bottom: 4px solid;
  672. padding: 0.75rem 0;
  673. }
  674. .patterns li:not(.pattern) {
  675. margin-top: 0;
  676. }
  677. .patterns ul ul {
  678. margin: 0;
  679. }
  680. .patterns li {
  681. margin-top: 0;
  682. }
  683. .pattern {
  684. font-size: 1rem;
  685. }
  686. .pattern a {
  687. padding: 0.75rem 0;
  688. }
  689. .pattern + .pattern {
  690. border-top: 1px solid;
  691. margin-top: 0;
  692. }
  693. #menu-button {
  694. display: block;
  695. }
  696. #patterns-list {
  697. display: none;
  698. }
  699. [aria-expanded="true"] + #patterns-list {
  700. display: block;
  701. }
  702. .tested th, .tested td {
  703. display: block;
  704. }
  705. .tested td + td {
  706. border-top: 0;
  707. }
  708. }