_single.scss 9.6 KB

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