styles.css 7.8 KB

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