_typo.scss 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. strong {
  2. font-weight: $font-weight-bold;
  3. }
  4. hr {
  5. margin: 3rem 0;
  6. border: 0;
  7. border-top: 1px solid $color-border-light;
  8. }
  9. .hr-text {
  10. display: flex;
  11. align-items: center;
  12. margin: $hr-margin-y 0;
  13. height: 1px;
  14. &:after,
  15. &:before {
  16. flex: 1 1 auto;
  17. height: 1px;
  18. background-color: $color-border;
  19. }
  20. &:before {
  21. content: "";
  22. margin-right: .5rem;
  23. }
  24. &:after {
  25. content: "";
  26. margin-left: .5rem;
  27. }
  28. > *:first-child {
  29. padding-right: .5rem;
  30. padding-left: 0;
  31. color: $color-border;
  32. }
  33. .card > & {
  34. margin: 0;
  35. }
  36. }
  37. a {
  38. color: $color-primary;
  39. text-decoration: none;
  40. &:hover {
  41. color: theme-darken($color-primary);
  42. text-decoration: none;
  43. }
  44. }
  45. %headers-common {
  46. display: block;
  47. font-weight: $font-weight-bold;
  48. color: var(--color-headings, #{$color-headers});
  49. margin-bottom: 0.5rem;
  50. line-height: 1.2;
  51. a {
  52. text-decoration: none;
  53. color: inherit;
  54. &:hover {
  55. text-decoration: underline;
  56. }
  57. }
  58. }
  59. .h0 {
  60. @extend %headers-common;
  61. font-size: $font-size-h1;
  62. line-height: $line-height-h1;
  63. font-weight: $font-weight-black;
  64. @include media-breakpoint-up(lg) {
  65. font-size: $font-size-h0;
  66. line-height: $line-height-h0;
  67. }
  68. }
  69. h1,
  70. .h1 {
  71. @extend %headers-common;
  72. font-size: $font-size-h1;
  73. line-height: $line-height-h1;
  74. }
  75. h2,
  76. .h2 {
  77. @extend %headers-common;
  78. font-size: $font-size-h2;
  79. line-height: $line-height-h2;
  80. }
  81. h3,
  82. .h3 {
  83. @extend %headers-common;
  84. font-size: $font-size-h3;
  85. line-height: $line-height-h3;
  86. margin-bottom: $gap-1;
  87. }
  88. h4,
  89. .h4 {
  90. @extend %headers-common;
  91. font-size: $font-size-h4;
  92. line-height: $line-height-h4;
  93. margin-bottom: $gap-1;
  94. }
  95. h5,
  96. .h5 {
  97. @extend %headers-common;
  98. font-size: $font-size-h5;
  99. line-height: $line-height-h5;
  100. margin-bottom: $gap-1;
  101. }
  102. h6,
  103. .h6 {
  104. @extend %headers-common;
  105. font-size: $font-size-h6;
  106. line-height: $line-height-h6;
  107. margin-bottom: $gap-1;
  108. }
  109. .h-subheader {
  110. font-size: $font-size-h7;
  111. line-height: $line-height-h7;
  112. margin-bottom: $gap-2;
  113. text-transform: uppercase;
  114. letter-spacing: $tracking-wide;
  115. color: $color-muted-light;
  116. font-weight: $font-weight-medium;
  117. }
  118. p,
  119. ol,
  120. ul,
  121. pre,
  122. table,
  123. .highlight,
  124. .callout,
  125. .tip {
  126. margin-bottom: $gap-4;
  127. }
  128. ol,
  129. ul {
  130. margin-left: 1rem;
  131. padding-left: 1rem;
  132. }
  133. img,
  134. picture {
  135. max-width: 100%;
  136. display: block;
  137. &[width][height] {
  138. height: auto;
  139. }
  140. &:not([height]) {
  141. height: auto;
  142. }
  143. }
  144. .img {
  145. border: 1px solid $color-border-light;
  146. border-radius: $border-radius;
  147. background: $color-white;
  148. }
  149. input,
  150. button,
  151. textarea,
  152. select {
  153. font: inherit;
  154. }
  155. img:not([alt]) {
  156. filter: blur(10px);
  157. }
  158. .text-truncate {
  159. @include text-truncate(100%);
  160. }
  161. .link-icon {
  162. display: inline-flex;
  163. color: inherit;
  164. text-decoration: none;
  165. @at-root a#{&} {
  166. &:hover {
  167. opacity: 0.8;
  168. }
  169. }
  170. svg {
  171. opacity: 0.5;
  172. vertical-align: bottom;
  173. margin-right: $gap-2;
  174. width: $line-height-base;
  175. height: $line-height-base;
  176. }
  177. }
  178. .link-text {
  179. color: $color-text;
  180. text-decoration: none;
  181. transition: 0.3s color;
  182. &:hover {
  183. text-decoration: none;
  184. color: $color-primary;
  185. }
  186. }
  187. .link-muted {
  188. color: $color-muted;
  189. text-decoration: none;
  190. transition: 0.3s color;
  191. &:hover,
  192. &.active {
  193. text-decoration: none;
  194. color: $color-text;
  195. }
  196. }
  197. .link-brand {
  198. color: $color-muted-light;
  199. text-decoration: none;
  200. transition: 0.3s color;
  201. &:hover {
  202. text-decoration: none;
  203. color: $color-text;
  204. }
  205. }
  206. .visually-hidden {
  207. clip: rect(0 0 0 0);
  208. clip-path: inset(50%);
  209. height: 1px;
  210. overflow: hidden;
  211. position: absolute;
  212. white-space: nowrap;
  213. width: 1px;
  214. }
  215. code {
  216. padding: 0.25em 0.25em;
  217. font-family: $font-family-monospace;
  218. font-size: 85%;
  219. background-color: rgba($color-muted-dark, 0.04);
  220. border-radius: $border-radius;
  221. border: 1px solid $color-border;
  222. color: $color-muted-dark;
  223. }
  224. pre,
  225. code {
  226. font-family: $font-family-monospace;
  227. }
  228. pre {
  229. white-space: pre-wrap;
  230. line-height: 1.7142857143;
  231. background: $color-highlight-bg;
  232. color: $color-white;
  233. border-radius: $border-radius;
  234. padding: $gap-3 $gap-4;
  235. font-size: 13px;
  236. word-break: break-word;
  237. tab-size: 2;
  238. overflow: auto;
  239. max-height: 25rem;
  240. @include scrollbar-dark;
  241. code {
  242. background: transparent;
  243. border-radius: 0;
  244. border: none;
  245. font-size: 1em;
  246. display: block;
  247. padding: 0;
  248. color: inherit;
  249. white-space: pre-wrap !important;
  250. }
  251. }
  252. $languages: (
  253. yml: "YAML",
  254. scss: "SCSS",
  255. css: "CSS",
  256. html: "HTML",
  257. js: "JavaScript",
  258. ts: "TypeScript",
  259. );
  260. %language {
  261. position: relative;
  262. pre.highlight:after {
  263. position: absolute;
  264. font-size: $font-size-h6;
  265. user-select: none;
  266. top: $gap-2;
  267. right: $gap-2;
  268. opacity: 0.5;
  269. }
  270. }
  271. @each $class, $name in $languages {
  272. .language-#{$class} {
  273. @extend %language;
  274. pre.highlight:after {
  275. content: "#{$name}";
  276. }
  277. }
  278. }
  279. figure {
  280. }
  281. figcaption {
  282. text-align: center;
  283. font-size: $font-size-h6;
  284. margin: $gap-2 0 0;
  285. color: $color-muted;
  286. }
  287. @keyframes animated-ellipsis-keyframes {
  288. 0% {
  289. transform: translateX(-100%);
  290. }
  291. }
  292. .animated-ellipsis {
  293. display: inline-block;
  294. overflow: hidden;
  295. vertical-align: bottom;
  296. &:after {
  297. display: inline-block;
  298. content: "...";
  299. animation: animated-ellipsis-keyframes 1.2s steps(4, jump-none) infinite;
  300. }
  301. }
  302. .steps {
  303. margin-left: 1rem;
  304. padding-left: 2rem;
  305. counter-reset: step;
  306. border-left: 1px solid $color-border;
  307. margin-bottom: 3rem;
  308. h3 {
  309. counter-increment: step;
  310. &:not(:first-child) {
  311. margin-top: 3rem !important;
  312. }
  313. &:before {
  314. content: counter(step);
  315. display: inline-block;
  316. position: absolute;
  317. margin-top: -2px;
  318. margin-left: calc(-2rem - 1rem);
  319. width: 2rem;
  320. height: 2rem;
  321. text-align: center;
  322. text-indent: -1px;
  323. color: $color-muted;
  324. border-radius: 100%;
  325. border: 4px solid $color-background;
  326. background: $color-gray;
  327. line-height: 1.5rem;
  328. font-size: $font-size-h6;
  329. font-weight: 400;
  330. }
  331. }
  332. }
  333. .tabs {
  334. padding: 0;
  335. margin: 0 0 1.5rem;
  336. border-bottom: 1px solid $color-border;
  337. font-size: $font-size-h6;
  338. }
  339. .tab {
  340. text-decoration: none;
  341. display: inline-block;
  342. line-height: 1;
  343. padding: $gap-2 0;
  344. margin-bottom: -1px;
  345. border-bottom: 2px solid transparent;
  346. color: $color-headers;
  347. cursor: pointer;
  348. &.active {
  349. color: $color-primary;
  350. border-bottom-color: $color-primary;
  351. }
  352. &:not(:first-child) {
  353. margin-left: 1.5rem;
  354. }
  355. }
  356. /*
  357. Callout
  358. */
  359. .callout {
  360. border: 1px solid rgba($color-primary, 0.3);
  361. border-radius: $border-radius;
  362. background: rgba($color-primary, 0.06);
  363. padding: $gap-3;
  364. > :last-child {
  365. margin-bottom: 0;
  366. }
  367. }
  368. .callout-title {
  369. @extend .h-subheader;
  370. color: $color-primary;
  371. }
  372. /**
  373. Tip
  374. */
  375. .tip {
  376. line-height: 1.5rem;
  377. .icon {
  378. width: 1.5rem;
  379. height: 1.5rem;
  380. margin-right: 0.5rem;
  381. vertical-align: bottom;
  382. }
  383. }
  384. /**
  385. Link
  386. */
  387. .link {
  388. .link-img {
  389. box-shadow: $shadow-card;
  390. transition: $transition-duration transform;
  391. }
  392. &:hover {
  393. .link-img {
  394. box-shadow: $shadow-card, $shadow-card-lg;
  395. transform: scale(1.05);
  396. }
  397. }
  398. }
  399. /**
  400. Options table
  401. */
  402. .options-table {
  403. display: grid;
  404. grid-template-columns: repeat(4, minmax(0, 1fr));
  405. border-radius: $border-radius;
  406. border: 1px solid $color-border;
  407. }
  408. .options-table-title {
  409. border-right: 1px solid $color-border;
  410. padding: 1rem;
  411. background: var(--bg-gray-light);
  412. ~.options-table-title {
  413. border-top: 1px solid $color-border;
  414. }
  415. h3 {
  416. margin: 0 !important;
  417. font-size: $font-size-h5;
  418. }
  419. p {
  420. color: $color-muted-light;
  421. font-size: $font-size-h6;
  422. }
  423. }
  424. .options-table-description {
  425. padding: 1rem;
  426. grid-column: span 3/span 3;
  427. ~.options-table-description {
  428. border-top: 1px solid $color-border;
  429. }
  430. }
  431. .codeblock {
  432. position: relative;
  433. left: 50%;
  434. max-width: 64rem;
  435. transform: translate(-50%);
  436. width: 100%;
  437. }
  438. .codeblock-copy {
  439. position: absolute;
  440. top: .5rem;
  441. right: .5rem;
  442. }