_single.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. #single-menu {
  2. @include themify($themes) {
  3. border-right: 1px solid themed('border-line-color');
  4. }
  5. }
  6. .single {
  7. padding: 0 1rem;
  8. display: block;
  9. position: relative;
  10. width: 100%;
  11. overflow-wrap: break-word;
  12. &__title {
  13. font-size: 2.5rem;
  14. font-weight: 900;
  15. font-family: $title-font;
  16. line-height: 3rem;
  17. overflow-wrap: break-word;
  18. margin-top: 1.5rem;
  19. margin-bottom: 0.5rem;
  20. @include themify($themes) {
  21. color: themed("single-header-title-color");
  22. }
  23. }
  24. &__meta {
  25. font-size: 0.8rem;
  26. margin-bottom: 1.5rem;
  27. @include flexbox();
  28. @include align-items(center);
  29. @include themify($themes) {
  30. color: themed('meta-color');
  31. }
  32. }
  33. &__infos {
  34. margin-right: 0.5rem;
  35. @include flexbox();
  36. @include flex-wrap(wrap);
  37. }
  38. &__info {
  39. word-break: keep-all;
  40. padding: 0 0.125rem;
  41. }
  42. &__contents {
  43. &--gallery {
  44. overflow: hidden;
  45. }
  46. & > p > a {
  47. text-decoration: underline;
  48. }
  49. margin: 1rem 0;
  50. line-height: 1.7;
  51. width: inheirt;
  52. max-width: inherit;
  53. h1,
  54. h2,
  55. h3,
  56. h4,
  57. h5,
  58. h6 {
  59. position: relative;
  60. line-height: 1.25;
  61. font-family: $title-font;
  62. }
  63. h1,
  64. h2 {
  65. padding: 0;
  66. color: inherit;
  67. font-weight: 900;
  68. text-rendering: optimizeLegibility;
  69. @include themify($themes) {
  70. color: themed("single-contents-title-color");
  71. }
  72. }
  73. h3,
  74. h4,
  75. h5,
  76. h6 {
  77. @include themify($themes) {
  78. color: themed("single-contents-subtitle-color");
  79. }
  80. }
  81. h1 {
  82. font-size: 2.6rem;
  83. margin: 3.5rem 0 1.75rem 0;
  84. }
  85. h2 {
  86. font-size: 2.2rem;
  87. margin: 3.2rem 0 1.5rem 0;
  88. }
  89. h3 {
  90. font-size: 1.8rem;
  91. margin: 2.8rem 0 1.25rem 0;
  92. }
  93. h4 {
  94. font-size: 1.5rem;
  95. margin: 2.4rem 0 1rem 0;
  96. }
  97. h5 {
  98. font-size: 1.2rem;
  99. margin: 2rem 0 0.8rem 0;
  100. }
  101. h6 {
  102. font-size: 1rem;
  103. margin: 1.5rem 0 0.5rem 0;
  104. }
  105. pre {
  106. margin-top: 25px;
  107. overflow: auto;
  108. line-height: 1.5;
  109. @include themify($themes) {
  110. border-top: 1px solid themed('hr-color');
  111. border-bottom: 1px solid themed('hr-color');
  112. @include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  113. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  114. }
  115. }
  116. pre:not(.chroma) {
  117. position: relative;
  118. }
  119. div.chroma {
  120. position: relative;
  121. @include on-event {
  122. .copy-to-clipboard {
  123. opacity: 1;
  124. }
  125. }
  126. }
  127. p > code:not([class^=language]) {
  128. padding: 0.25rem 0.5rem;
  129. @include themify($codeblock) {
  130. color: themed('content-code-color');
  131. }
  132. }
  133. code + .copy-to-clipboard {
  134. position: absolute;
  135. right: 4px;
  136. top: 5px;
  137. border-radius: 2px;
  138. z-index: z('clipboard');
  139. @include transition(all, 0.2s, ease);
  140. }
  141. .copy-to-clipboard {
  142. background-position: 50% 50%;
  143. background-size: 16px 16px;
  144. background-repeat: no-repeat;
  145. width: 27px;
  146. height: 1.45rem;
  147. top: -1px;
  148. vertical-align: middle;
  149. position: relative;
  150. margin-left: -0.2rem;
  151. cursor: pointer;
  152. border-radius: 0 2px 2px 0;
  153. margin-bottom: 1px;
  154. opacity: 0;
  155. @include clippy();
  156. @include transition(all, 0.2s, ease);
  157. }
  158. .copy-to-clipboard:hover {
  159. @include translateY(-0.1rem);
  160. }
  161. .chroma .copy-to-clipboard {
  162. position: absolute;
  163. right: 4px;
  164. top: 5px;
  165. border-radius: 2px;
  166. z-index: z('clipboard');
  167. @include transition(all, 0.2s, ease);
  168. }
  169. .chroma .copy-to-clipboard:hover {
  170. @include translateY(-0.1rem);
  171. }
  172. .language-code .copy-to-clipboard {
  173. position: absolute;
  174. right: 4px;
  175. top: 5px;
  176. border-radius: 2px;
  177. z-index: z('clipboard');
  178. @include transition(all, 0.2s, ease);
  179. }
  180. .language-code .copy-to-clipboard:hover {
  181. @include translateY(-0.1rem);
  182. }
  183. blockquote {
  184. margin: 0 1.75rem 1.75rem 1.5rem;
  185. padding: 0 0 0 1.42188rem;
  186. font-size: 1.05rem;
  187. line-height: 1.75;
  188. color: inherit;
  189. opacity: 0.8;
  190. position: relative;
  191. @include themify($themes) {
  192. border-left: 0.32813rem solid themed("single-blockquote-border-color");
  193. }
  194. code:not([class^=language]) {
  195. padding: 3px 7px;
  196. margin: 0 0.25rem;
  197. @include themify($codeblock) {
  198. color: themed('content-code-color');
  199. }
  200. }
  201. }
  202. img {
  203. display: block;
  204. border-radius: 0.25rem;
  205. margin: 0 auto;
  206. }
  207. p {
  208. margin: 0 0 1.75rem 0;
  209. padding: 0;
  210. code:not([class^=language]) {
  211. padding: 3px 7px;
  212. margin: 0 0.25rem;
  213. @include themify($codeblock) {
  214. color: themed('content-code-color');
  215. }
  216. }
  217. }
  218. ul {
  219. margin-right: 0;
  220. margin-top: 0;
  221. padding: 0;
  222. list-style: disc outside none;
  223. }
  224. li {
  225. margin-left: 2rem;
  226. margin-bottom: calc(1rem / 2);
  227. & > code {
  228. padding: 2px 7px;
  229. }
  230. code:not([class^=language]) {
  231. @include themify($codeblock) {
  232. color: themed('content-code-color');
  233. }
  234. }
  235. }
  236. hr {
  237. margin: 0 0 calc(1.25rem - 1px) 0;
  238. padding: 0;
  239. border: none;
  240. height: 1px;
  241. @include themify($themes) {
  242. background: themed("single-hr-background-color");
  243. }
  244. }
  245. dl dt::after {
  246. content: ':';
  247. }
  248. dd {
  249. display: block;
  250. margin-inline-start: 40px;
  251. }
  252. .anchor {
  253. cursor: pointer;
  254. }
  255. a.footnote-ref {
  256. font-size: 0.75rem;
  257. font-weight: bold;
  258. margin-left: 3px;
  259. &::before {
  260. content: "[";
  261. }
  262. &::after {
  263. content: "]";
  264. }
  265. }
  266. .table-wrapper {
  267. overflow-x: auto;
  268. > table {
  269. max-width: 100%;
  270. margin: 10px 0;
  271. border-spacing: 0;
  272. @include themify($codeblock) {
  273. thead {
  274. background: themed('content-pre-header-background-color');
  275. }
  276. th {
  277. color: themed('content-pre-header-color');
  278. }
  279. th, td {
  280. padding: 5px 15px;
  281. font-size: 13.8px;
  282. border: 1px double themed('content-pre-border-background-color');
  283. }
  284. }
  285. }
  286. code:not([class^=language]) {
  287. padding: 3px 7px;
  288. margin: 0 0.25rem;
  289. @include themify($codeblock) {
  290. color: themed('content-code-color');
  291. }
  292. }
  293. }
  294. }
  295. &__tags {
  296. list-style-type: none;
  297. @include flexbox();
  298. @include align-items(center);
  299. @include flex-wrap(wrap);
  300. @include flex-grow(1);
  301. }
  302. &__tag {
  303. padding: 0 0.25rem;
  304. }
  305. }
  306. code, pre {
  307. padding: 0.25rem 0.5rem;
  308. line-height: 1.5;
  309. font-family: $code-font-stack;
  310. overflow: auto;
  311. a {
  312. text-decoration: none !important;
  313. }
  314. }
  315. pre.chroma {
  316. padding: 0.25rem 0;
  317. }
  318. *:not(.chroma) {
  319. code, pre {
  320. @include themify($codeblock) {
  321. color: themed('content-pre-color');
  322. background: themed('content-pre-background-color');
  323. }
  324. }
  325. code {
  326. padding: 0;
  327. }
  328. }
  329. code:not([class^=language]) {
  330. padding: 3px 0;
  331. border-radius: 4px;
  332. @include themify($codeblock) {
  333. color: themed('content-code-color');
  334. }
  335. }
  336. pre:not(.chroma) {
  337. overflow: auto;
  338. }
  339. .single__contents > .language-code, li > .language-code {
  340. overflow-x: auto;
  341. position: relative;
  342. margin: 1rem 0;
  343. @include on-event {
  344. .copy-to-clipboard {
  345. opacity: 1;
  346. }
  347. }
  348. &::after {
  349. position: absolute;
  350. top: 0;
  351. right: 0;
  352. left: 0;
  353. padding: 2px 7px;
  354. width: 100%;
  355. height: 20px;
  356. z-index: z('toc');
  357. border-top-left-radius: 0.25rem;
  358. border-top-right-radius: 0.25rem;
  359. content: '';
  360. @include themify($codeblock) {
  361. color: themed('content-pre-header-color');
  362. background: themed('content-pre-header-background-color');
  363. }
  364. }
  365. }
  366. .highlight > .chroma {
  367. margin: 1em 0;
  368. z-index: z('content');
  369. overflow-x: auto;
  370. @include themify($codeblock) {
  371. color: themed('content-pre-color');
  372. background: themed('content-pre-background-color');
  373. }
  374. code {
  375. padding: 0;
  376. }
  377. code[data-lang] {
  378. &::before {
  379. position: absolute;
  380. top: 0;
  381. right: 0;
  382. z-index: z('grid');
  383. height: 25px;
  384. width: 100%;
  385. display: inline-block;
  386. text-align: right;
  387. content: attr(data-lang);
  388. @include themify($themes) {
  389. color: themed('body-background-color');
  390. background: themed('body-background-color');
  391. }
  392. }
  393. &::after {
  394. position: absolute;
  395. top: 0;
  396. right: 0;
  397. z-index: z('clipboard');
  398. padding: 0.125rem 0.25rem;
  399. height: 25px;
  400. font-family: $title-font;
  401. font-weight: bold;
  402. font-size: 0.85rem;
  403. line-height: 1.5;
  404. display: inline-block;
  405. text-transform: capitalize;
  406. border-top-left-radius: 0.2rem;
  407. border-top-right-radius: 0.2rem;
  408. content: attr(data-lang);
  409. @include themify($themes) {
  410. border: 1px solid themed('hr-color');
  411. border-bottom: none;
  412. background-color: themed('body-background-color');
  413. }
  414. }
  415. }
  416. table, tr, td {
  417. margin: 0;
  418. padding: 0;
  419. width: 100%;
  420. border-collapse: collapse;
  421. }
  422. .lntd {
  423. &:first-child {
  424. width: 10px;
  425. @include no-select;
  426. }
  427. &:last-child {
  428. vertical-align: top;
  429. }
  430. }
  431. /* LineNumbersTable */
  432. .lnt {
  433. margin-left: 0.2rem;
  434. margin-right: 0.5rem;
  435. @include themify($codeblock) {
  436. color: themed('content-pre-number-color');
  437. }
  438. }
  439. table.lntable {
  440. overflow-x: auto;
  441. @include themify($themes) {
  442. @include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  443. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  444. }
  445. }
  446. }
  447. li .highlight > .chroma {
  448. .lnt:first-child {
  449. padding: 0 0.3rem;
  450. }
  451. .lnt:not(:first-child) {
  452. padding: 0 0.3rem;
  453. }
  454. }
  455. table:not(.lntable) {
  456. td {
  457. code {
  458. padding: 2px 7px !important;
  459. }
  460. }
  461. }