_single.scss 10 KB

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