styles.css 8.6 KB

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