demo.css 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. :root {
  2. --bg-color: #111;
  3. --text-color: #9b9b9b;
  4. --highlight-color: #ff4b4b;
  5. --secondary-color: #2a2a2e;
  6. --accent-color: #ff9f43;
  7. --code-bg: #000;
  8. --orange: #FF8F42;
  9. --border-color: #222;
  10. --panel-bg: #171717;
  11. --panel-bg-2: #141414;
  12. --muted-1: #666;
  13. --muted-2: #888;
  14. --text-strong: #e6e6e6;
  15. --shadow-1: 0 10px 40px rgba(0,0,0,0.25);
  16. }
  17. body {
  18. background-color: var(--bg-color);
  19. color: var(--text-color);
  20. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  21. margin: 0;
  22. padding: 60px 60px;
  23. display: flex;
  24. justify-content: center;
  25. overflow-y: auto;
  26. }
  27. /* Auto-hide scrollbar (shown only on scroll/hover via parent) */
  28. html, body {
  29. scrollbar-width: none; /* Firefox (hidden by default) */
  30. -ms-overflow-style: none; /* IE/old Edge */
  31. }
  32. html::-webkit-scrollbar,
  33. body::-webkit-scrollbar {
  34. width: 0 !important;
  35. height: 0 !important;
  36. }
  37. /* Some pages may scroll a nested container; hide vertical scrollbars by default */
  38. *::-webkit-scrollbar:vertical {
  39. width: 0 !important;
  40. }
  41. /* Shown when scrolling (class is toggled by doc/index.html) */
  42. html.scrolling,
  43. body.scrolling {
  44. scrollbar-width: thin; /* Firefox */
  45. scrollbar-color: rgba(0, 0, 0, 0.9) transparent;
  46. }
  47. html.scrolling::-webkit-scrollbar,
  48. body.scrolling::-webkit-scrollbar {
  49. width: 6px !important;
  50. height: 6px !important;
  51. }
  52. html.scrolling::-webkit-scrollbar-track,
  53. body.scrolling::-webkit-scrollbar-track {
  54. background: transparent;
  55. }
  56. html.scrolling::-webkit-scrollbar-thumb,
  57. body.scrolling::-webkit-scrollbar-thumb {
  58. background: rgba(0, 0, 0, 0.95) !important;
  59. border-radius: 999px;
  60. }
  61. html.scrolling::-webkit-scrollbar-thumb:hover,
  62. body.scrolling::-webkit-scrollbar-thumb:hover {
  63. background: rgba(0, 0, 0, 1);
  64. }
  65. /* Show vertical scrollbars (narrow + black) for any scrolled container while scrolling */
  66. html.scrolling *::-webkit-scrollbar:vertical,
  67. body.scrolling *::-webkit-scrollbar:vertical {
  68. width: 6px !important;
  69. }
  70. html.scrolling *::-webkit-scrollbar-thumb,
  71. body.scrolling *::-webkit-scrollbar-thumb {
  72. background: rgba(0, 0, 0, 0.95) !important;
  73. border-radius: 999px;
  74. }
  75. html.scrolling *::-webkit-scrollbar-track,
  76. body.scrolling *::-webkit-scrollbar-track {
  77. background: transparent !important;
  78. }
  79. .container {
  80. width: 100%;
  81. }
  82. h1 {
  83. color: var(--orange);
  84. font-size: 42px;
  85. margin-bottom: 15px;
  86. font-weight: 600;
  87. letter-spacing: -1px;
  88. }
  89. .description {
  90. font-size: 18px;
  91. line-height: 1.5;
  92. margin-bottom: 40px;
  93. color: #ccc;
  94. }
  95. h2 {
  96. font-size: 24px;
  97. color: #fff;
  98. margin-bottom: 10px;
  99. font-weight: 500;
  100. }
  101. p {
  102. margin-top: 0;
  103. margin-bottom: 20px;
  104. line-height: 1.6;
  105. }
  106. code.inline {
  107. background: rgba(255,255,255,0.1);
  108. color: #e6e6e6;
  109. padding: 2px 6px;
  110. border-radius: 3px;
  111. font-family: 'Roboto Mono', monospace;
  112. font-size: 0.9em;
  113. }
  114. /* Page top meta (breadcrumb + since) */
  115. .page-top {
  116. display: flex;
  117. align-items: center;
  118. justify-content: space-between;
  119. margin-bottom: 18px;
  120. }
  121. .crumb {
  122. font-size: 10px;
  123. font-weight: 800;
  124. letter-spacing: 1px;
  125. color: var(--highlight-color);
  126. text-transform: uppercase;
  127. }
  128. .since {
  129. font-size: 10px;
  130. font-weight: 700;
  131. letter-spacing: 1px;
  132. color: #7a6a55;
  133. text-transform: uppercase;
  134. }
  135. /* Code & Demo Box */
  136. .box-container {
  137. margin-top: 50px;
  138. background: var(--panel-bg);
  139. border-radius: 6px;
  140. overflow: hidden;
  141. box-shadow: var(--shadow-1);
  142. }
  143. .box-header {
  144. display: flex;
  145. justify-content: space-between;
  146. align-items: center;
  147. padding: 0 20px;
  148. height: 50px;
  149. background: rgba(255,255,255,0.02);
  150. border-bottom: 1px solid var(--border-color);
  151. }
  152. .box-title {
  153. color: var(--orange);
  154. font-weight: 600;
  155. font-size: 14px;
  156. }
  157. .box-right {
  158. display: flex;
  159. align-items: center;
  160. gap: 14px;
  161. height: 100%;
  162. }
  163. .tabs {
  164. display: flex;
  165. gap: 20px;
  166. height: 100%;
  167. }
  168. .tab {
  169. display: flex;
  170. align-items: center;
  171. height: 100%;
  172. cursor: pointer;
  173. color: #666;
  174. font-weight: 600;
  175. font-size: 13px;
  176. border-bottom: 2px solid transparent;
  177. transition: color 0.2s;
  178. }
  179. .tab:hover {
  180. color: #999;
  181. }
  182. .tab.active {
  183. color: var(--orange);
  184. border-bottom-color: var(--orange);
  185. }
  186. /* Code Views */
  187. .code-view, .html-view, .css-view {
  188. background: var(--code-bg);
  189. padding: 20px;
  190. font-family: 'Roboto Mono', 'Monaco', monospace;
  191. font-size: 13px;
  192. line-height: 1.6;
  193. color: #abb2bf;
  194. overflow-x: auto;
  195. display: none;
  196. white-space: pre; /* Use pre to respect indentation */
  197. margin: 0;
  198. }
  199. .code-view.active, .html-view.active, .css-view.active {
  200. display: block;
  201. }
  202. /* Syntax Highlighting */
  203. .kwd { color: #c678dd; }
  204. .str { color: #98c379; }
  205. .fun { color: #61afef; }
  206. .num { color: #d19a66; }
  207. .tag { color: #e06c75; }
  208. .attr { color: #d19a66; }
  209. .val { color: #98c379; }
  210. .punc { color: #abb2bf; }
  211. .com { color: #5c6370; font-style: italic; }
  212. /* Header icon buttons (copy, etc.) */
  213. .icon-btn {
  214. appearance: none;
  215. border: 1px solid transparent;
  216. background: transparent;
  217. color: #777;
  218. width: 28px;
  219. height: 28px;
  220. border-radius: 8px;
  221. display: inline-flex;
  222. align-items: center;
  223. justify-content: center;
  224. cursor: pointer;
  225. transition: border-color 0.15s, background 0.15s, color 0.15s;
  226. }
  227. .icon-btn:hover {
  228. color: #b0b0b0;
  229. border-color: #2a2a2a;
  230. background: rgba(255,255,255,0.03);
  231. }
  232. .icon-btn:active {
  233. transform: translateY(1px);
  234. }
  235. .icon-btn svg {
  236. width: 16px;
  237. height: 16px;
  238. display: block;
  239. }
  240. /* Visual Demo Area */
  241. .demo-visual {
  242. padding: 30px;
  243. background: #1a1a1a;
  244. border-top: 1px solid var(--border-color);
  245. min-height: 150px;
  246. /* Flex alignment defaults, can be overridden by specific page styles */
  247. display: flex;
  248. flex-direction: column;
  249. justify-content: center;
  250. }
  251. .action-bar {
  252. padding: 15px 30px;
  253. display: flex;
  254. justify-content: flex-end;
  255. align-items: center;
  256. gap: 10px;
  257. border-top: 1px solid var(--border-color);
  258. }
  259. .play-btn {
  260. background: transparent;
  261. border: 1px solid #444;
  262. color: #fff;
  263. padding: 6px 14px;
  264. border-radius: 100px;
  265. font-size: 12px;
  266. font-weight: 600;
  267. cursor: pointer;
  268. transition: all 0.2s;
  269. }
  270. .play-btn:hover {
  271. border-color: var(--orange);
  272. color: var(--orange);
  273. }
  274. /* Secondary action button (pause/resume) */
  275. .play-btn.secondary {
  276. border-color: #2f2f2f;
  277. color: #c8c8c8;
  278. background: rgba(255, 255, 255, 0.02);
  279. }
  280. .play-btn.secondary:hover {
  281. border-color: #5a5a5a;
  282. color: #e6e6e6;
  283. }
  284. /* Small per-demo note block (feature description) */
  285. .feature-desc {
  286. padding: 14px 20px;
  287. border-top: 1px solid var(--border-color);
  288. background: rgba(255, 255, 255, 0.01);
  289. color: #9a9a9a;
  290. font-size: 12px;
  291. line-height: 1.6;
  292. }
  293. .feature-desc strong {
  294. color: #ddd;
  295. font-weight: 700;
  296. }
  297. /* Toast */
  298. .toast {
  299. position: fixed;
  300. right: 16px;
  301. bottom: 16px;
  302. background: rgba(20,20,20,0.95);
  303. border: 1px solid #2a2a2a;
  304. color: #ddd;
  305. padding: 10px 12px;
  306. border-radius: 10px;
  307. font-size: 12px;
  308. box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  309. opacity: 0;
  310. transform: translateY(10px);
  311. transition: opacity 0.18s, transform 0.18s;
  312. pointer-events: none;
  313. }
  314. .toast.show {
  315. opacity: 1;
  316. transform: translateY(0);
  317. }
  318. /* Previous / Next nav */
  319. .doc-nav {
  320. margin-top: 28px;
  321. padding-top: 18px;
  322. border-top: 1px solid var(--border-color);
  323. display: flex;
  324. align-items: center;
  325. justify-content: space-between;
  326. color: #aaa;
  327. font-size: 12px;
  328. }
  329. .doc-nav a {
  330. color: #aaa;
  331. text-decoration: none;
  332. padding: 10px 12px;
  333. border-radius: 10px;
  334. border: 1px solid transparent;
  335. min-width: 180px;
  336. display: inline-flex;
  337. align-items: center;
  338. justify-content: space-between;
  339. gap: 14px;
  340. background: rgba(255,255,255,0.02);
  341. }
  342. .doc-nav a:hover {
  343. border-color: #2a2a2a;
  344. background: rgba(255,255,255,0.03);
  345. color: #ddd;
  346. }
  347. .doc-nav .nav-label {
  348. color: #777;
  349. font-weight: 700;
  350. text-transform: uppercase;
  351. letter-spacing: 0.8px;
  352. font-size: 10px;
  353. }
  354. .doc-nav .nav-title {
  355. color: #cfcfcf;
  356. font-weight: 600;
  357. font-size: 12px;
  358. }
  359. .doc-nav .nav-center {
  360. color: #7a7a7a;
  361. font-weight: 600;
  362. letter-spacing: 0.4px;
  363. }