_single.scss 10 KB

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