_single.scss 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  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. margin: 1rem;
  245. > table {
  246. max-width: 100%;
  247. margin: 10px 0;
  248. border-spacing: 0;
  249. box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.125);
  250. @include themify($codeblock) {
  251. thead {
  252. background: themed('content-pre-header-background-color');
  253. }
  254. th {
  255. color: themed('content-pre-header-color');
  256. }
  257. th, td {
  258. padding: 0.25rem 0.5rem;
  259. border: 1px double themed('content-pre-border-background-color');
  260. }
  261. }
  262. }
  263. code:not([class^=language]) {
  264. padding: 3px 7px;
  265. margin: 0 0.25rem;
  266. @include themify($codeblock) {
  267. color: themed('content-code-color');
  268. }
  269. }
  270. }
  271. }
  272. &__tags {
  273. list-style-type: none;
  274. @include flexbox();
  275. @include align-items(center);
  276. @include flex-wrap(wrap);
  277. @include flex-grow(1);
  278. }
  279. &__tag {
  280. padding: 0 0.25rem;
  281. }
  282. }
  283. code, pre {
  284. padding: 0.25rem 0.5rem;
  285. line-height: 1.5;
  286. font-family: $code-font-stack;
  287. overflow: auto;
  288. a {
  289. text-decoration: none !important;
  290. }
  291. }
  292. pre.chroma {
  293. padding: 0.65rem 0;
  294. }
  295. *:not(.chroma) {
  296. code, pre {
  297. @include themify($codeblock) {
  298. color: themed('content-pre-color');
  299. background: themed('content-pre-background-color');
  300. }
  301. }
  302. code {
  303. padding: 0;
  304. }
  305. }
  306. code:not([class^=language]) {
  307. padding: 3px 0;
  308. border-radius: 4px;
  309. @include themify($codeblock) {
  310. color: themed('content-code-color');
  311. }
  312. }
  313. pre:not(.chroma) {
  314. overflow: auto;
  315. }
  316. .single__contents > .language-code, li > .language-code {
  317. overflow-x: auto;
  318. position: relative;
  319. margin: 1rem 0;
  320. direction: ltr;
  321. @include on-event {
  322. .copy-to-clipboard {
  323. opacity: 1;
  324. }
  325. }
  326. &::after {
  327. position: absolute;
  328. top: 0;
  329. right: 0;
  330. left: 0;
  331. padding: 2px 7px;
  332. width: 100%;
  333. height: 20px;
  334. z-index: z('toc');
  335. border-top-left-radius: 0.25rem;
  336. border-top-right-radius: 0.25rem;
  337. content: '';
  338. @include themify($codeblock) {
  339. color: themed('content-pre-header-color');
  340. background: themed('content-pre-header-background-color');
  341. }
  342. }
  343. }
  344. .highlight > .chroma {
  345. margin-bottom: 1.5rem;
  346. z-index: z('content');
  347. overflow-x: auto;
  348. direction: ltr;
  349. @include themify($codeblock) {
  350. color: themed('content-pre-color');
  351. background: themed('content-pre-background-color');
  352. }
  353. code {
  354. padding: 0;
  355. }
  356. code[data-lang] {
  357. &::before {
  358. position: absolute;
  359. top: 0;
  360. right: 0;
  361. z-index: z('grid');
  362. height: 25px;
  363. width: 100%;
  364. display: inline-block;
  365. text-align: right;
  366. content: attr(data-lang);
  367. @include themify($themes) {
  368. color: themed('body-background-color');
  369. background: themed('body-background-color');
  370. }
  371. }
  372. &::after {
  373. position: absolute;
  374. top: 2px;
  375. right: 0;
  376. z-index: z('clipboard');
  377. padding: 0.125rem 0.25rem;
  378. height: 25px;
  379. font-family: $title-font;
  380. font-weight: bold;
  381. font-size: 0.85rem;
  382. line-height: 1.5;
  383. display: inline-block;
  384. text-transform: capitalize;
  385. border-top-left-radius: 0.2rem;
  386. content: attr(data-lang);
  387. @include themify($themes) {
  388. border-top: 1px solid themed('hr-color');
  389. border-left: 1px solid themed('hr-color');
  390. }
  391. @include themify($codeblock) {
  392. background: themed('content-pre-header-background-color');
  393. }
  394. }
  395. }
  396. table, tr, td {
  397. margin: 0;
  398. padding: 0;
  399. width: 100%;
  400. border-collapse: collapse;
  401. }
  402. .lntd {
  403. &:first-child {
  404. width: 10px;
  405. @include no-select;
  406. }
  407. &:last-child {
  408. vertical-align: top;
  409. }
  410. }
  411. /* LineNumbersTable */
  412. .lnt {
  413. margin-left: 0.2rem;
  414. margin-right: 0.5rem;
  415. @include themify($codeblock) {
  416. color: themed('content-pre-number-color');
  417. }
  418. }
  419. table.lntable {
  420. overflow-x: auto;
  421. @include themify($themes) {
  422. @include webkit-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  423. @include moz-scrollbars(themed('custom-scrollbar-foreground-color'), themed('custom-scrollbar-background-color'));
  424. }
  425. @include themify($codeblock) {
  426. td:first-child {
  427. border-left: 4px solid themed('content-pre-border-background-color');
  428. }
  429. }
  430. }
  431. }
  432. li .highlight > .chroma {
  433. .lnt:first-child {
  434. padding: 0 0.3rem;
  435. }
  436. .lnt:not(:first-child) {
  437. padding: 0 0.3rem;
  438. }
  439. }
  440. td:not(.lntd) {
  441. code {
  442. padding: 2px 7px !important;
  443. }
  444. }
  445. table:not(.lntable) {
  446. // margin: 0 1rem;
  447. td {
  448. code {
  449. padding: 2px 7px !important;
  450. }
  451. }
  452. }