styles.css 7.9 KB

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