_single.scss 9.0 KB

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