styles.css 9.7 KB

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