_single.scss 9.7 KB

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