styles.css 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  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 {
  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. padding: 0.125rem 0.25rem;
  341. white-space: nowrap;
  342. }
  343. .token.property,
  344. .token.tag,
  345. .token.boolean,
  346. .token.number,
  347. .token.constant,
  348. .token.symbol,
  349. .token.deleted {
  350. color: #888;
  351. }
  352. .token.selector,
  353. .token.attr-name,
  354. .token.string,
  355. .token.char,
  356. .token.builtin,
  357. .token.inserted {
  358. color: #111;
  359. }
  360. .token.operator,
  361. .token.entity,
  362. .token.url,
  363. .language-css .token.string,
  364. .style .token.string {
  365. color: #333;
  366. background: none;
  367. }
  368. .token.atrule,
  369. .token.attr-value,
  370. .token.keyword {
  371. color: #666;
  372. }
  373. .token.function {
  374. color: #ccc;
  375. }
  376. .line-numbers code {
  377. padding-left: 2.25rem;
  378. margin-top: -1rem;
  379. overflow-x: auto;
  380. overflow-y: hidden;
  381. }
  382. .line-numbers {
  383. padding: 1.5rem !important;
  384. }
  385. .line-numbers .line-numbers-rows {
  386. margin-left: 2.25rem;
  387. top: 1.25rem;
  388. color: #111;
  389. }
  390. .line-numbers-rows > span:before {
  391. color: inherit;
  392. }
  393. /* Expandable sections */
  394. .expandable-section {
  395. border-top: 1px solid;
  396. border-bottom: 1px solid;
  397. padding: 0.75rem 0;
  398. }
  399. [id^="expandable-"] {
  400. margin: 0;
  401. padding: 1.5rem 0 0.75rem;
  402. }
  403. .expandable-section + .expandable-section {
  404. margin-top: 0;
  405. border-top: 0;
  406. }
  407. [data-expands] {
  408. text-align: left;
  409. border: 0;
  410. background: none;
  411. width: 100%;
  412. padding: 0;
  413. margin: 0;
  414. display: flex;
  415. align-items: center;
  416. justify-content: space-between;
  417. cursor: pointer;
  418. }
  419. [data-expands] svg {
  420. margin-top: 0;
  421. width: 1em;
  422. height: 1em;
  423. }
  424. [data-expands][aria-expanded="true"] svg .up-strut {
  425. display: none;
  426. }
  427. [data-expands]:focus {
  428. outline: none;
  429. }
  430. p:empty {
  431. display: none;
  432. }
  433. *:not(p) + p:empty + p {
  434. margin-top: 2.25rem;
  435. }
  436. /* WCAG and principles */
  437. .wcag ul li {
  438. font-size: 0.85em;
  439. }
  440. .principles p {
  441. font-size: 0.85rem;
  442. margin-top: 0.75rem;
  443. }
  444. .principles.with-desc > li + li,
  445. .wcag.with-desc > li + li {
  446. border-top: 1px solid;
  447. margin-top: 0.75rem;
  448. padding-top: 0.75rem;
  449. }
  450. /* Site errors */
  451. .site-error {
  452. padding: 1.5rem;
  453. background: #efefef;
  454. }
  455. .site-error strong {
  456. color: #C83737;
  457. }
  458. /* SVG icons */
  459. a svg {
  460. height: 0.75em;
  461. width: auto;
  462. margin-right: 0.125rem;
  463. }
  464. a .bookmark {
  465. width: 0.75em;
  466. }
  467. a .balloon {
  468. height: 1.125em;
  469. }
  470. /* cross references */
  471. .pattern-link {
  472. font-weight: bold;
  473. }
  474. /* inline demos */
  475. [id^="demo-"] {
  476. all: initial;
  477. }
  478. [id^="demo-"] * {
  479. all: initial;
  480. }
  481. @media (max-width: 45em) {
  482. [role="banner"] {
  483. position: static;
  484. width: auto;
  485. height: auto;
  486. }
  487. .intro {
  488. text-align: center;
  489. }
  490. .intro-and-nav > div {
  491. padding: 1.5rem;
  492. padding-bottom: 0;
  493. }
  494. .logo img {
  495. max-width: 15rem;
  496. }
  497. .main-and-footer {
  498. margin: 0;
  499. }
  500. .patterns h3 {
  501. margin-top: 0.75rem;
  502. }
  503. .patterns li {
  504. margin: 0;
  505. }
  506. .patterns a {
  507. padding: 0.75rem 0;
  508. font-size: 1rem;
  509. }
  510. .patterns a[aria-current] {
  511. background: #111;
  512. color: #fff;
  513. padding: 0.75rem;
  514. }
  515. .patterns a[aria-current] span {
  516. text-decoration: none;
  517. }
  518. .patterns li + li {
  519. border-top: 1px solid;
  520. }
  521. }