_base.scss 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. /* ------------------------------------------------- */
  2. /* ----- Basic Setup ----- */
  3. /* ------------------------------------------------- */
  4. $rem-scale: 0.585;
  5. @function rem($rem) {
  6. @return $rem-scale * $rem * 1rem;
  7. }
  8. :root {
  9. --nav-height: #{rem(6.5)}; // Changes to height requires changes to partials/toc.html since custom scroll logic implementation
  10. --h1: #{rem(4.2)};
  11. --h2: #{rem(2.6)};
  12. --h3: #{rem(2.2)};
  13. --h4: #{rem(1.8)};
  14. --h5: #{rem(1.6)};
  15. --base: #{rem(1.6)};
  16. --sm: #{rem(1.4)};
  17. --xsm: #{rem(1.2)};
  18. @media(max-width: 850px) {
  19. --h1: #{rem(3.4)};
  20. --h2: #{rem(2.6)};
  21. --h3: #{rem(2.2)};
  22. --h4: #{rem(1.8)};
  23. --h5: #{rem(1.6)};
  24. }
  25. --pico: #{rem(0.5)};
  26. --nano: #{rem(1)};
  27. --micro: #{rem(1.5)};
  28. --milli: #{rem(2)};
  29. --xx-small: #{rem(2.5)};
  30. --x-small: #{rem(3)};
  31. --small: #{rem(4)};
  32. --medium: #{rem(5)};
  33. --large: #{rem(6)};
  34. --orchid: #e537c0;
  35. --orange: #ee8660;
  36. --lavender: #ad37e5;
  37. --brand: #7f4eff;
  38. --purple-dark: #472f85;
  39. --white: #fff;
  40. --white-light: #fefefe;
  41. --code-block-light: #f9f7fd;
  42. --nav-light: #fff;
  43. --nav-dark: #111111d9;
  44. --black: #111111;
  45. --black-mid: #141414;
  46. --black-light: #181818;
  47. --black-lighter: #222222;
  48. --black-lightest: #343434;
  49. --gray-dark: #555555;
  50. --gray-mid: #888888;
  51. --gray: #bbb;
  52. --gray-light: #dddddd;
  53. --gray-lighter: #dddd;
  54. --gray-lightest: #eeeeee;
  55. --shadow-default: 0 #{rem(0.625)} #{rem(1.5)} #{rem(0)} rgba(0, 0, 0, 0.08);
  56. }
  57. body.dark {
  58. --bg: var(--black-mid);
  59. --bg-nav: var(--nav-dark);
  60. --bg-sub: var(--black-light);
  61. --card: var(--black-mid);
  62. --card-light: var(--black-light);
  63. --color-scheme: dark;
  64. --divider: var(--black-lighter);
  65. --divider-light: var(--black-lightest);
  66. --link: var(--brand);
  67. --code-block: var(--card-light);
  68. --code-simple: #c2c2c2;
  69. --code-simple-bg: #292929;
  70. --code-red: #fc6e6c;
  71. --code-pink: #f97fe6;
  72. --code-blue: #4b73f8;
  73. --code-green: #2e731c;
  74. --important: var(--gray-lightest);
  75. --sub: var(--gray-light);
  76. --body: var(--gray);
  77. --highlight: #e0a5fb;
  78. --shadow-default: 0 #{rem(0.625)} #{rem(1.5)} 0 rgba(0, 0, 0, 0.4);
  79. --note: #fffad411;
  80. --note-border: #b9a61545;
  81. --note-after: #fbe2d9;
  82. --note-gutter: #ffe600;
  83. --tip: #3f3b4291;
  84. --tip-border: #983fb1;
  85. --tip-after: #761c91;
  86. --tip-gutter: #b115b9;
  87. --annotation: #e9f7fb;
  88. --annotation-border: #c0d3d8;
  89. --annotation-bg: #242424;
  90. --annotation-after: #c0d3d8;
  91. // NOTE(benesch): please ensure these colors stay blueish. Public preview
  92. // requires a mild amount of caution. Importantly, green is not the right
  93. // color, as that implies encouragement rather than caution.
  94. --public-preview: #393e514b;
  95. --public-preview-text: var(--important);
  96. --public-preview-border: #374e7c;
  97. --public-preview-after: #c0d3d8;
  98. --public-preview-gutter: #306dca;
  99. }
  100. body.light {
  101. --bg: var(--white-light);
  102. --bg-nav: var(--nav-light);
  103. --bg-sub: var(--gray-lighter);
  104. --card: var(--gray-lightest);
  105. --card-light: var(--white);
  106. --color-scheme: light;
  107. --divider: var(--gray);
  108. --divider-light: var(--gray-lighter);
  109. --link: var(--brand);
  110. --code-block: var(--code-block-light);
  111. --code-simple: #505050;
  112. --code-simple-bg: var(--code-block-light);
  113. --code-red: #c41a16;
  114. --code-pink: #a90d91;
  115. --code-blue: #1c01ce;
  116. --code-green: #177500;
  117. --important: var(--black);
  118. --sub: var(--black-lighter);
  119. --body: var(--black-light);
  120. --highlight: var(--purple-dark);
  121. --note: #fffad411;
  122. --note-border: #b9a61545;
  123. --note-after: #fbe2d9;
  124. --note-gutter: #7b7b29;
  125. --tip: #f4e3fd91;
  126. --tip-border: #983fb1;
  127. --tip-after: #761c91;
  128. --tip-gutter: #b115b9;
  129. --annotation-border: #c0d3d8;
  130. --annotation-after: #c0d3d8;
  131. --annotation-bg: #e7ebf1;
  132. // NOTE(benesch): please ensure these colors stay blueish. Public preview
  133. // requires a mild amount of caution. Importantly, green is not the right
  134. // color, as that implies encouragement rather than caution.
  135. --public-preview: #e9f7fb;
  136. --public-preview-border: #c0d3d8;
  137. --public-preview-after: #c0d3d8;
  138. --public-preview-gutter: #186477;
  139. --public-preview-text: var(--black);
  140. }
  141. *,
  142. *::before,
  143. *::after {
  144. margin: 0;
  145. padding: 0;
  146. box-sizing: border-box;
  147. }
  148. body {
  149. font-family: "Inter", sans-serif;
  150. color: var(--important);
  151. color-scheme: var(--color-scheme);
  152. background: var(--bg);
  153. font-size: var(--base);
  154. line-height: 1.7;
  155. font-weight: 300;
  156. max-width: 100vw;
  157. overflow-x: hidden;
  158. @media(max-width: 500px) {
  159. font-size: rem(1.5);
  160. }
  161. }
  162. input,
  163. textarea,
  164. select {
  165. font-family: inherit;
  166. }
  167. a,
  168. button,
  169. input[type="submit"] {
  170. cursor: pointer;
  171. background: none;
  172. border: none;
  173. transition: all 0.2s;
  174. transition-delay: 50ms;
  175. font-family: inherit;
  176. }
  177. .osano-cm-widget { display: none; }
  178. /**
  179. The following section handles these cases:
  180. 1. Buttons with links
  181. 2. Links
  182. 3. Links with <code/>
  183. 4. Link in the index (<nav/>) with <code/>
  184. 5. Links inside notes
  185. 6. Links inside notes with <code/>
  186. **/
  187. .btn,
  188. .btn-ghost {
  189. color: var(--white);
  190. text-decoration: none;
  191. &:hover,
  192. &:focus {
  193. text-decoration: underline;
  194. color: var(--white);
  195. }
  196. }
  197. nav {
  198. .link-with-code {
  199. color: var(--sub);
  200. &:hover,
  201. &:focus {
  202. text-decoration: underline;
  203. color: var(--link);
  204. }
  205. }
  206. }
  207. p > a,
  208. .note > a,
  209. .tip > a,
  210. .annotation > a,
  211. .link-with-code {
  212. color: var(--link);
  213. &:hover,
  214. &:focus {
  215. text-decoration: underline;
  216. color: var(--sub);
  217. }
  218. }
  219. .annotation-title {
  220. font-weight: 600;
  221. padding-bottom: rem(1.2);
  222. }
  223. a {
  224. &:hover,
  225. &:focus {
  226. text-decoration: underline;
  227. color: var(--link);
  228. }
  229. color: var(--sub);
  230. text-decoration: none;
  231. }
  232. /*-------- Finish links color--------*/
  233. [class*="btn"] {
  234. display: inline-flex;
  235. justify-content: center;
  236. align-items: center;
  237. font-size: 12px;
  238. text-transform: uppercase;
  239. white-space: nowrap;
  240. font-weight: 600;
  241. letter-spacing: 0.1em;
  242. background: var(--brand);
  243. color: var(--white);
  244. padding: rem(0.6) rem(1.2);
  245. border-radius: 8px;
  246. svg {
  247. margin-right: rem(.6);
  248. width: 18px;
  249. height: 18px;
  250. }
  251. &:hover,
  252. &:focus {
  253. color: var(--white);
  254. text-decoration: none;
  255. box-shadow: rgba(128,78,255,.3) 0px 0px 0px 8px
  256. }
  257. }
  258. .btn-ghost {
  259. position: relative;
  260. background: var(--bg);
  261. border: 1px solid var(--brand);
  262. color: var(--important);
  263. &:hover,
  264. &:focus {
  265. color: var(--important);
  266. }
  267. }
  268. .graident-text {
  269. background: var(--brand);
  270. color: transparent;
  271. background-clip: text;
  272. }
  273. select.version-dropdown {
  274. appearance: none;
  275. -moz-appearance: none;
  276. -webkit-appearance: none;
  277. background-image: url('https://res.cloudinary.com/mzimgcdn/image/upload/v1737129759/dropdown.svg');
  278. background-position: right 0.5rem top 50%, 0 0;
  279. background-repeat: no-repeat, repeat;
  280. background-size: 1.3rem auto, 100%;
  281. outline: 1px solid transparent;
  282. border: 1px solid var(--divider);
  283. padding: var(--pico) var(--nano);
  284. border-radius: 4px;
  285. background-color: var(--bg);
  286. &:focus,
  287. &:active {
  288. outline: none;
  289. }
  290. }
  291. red { color: var(--code-red); }
  292. blue { color: #2300ce; }