styles.css 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  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 {
  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. .cmd code::after {
  159. content: '';
  160. display: inline-block;
  161. width: 0.75em;
  162. height: 1.25em;
  163. background: #fff;
  164. margin-left: 0.25em;
  165. vertical-align: -0.125rem;
  166. }
  167. /* Lists */
  168. main ul, main ol {
  169. margin-left: 2.25rem;
  170. }
  171. main li + li {
  172. margin-top: 0.5rem;
  173. }
  174. main ul ul {
  175. margin-top: 0;
  176. }
  177. /* Buttons */
  178. button {
  179. font-size: 1.25rem;
  180. font-family: inherit;
  181. font-weight: inherit;
  182. background: #111;
  183. color: #fff;
  184. padding: 0.75rem;
  185. border: 0;
  186. }
  187. /* Tables */
  188. table {
  189. text-align: left;
  190. table-layout: fixed;
  191. width: 100%;
  192. border-collapse: collapse;
  193. }
  194. th, td {
  195. border: 2px solid;
  196. padding: 0.5rem;
  197. line-height: 1.25;
  198. margin: 0;
  199. }
  200. th {
  201. font-weight: bold;
  202. }
  203. th:empty {
  204. border: 0;
  205. }
  206. /* Tested using... table */
  207. .tested {
  208. text-align: center;
  209. }
  210. .tested td {
  211. vertical-align: top;
  212. }
  213. .tested th {
  214. background-color: #111;
  215. border-color: #111;
  216. color: #fff;
  217. }
  218. .tested img {
  219. max-width: 3rem;
  220. }
  221. .tested span {
  222. display: block;
  223. margin: 0;
  224. }
  225. .tested .additional {
  226. font-size: 0.85rem;
  227. }
  228. caption {
  229. font-size: 1.125rem;
  230. padding-bottom: 0.25rem;
  231. font-style: italic;
  232. }
  233. /* Page structure */
  234. .wrapper {
  235. position: relative;
  236. margin-top: 0;
  237. }
  238. .intro-and-nav {
  239. font-size: 0.85rem;
  240. width: 15rem;
  241. height: 100vh;
  242. position: fixed;
  243. top: 0;
  244. left: 0;
  245. border-right: 2px solid;
  246. }
  247. .intro-and-nav > div {
  248. padding: 2.25rem;
  249. display: flex;
  250. flex-direction: column;
  251. height: 100%;
  252. }
  253. .logo {
  254. border: 0;
  255. }
  256. .library-desc {
  257. font-style: italic;
  258. margin-top: 0.25rem;
  259. margin-left: auto;
  260. margin-right: auto;
  261. max-width: 30rem;
  262. }
  263. .main-and-footer {
  264. margin-left: 15rem;
  265. }
  266. .main-and-footer > div {
  267. max-width: 40rem;
  268. margin: 0 auto;
  269. padding: 2.25rem;
  270. }
  271. [role="contentinfo"] {
  272. font-size: 0.85rem;
  273. margin-top: 4rem;
  274. text-align: center;
  275. }
  276. /* Patterns navigation */
  277. .patterns {
  278. overflow: auto;
  279. margin-top: 1rem;
  280. }
  281. .patterns * {
  282. margin-top: 0;
  283. }
  284. .patterns h3 {
  285. font-size: 1rem;
  286. }
  287. .patterns li {
  288. line-height: 1.125;
  289. margin-top: 0.75rem;
  290. list-style: none;
  291. }
  292. .patterns ul ul {
  293. margin-left: 0.75rem;
  294. }
  295. .pattern a {
  296. border: 0;
  297. display: flex;
  298. flex-wrap: nowrap;
  299. align-items: baseline;
  300. font-weight: bold;
  301. }
  302. .pattern a:focus {
  303. outline: none;
  304. }
  305. .pattern a:focus span {
  306. outline:
  307. }
  308. .pattern span {
  309. margin-left: 0.125rem;
  310. }
  311. .pattern [aria-current] span {
  312. text-decoration: underline;
  313. text-decoration-skip: ink;
  314. }
  315. /* menu button */
  316. #menu-button {
  317. display: none;
  318. width: 100%;
  319. text-align: center;
  320. }
  321. #menu-button:focus {
  322. outline: none;
  323. box-shadow: inset 0 0 0 0.25rem #ccc;
  324. }
  325. /* Tables of contents */
  326. .toc {
  327. font-size: 0.85rem;
  328. border: 1px solid;
  329. padding: 1.5rem;
  330. }
  331. .toc h2 {
  332. font-size: 1rem;
  333. }
  334. .toc ol {
  335. margin-left: 0.75rem;
  336. margin-top: 0.5rem;
  337. }
  338. /* Pattern lists */
  339. .patterns-list {
  340. list-style: none;
  341. margin-left: 0;
  342. }
  343. .patterns-list h2 {
  344. font-size: 1.25rem;
  345. }
  346. .patterns-list li + li {
  347. margin-top: 1rem;
  348. padding-top: 1rem;
  349. border-top: 2px solid;
  350. }
  351. .patterns-list a {
  352. border: 0;
  353. }
  354. /* Tags */
  355. .tags {
  356. margin-top: 0;
  357. font-size: 0.85rem;
  358. }
  359. .tags * {
  360. display: inline;
  361. margin: 0;
  362. }
  363. .tag-icon {
  364. height: 1em;
  365. width: auto;
  366. vertical-align: middle;
  367. }
  368. .tags strong {
  369. margin-right: 0.25rem;
  370. }
  371. .tags li {
  372. white-space: nowrap;
  373. margin: 0 0.25rem 0 0;
  374. }
  375. /* Notes and warnings */
  376. .note {
  377. border-left: 0.5rem solid;
  378. font-size: 0.85rem;
  379. }
  380. .note > div {
  381. margin-left: 0.75rem;
  382. }
  383. .note > div > img:first-child {
  384. height: 1.5rem;
  385. }
  386. .note > div > :first-child + * {
  387. margin-top: 0;
  388. }
  389. .note.warning {
  390. border-left: 0;
  391. background-image: url(images/stripe.svg);
  392. background-size: 0.5rem auto;
  393. background-repeat: repeat-y;
  394. }
  395. .note.warning > div {
  396. margin-left: 1.25rem;
  397. }
  398. /* Tick lists */
  399. .ticks li {
  400. list-style: none;
  401. position: relative;
  402. }
  403. .ticks li::before {
  404. content: '';
  405. display: inline-block;
  406. width: 1rem;
  407. height: 1rem;
  408. margin-right: 0.25rem;
  409. background-image: url(images/icon-tick.svg);
  410. background-size: 100% auto;
  411. position: absolute;
  412. left: -1.25rem;
  413. top: 0.25rem;
  414. }
  415. /* Figures */
  416. figure {
  417. text-align: center;
  418. }
  419. figcaption {
  420. font-size: 0.85rem;
  421. font-style: italic;
  422. margin-top: 0.5rem;
  423. }
  424. main {
  425. display: block;
  426. counter-reset: fig;
  427. min-height: 100vh;
  428. }
  429. figcaption::before {
  430. counter-increment: fig;
  431. content: 'Figure ' counter(fig) ':\0020';
  432. font-weight: bold;
  433. }
  434. /* Code blocks */
  435. pre[class*=language-] {
  436. background: none;
  437. margin-top: 2.25rem;
  438. margin-bottom: 0;
  439. overflow-y: hidden;
  440. overflow-x: auto;
  441. }
  442. pre[class*=language-][data-line] {
  443. padding: 1em 0 0 2.25rem;
  444. }
  445. pre[class*=language-] code * {
  446. margin-top: 0 !important;
  447. }
  448. [data-codeblock-shortcode] {
  449. display: block;
  450. margin-top: -1rem;
  451. }
  452. *:not(pre) > code {
  453. white-space: nowrap;
  454. }
  455. .token.property,
  456. .token.tag,
  457. .token.boolean,
  458. .token.number,
  459. .token.constant,
  460. .token.symbol,
  461. .token.deleted {
  462. color: #888;
  463. }
  464. .token.selector,
  465. .token.attr-name,
  466. .token.string,
  467. .token.char,
  468. .token.builtin,
  469. .token.inserted {
  470. color: #111;
  471. }
  472. .token.operator,
  473. .token.entity,
  474. .token.url,
  475. .language-css .token.string,
  476. .style .token.string {
  477. color: #333;
  478. background: none;
  479. }
  480. .token.atrule,
  481. .token.attr-value,
  482. .token.keyword {
  483. color: #666;
  484. }
  485. .token.function {
  486. color: #888;
  487. }
  488. .line-numbers code {
  489. padding-left: 3rem;
  490. margin-top: -1rem;
  491. overflow-x: auto;
  492. overflow-y: hidden;
  493. }
  494. .line-numbers {
  495. padding: 1.5rem !important;
  496. }
  497. .line-numbers .line-numbers-rows {
  498. margin-left: 2.25rem;
  499. left: -3.5em;
  500. top: 1.25rem;
  501. color: #111;
  502. border-color: #111;
  503. }
  504. .line-numbers-rows > span:before {
  505. color: inherit;
  506. }
  507. /* Expandable sections */
  508. .expandable-section {
  509. border-top: 1px solid;
  510. border-bottom: 1px solid;
  511. padding: 0.75rem 0;
  512. }
  513. [id^="expandable-"] {
  514. margin: 0;
  515. padding: 1.5rem 0 0.75rem;
  516. }
  517. .expandable-section + .expandable-section {
  518. margin-top: 0;
  519. border-top: 0;
  520. }
  521. [data-expands] {
  522. text-align: left;
  523. color: #111;
  524. border: 0;
  525. background: none;
  526. width: 100%;
  527. padding: 0;
  528. margin: 0;
  529. display: flex;
  530. align-items: center;
  531. justify-content: space-between;
  532. cursor: pointer;
  533. }
  534. [data-expands] svg {
  535. margin-top: 0;
  536. width: 1em;
  537. height: 1em;
  538. }
  539. [data-expands][aria-expanded="true"] svg .up-strut {
  540. display: none;
  541. }
  542. [data-expands]:focus {
  543. outline: none;
  544. }
  545. p:empty {
  546. display: none;
  547. }
  548. *:not(p) + p:empty + p {
  549. margin-top: 2.25rem;
  550. }
  551. /* WCAG and principles */
  552. .wcag ul li {
  553. font-size: 0.85em;
  554. }
  555. .principles p {
  556. font-size: 0.85rem;
  557. margin-top: 0.75rem;
  558. }
  559. .principles.with-desc > li + li,
  560. .wcag.with-desc > li + li {
  561. border-top: 1px solid;
  562. margin-top: 0.75rem;
  563. padding-top: 0.75rem;
  564. }
  565. /* Site errors */
  566. .site-error {
  567. padding: 1.5rem;
  568. background: #efefef;
  569. }
  570. .site-error strong {
  571. color: #C83737;
  572. }
  573. /* SVG icons */
  574. a svg, button svg {
  575. height: 0.75em;
  576. width: auto;
  577. margin-right: 0.125rem;
  578. }
  579. h1 svg {
  580. vertical-align: -0.5rem;
  581. }
  582. /* color palettes */
  583. .colors {
  584. display: flex;
  585. height: 5rem;
  586. margin: -0.25rem;
  587. list-style: none;
  588. flex-wrap: nowrap;
  589. }
  590. .colors li {
  591. margin: 0.25rem;
  592. flex: 1 0 auto;
  593. position: relative;
  594. }
  595. .colors span {
  596. line-height: 1;
  597. background-color: #111;
  598. color: #fff;
  599. font-size: 0.75rem;
  600. padding: 0.25rem;
  601. position: absolute;
  602. bottom: 0.25rem;
  603. right: 0.25rem;
  604. }
  605. /* cross references */
  606. .pattern-link {
  607. font-weight: bold;
  608. }
  609. /* inline demos */
  610. [id^="demo-"] {
  611. all: initial;
  612. display: block;
  613. }
  614. @media (max-width: 45em) {
  615. [role="banner"] {
  616. position: static;
  617. width: auto;
  618. height: auto;
  619. }
  620. .intro {
  621. text-align: center;
  622. }
  623. .intro-and-nav > div {
  624. padding: 1.5rem;
  625. }
  626. .logo img {
  627. max-width: 15rem;
  628. }
  629. .main-and-footer {
  630. margin: 0;
  631. }
  632. .patterns h3 {
  633. font-size: 1.125rem;
  634. border-top: 4px solid;
  635. border-bottom: 4px solid;
  636. padding: 0.75rem 0;
  637. }
  638. .patterns ul ul {
  639. margin: 0;
  640. }
  641. .patterns li {
  642. margin-top: 0;
  643. }
  644. .pattern {
  645. font-size: 1rem;
  646. }
  647. .pattern a {
  648. padding: 0.75rem 0;
  649. }
  650. .pattern + .pattern {
  651. border-top: 1px solid;
  652. }
  653. #menu-button {
  654. display: block;
  655. }
  656. #patterns-list {
  657. display: none;
  658. }
  659. [aria-expanded="true"] + #patterns-list {
  660. display: block;
  661. }
  662. }