_single.scss 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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. @include themify($codeblock) {
  124. border-left: 4px solid themed('content-pre-border-background-color');
  125. }
  126. }
  127. div.chroma {
  128. position: relative;
  129. @include on-event {
  130. .copy-to-clipboard {
  131. opacity: 1;
  132. }
  133. }
  134. }
  135. p > code:not([class^=language]) {
  136. padding: 0.25rem 0.5rem;
  137. @include themify($codeblock) {
  138. color: themed('content-code-color');
  139. }
  140. }
  141. blockquote {
  142. margin: 0 1.75rem 1.75rem 1.5rem;
  143. padding: 0 0 0 1.42188rem;
  144. font-size: 1.05rem;
  145. font-style: italic;
  146. line-height: 1.75;
  147. color: inherit;
  148. opacity: 0.8;
  149. position: relative;
  150. @include themify($themes) {
  151. border-left: 5px solid themed("single-blockquote-border-color");
  152. }
  153. code:not([class^=language]) {
  154. padding: 3px 7px;
  155. margin: 0 0.25rem;
  156. @include themify($codeblock) {
  157. color: themed('content-code-color');
  158. }
  159. }
  160. }
  161. img {
  162. display: block;
  163. border-radius: 0.25rem;
  164. margin: 0 auto;
  165. }
  166. p {
  167. margin: 0 0 10px 0;
  168. padding: 0 1rem;
  169. code:not([class^=language]) {
  170. padding: 3px 7px;
  171. margin: 0 0.25rem;
  172. @include themify($codeblock) {
  173. color: themed('content-code-color');
  174. }
  175. }
  176. }
  177. ul {
  178. margin-right: 0;
  179. margin-top: 0;
  180. margin-bottom: 1rem;
  181. padding: 0;
  182. list-style: disc outside none;
  183. }
  184. ol {
  185. margin-bottom: 1rem;
  186. }
  187. li {
  188. margin-left: 2rem;
  189. & > code {
  190. padding: 2px 7px;
  191. }
  192. code:not([class^=language]) {
  193. @include themify($codeblock) {
  194. color: themed('content-code-color');
  195. }
  196. }
  197. }
  198. hr {
  199. margin: 10px 1rem;
  200. border: none;
  201. height: 1px;
  202. @include themify($themes) {
  203. background: themed("single-hr-background-color");
  204. }
  205. }
  206. dl dt::after {
  207. content: ':';
  208. }
  209. dd {
  210. display: block;
  211. margin-inline-start: 40px;
  212. }
  213. .anchor {
  214. cursor: pointer;
  215. }
  216. a.footnote-ref {
  217. font-size: 0.75rem;
  218. font-weight: bold;
  219. margin-left: 3px;
  220. &::before {
  221. content: "[";
  222. }
  223. &::after {
  224. content: "]";
  225. }
  226. }
  227. .table-wrapper {
  228. overflow-x: auto;
  229. > table {
  230. max-width: 100%;
  231. margin: 10px 0;
  232. border-spacing: 0;
  233. @include themify($codeblock) {
  234. thead {
  235. background: themed('content-pre-header-background-color');
  236. }
  237. th {
  238. color: themed('content-pre-header-color');
  239. }
  240. th, td {
  241. padding: 5px 15px;
  242. font-size: 13.8px;
  243. border: 1px double themed('content-pre-border-background-color');
  244. }
  245. }
  246. }
  247. code:not([class^=language]) {
  248. padding: 3px 7px;
  249. margin: 0 0.25rem;
  250. @include themify($codeblock) {
  251. color: themed('content-code-color');
  252. }
  253. }
  254. }
  255. }
  256. &__tags {
  257. list-style-type: none;
  258. @include flexbox();
  259. @include align-items(center);
  260. @include flex-wrap(wrap);
  261. @include flex-grow(1);
  262. }
  263. &__tag {
  264. padding: 0 0.25rem;
  265. }
  266. }
  267. code, pre {
  268. padding: 0.25rem 0.5rem;
  269. line-height: 1.5;
  270. font-family: $code-font-stack;
  271. overflow: auto;
  272. a {
  273. text-decoration: none !important;
  274. }
  275. }
  276. pre.chroma {
  277. padding: 0.65rem 0;
  278. }
  279. *:not(.chroma) {
  280. code, pre {
  281. @include themify($codeblock) {
  282. color: themed('content-pre-color');
  283. background: themed('content-pre-background-color');
  284. }
  285. }
  286. code {
  287. padding: 0;
  288. }
  289. }
  290. code:not([class^=language]) {
  291. padding: 3px 0;
  292. border-radius: 4px;
  293. @include themify($codeblock) {
  294. color: themed('content-code-color');
  295. }
  296. }
  297. pre:not(.chroma) {
  298. overflow: auto;
  299. }
  300. .single__contents > .language-code, li > .language-code {
  301. overflow-x: auto;
  302. position: relative;
  303. margin: 1rem 0;
  304. @include on-event {
  305. .copy-to-clipboard {
  306. opacity: 1;
  307. }
  308. }
  309. &::after {
  310. position: absolute;
  311. top: 0;
  312. right: 0;
  313. left: 0;
  314. padding: 2px 7px;
  315. width: 100%;
  316. height: 20px;
  317. z-index: z('toc');
  318. border-top-left-radius: 0.25rem;
  319. border-top-right-radius: 0.25rem;
  320. content: '';
  321. @include themify($codeblock) {
  322. color: themed('content-pre-header-color');
  323. background: themed('content-pre-header-background-color');
  324. }
  325. }
  326. }
  327. .highlight > .chroma {
  328. margin: 1em 0;
  329. z-index: z('content');
  330. overflow-x: auto;
  331. @include themify($codeblock) {
  332. color: themed('content-pre-color');
  333. background: themed('content-pre-background-color');
  334. }
  335. code {
  336. padding: 0;
  337. }
  338. code[data-lang] {
  339. &::before {
  340. position: absolute;
  341. top: 0;
  342. right: 0;
  343. z-index: z('grid');
  344. height: 25px;
  345. width: 100%;
  346. display: inline-block;
  347. text-align: right;
  348. content: attr(data-lang);
  349. @include themify($themes) {
  350. color: themed('body-background-color');
  351. background: themed('body-background-color');
  352. }
  353. }
  354. &::after {
  355. position: absolute;
  356. top: 2px;
  357. right: 0;
  358. z-index: z('clipboard');
  359. padding: 0.125rem 0.25rem;
  360. height: 25px;
  361. font-family: $title-font;
  362. font-weight: bold;
  363. font-size: 0.85rem;
  364. line-height: 1.5;
  365. display: inline-block;
  366. text-transform: capitalize;
  367. border-top-left-radius: 0.2rem;
  368. content: attr(data-lang);
  369. @include themify($themes) {
  370. border-top: 1px solid themed('hr-color');
  371. border-left: 1px solid themed('hr-color');
  372. }
  373. @include themify($codeblock) {
  374. background: themed('content-pre-header-background-color');
  375. }
  376. }
  377. }
  378. table, tr, td {
  379. margin: 0;
  380. padding: 0;
  381. width: 100%;
  382. border-collapse: collapse;
  383. }
  384. .lntd {
  385. &:first-child {
  386. width: 10px;
  387. @include no-select;
  388. }
  389. &:last-child {
  390. vertical-align: top;
  391. }
  392. }
  393. /* LineNumbersTable */
  394. .lnt {
  395. margin-left: 0.2rem;
  396. margin-right: 0.5rem;
  397. @include themify($codeblock) {
  398. color: themed('content-pre-number-color');
  399. }
  400. }
  401. table.lntable {
  402. overflow-x: auto;
  403. @include themify($themes) {
  404. @include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  405. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  406. }
  407. @include themify($codeblock) {
  408. td:first-child {
  409. border-left: 4px solid themed('content-pre-border-background-color');
  410. }
  411. }
  412. }
  413. }
  414. li .highlight > .chroma {
  415. .lnt:first-child {
  416. padding: 0 0.3rem;
  417. }
  418. .lnt:not(:first-child) {
  419. padding: 0 0.3rem;
  420. }
  421. }
  422. table:not(.lntable) {
  423. td {
  424. code {
  425. padding: 2px 7px !important;
  426. }
  427. }
  428. }