_single.scss 10 KB

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