styles.css 7.1 KB

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