styles.css 11 KB

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