styles.css 9.3 KB

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