styles.css 7.8 KB

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