styles.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  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.25rem;
  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: 1rem;
  272. }
  273. .patterns * {
  274. margin-top: 0;
  275. }
  276. .patterns h3 {
  277. font-size: 1rem;
  278. }
  279. .patterns li {
  280. line-height: 1.125;
  281. margin-top: 0.75rem;
  282. list-style: none;
  283. }
  284. .patterns ul ul {
  285. margin-left: 0.75rem;
  286. }
  287. .pattern a {
  288. border: 0;
  289. display: flex;
  290. flex-wrap: nowrap;
  291. align-items: baseline;
  292. font-weight: bold;
  293. }
  294. .pattern a:focus {
  295. outline: none;
  296. }
  297. .pattern a:focus span {
  298. outline:
  299. }
  300. .pattern span {
  301. margin-left: 0.125rem;
  302. }
  303. .pattern [aria-current] span {
  304. text-decoration: underline;
  305. text-decoration-skip: ink;
  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. .tag-icon {
  356. height: 1em;
  357. width: auto;
  358. vertical-align: middle;
  359. }
  360. .tags strong {
  361. margin-right: 0.25rem;
  362. }
  363. .tags li {
  364. white-space: nowrap;
  365. margin: 0 0.25rem 0 0;
  366. }
  367. /* Notes and warnings */
  368. .note {
  369. border-left: 0.5rem solid;
  370. font-size: 0.85rem;
  371. }
  372. .note > div {
  373. margin-left: 0.75rem;
  374. }
  375. .note > div > img:first-child {
  376. height: 1.5rem;
  377. }
  378. .note > div > :first-child + * {
  379. margin-top: 0;
  380. }
  381. .note.warning {
  382. border-left: 0;
  383. background-image: url(images/stripe.svg);
  384. background-size: 0.5rem auto;
  385. background-repeat: repeat-y;
  386. }
  387. .note.warning > div {
  388. margin-left: 1.25rem;
  389. }
  390. /* Tick lists */
  391. .ticks li {
  392. list-style: none;
  393. position: relative;
  394. }
  395. .ticks li::before {
  396. content: '';
  397. display: inline-block;
  398. width: 1rem;
  399. height: 1rem;
  400. margin-right: 0.25rem;
  401. background-image: url(images/icon-tick.svg);
  402. background-size: 100% auto;
  403. position: absolute;
  404. left: -1.25rem;
  405. top: 0.25rem;
  406. }
  407. /* Figures */
  408. figure {
  409. text-align: center;
  410. }
  411. figcaption {
  412. font-size: 0.85rem;
  413. font-style: italic;
  414. margin-top: 0.5rem;
  415. }
  416. main {
  417. display: block;
  418. counter-reset: fig;
  419. min-height: 100vh;
  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. *:not(pre) > code {
  445. white-space: nowrap;
  446. }
  447. .token.property,
  448. .token.tag,
  449. .token.boolean,
  450. .token.number,
  451. .token.constant,
  452. .token.symbol,
  453. .token.deleted {
  454. color: #888;
  455. }
  456. .token.selector,
  457. .token.attr-name,
  458. .token.string,
  459. .token.char,
  460. .token.builtin,
  461. .token.inserted {
  462. color: #111;
  463. }
  464. .token.operator,
  465. .token.entity,
  466. .token.url,
  467. .language-css .token.string,
  468. .style .token.string {
  469. color: #333;
  470. background: none;
  471. }
  472. .token.atrule,
  473. .token.attr-value,
  474. .token.keyword {
  475. color: #666;
  476. }
  477. .token.function {
  478. color: #888;
  479. }
  480. .line-numbers code {
  481. padding-left: 3rem;
  482. margin-top: -1rem;
  483. overflow-x: auto;
  484. overflow-y: hidden;
  485. }
  486. .line-numbers {
  487. padding: 1.5rem !important;
  488. }
  489. .line-numbers .line-numbers-rows {
  490. margin-left: 2.25rem;
  491. left: -3.5em;
  492. top: 1.25rem;
  493. color: #111;
  494. border-color: #111;
  495. }
  496. .line-numbers-rows > span:before {
  497. color: inherit;
  498. }
  499. /* file tree lists */
  500. .file-tree ul {
  501. font-family: courier;
  502. margin: 0;
  503. padding-left: 3rem;
  504. list-style: none;
  505. line-height: 1.25;
  506. position: relative;
  507. overflow: hidden;
  508. }
  509. .file-tree li:not(:last-child) > ul::before {
  510. 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';
  511. position: absolute;
  512. left: 0;
  513. top: 0;
  514. bottom: 0;
  515. width: 1em;
  516. }
  517. .file-tree > ul {
  518. margin: 0;
  519. padding: 0;
  520. }
  521. .file-tree li {
  522. background: #fff;
  523. position: relative;
  524. }
  525. .file-tree li + li {
  526. margin-top: 0;
  527. }
  528. .file-tree li::before {
  529. content: '\251C\2500\2500\0020';
  530. }
  531. .file-tree li:last-child::before {
  532. content: '\2514\2500\2500\0020';
  533. }
  534. /* Expandable sections */
  535. .expandable-section {
  536. border-top: 1px solid;
  537. border-bottom: 1px solid;
  538. padding: 0.75rem 0;
  539. }
  540. [id^="expandable-"] {
  541. margin: 0;
  542. padding: 1.5rem 0 0.75rem;
  543. }
  544. .expandable-section + .expandable-section {
  545. margin-top: 0;
  546. border-top: 0;
  547. }
  548. [data-expands] {
  549. text-align: left;
  550. color: #111;
  551. border: 0;
  552. background: none;
  553. width: 100%;
  554. padding: 0;
  555. margin: 0;
  556. display: flex;
  557. align-items: center;
  558. justify-content: space-between;
  559. cursor: pointer;
  560. }
  561. [data-expands] svg {
  562. margin-top: 0;
  563. width: 1em;
  564. height: 1em;
  565. }
  566. [data-expands][aria-expanded="true"] svg .up-strut {
  567. display: none;
  568. }
  569. [data-expands]:focus {
  570. outline: none;
  571. }
  572. p:empty {
  573. display: none;
  574. }
  575. *:not(p) + p:empty + p {
  576. margin-top: 2.25rem;
  577. }
  578. /* WCAG and principles */
  579. .wcag ul li {
  580. font-size: 0.85em;
  581. }
  582. .principles p {
  583. font-size: 0.85rem;
  584. margin-top: 0.75rem;
  585. }
  586. .principles.with-desc > li + li,
  587. .wcag.with-desc > li + li {
  588. border-top: 1px solid;
  589. margin-top: 0.75rem;
  590. padding-top: 0.75rem;
  591. }
  592. /* Site errors */
  593. .site-error {
  594. padding: 1.5rem;
  595. background: #efefef;
  596. }
  597. .site-error strong {
  598. color: #C83737;
  599. }
  600. /* SVG icons */
  601. a svg, button svg {
  602. height: 0.75em;
  603. width: auto;
  604. margin-right: 0.125rem;
  605. }
  606. h1 svg {
  607. vertical-align: -0.5rem;
  608. }
  609. /* color palettes */
  610. .colors {
  611. display: flex;
  612. height: 5rem;
  613. margin: -0.25rem;
  614. list-style: none;
  615. flex-wrap: nowrap;
  616. }
  617. .colors li {
  618. margin: 0.25rem;
  619. flex: 1 0 auto;
  620. position: relative;
  621. }
  622. .colors span {
  623. line-height: 1;
  624. background-color: #111;
  625. color: #fff;
  626. font-size: 0.75rem;
  627. padding: 0.25rem;
  628. position: absolute;
  629. bottom: 0.25rem;
  630. right: 0.25rem;
  631. }
  632. /* cross references */
  633. .pattern-link {
  634. font-weight: bold;
  635. }
  636. /* inline demos */
  637. [id^="demo-"] {
  638. all: initial;
  639. display: block;
  640. }
  641. @media (max-width: 45em) {
  642. [role="banner"] {
  643. position: static;
  644. width: auto;
  645. height: auto;
  646. }
  647. .intro {
  648. text-align: center;
  649. }
  650. .intro-and-nav > div {
  651. padding: 1.5rem;
  652. }
  653. .logo img {
  654. max-width: 15rem;
  655. }
  656. .main-and-footer {
  657. margin: 0;
  658. }
  659. .patterns h3 {
  660. font-size: 1.125rem;
  661. border-top: 4px solid;
  662. border-bottom: 4px solid;
  663. padding: 0.75rem 0;
  664. }
  665. .patterns ul ul {
  666. margin: 0;
  667. }
  668. .patterns li {
  669. margin-top: 0;
  670. }
  671. .pattern {
  672. font-size: 1rem;
  673. }
  674. .pattern a {
  675. padding: 0.75rem 0;
  676. }
  677. .pattern + .pattern {
  678. border-top: 1px solid;
  679. }
  680. #menu-button {
  681. display: block;
  682. }
  683. #patterns-list {
  684. display: none;
  685. }
  686. [aria-expanded="true"] + #patterns-list {
  687. display: block;
  688. }
  689. .tested th, .tested td {
  690. display: block;
  691. }
  692. .tested td + td {
  693. border-top: 0;
  694. }
  695. }