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. max-width: 980px;
  81. width: 100%;
  82. }
  83. h1 {
  84. color: var(--orange);
  85. font-size: 42px;
  86. margin-bottom: 15px;
  87. font-weight: 600;
  88. letter-spacing: -1px;
  89. }
  90. .description {
  91. font-size: 18px;
  92. line-height: 1.5;
  93. margin-bottom: 40px;
  94. color: #ccc;
  95. }
  96. h2 {
  97. font-size: 24px;
  98. color: #fff;
  99. margin-bottom: 10px;
  100. font-weight: 500;
  101. }
  102. p {
  103. margin-top: 0;
  104. margin-bottom: 20px;
  105. line-height: 1.6;
  106. }
  107. code.inline {
  108. background: rgba(255,255,255,0.1);
  109. color: #e6e6e6;
  110. padding: 2px 6px;
  111. border-radius: 3px;
  112. font-family: 'Roboto Mono', monospace;
  113. font-size: 0.9em;
  114. }
  115. /* Page top meta (breadcrumb + since) */
  116. .page-top {
  117. display: flex;
  118. align-items: center;
  119. justify-content: space-between;
  120. margin-bottom: 18px;
  121. }
  122. .crumb {
  123. font-size: 10px;
  124. font-weight: 800;
  125. letter-spacing: 1px;
  126. color: var(--highlight-color);
  127. text-transform: uppercase;
  128. }
  129. .since {
  130. font-size: 10px;
  131. font-weight: 700;
  132. letter-spacing: 1px;
  133. color: #7a6a55;
  134. text-transform: uppercase;
  135. }
  136. /* Code & Demo Box */
  137. .box-container {
  138. margin-top: 50px;
  139. background: var(--panel-bg);
  140. border-radius: 6px;
  141. overflow: hidden;
  142. box-shadow: var(--shadow-1);
  143. }
  144. .box-header {
  145. display: flex;
  146. justify-content: space-between;
  147. align-items: center;
  148. padding: 0 20px;
  149. height: 50px;
  150. background: rgba(255,255,255,0.02);
  151. border-bottom: 1px solid var(--border-color);
  152. }
  153. .box-title {
  154. color: var(--orange);
  155. font-weight: 600;
  156. font-size: 14px;
  157. }
  158. .box-right {
  159. display: flex;
  160. align-items: center;
  161. gap: 14px;
  162. height: 100%;
  163. }
  164. .tabs {
  165. display: flex;
  166. gap: 20px;
  167. height: 100%;
  168. }
  169. .tab {
  170. display: flex;
  171. align-items: center;
  172. height: 100%;
  173. cursor: pointer;
  174. color: #666;
  175. font-weight: 600;
  176. font-size: 13px;
  177. border-bottom: 2px solid transparent;
  178. transition: color 0.2s;
  179. }
  180. .tab:hover {
  181. color: #999;
  182. }
  183. .tab.active {
  184. color: var(--orange);
  185. border-bottom-color: var(--orange);
  186. }
  187. /* Code Views */
  188. .code-view, .html-view, .css-view {
  189. background: var(--code-bg);
  190. padding: 20px;
  191. font-family: 'Roboto Mono', 'Monaco', monospace;
  192. font-size: 13px;
  193. line-height: 1.6;
  194. color: #abb2bf;
  195. overflow-x: auto;
  196. display: none;
  197. white-space: pre; /* Use pre to respect indentation */
  198. margin: 0;
  199. }
  200. .code-view.active, .html-view.active, .css-view.active {
  201. display: block;
  202. }
  203. /* Syntax Highlighting */
  204. .kwd { color: #c678dd; }
  205. .str { color: #98c379; }
  206. .fun { color: #61afef; }
  207. .num { color: #d19a66; }
  208. .tag { color: #e06c75; }
  209. .attr { color: #d19a66; }
  210. .val { color: #98c379; }
  211. .punc { color: #abb2bf; }
  212. .com { color: #5c6370; font-style: italic; }
  213. /* Header icon buttons (copy, etc.) */
  214. .icon-btn {
  215. appearance: none;
  216. border: 1px solid transparent;
  217. background: transparent;
  218. color: #777;
  219. width: 28px;
  220. height: 28px;
  221. border-radius: 8px;
  222. display: inline-flex;
  223. align-items: center;
  224. justify-content: center;
  225. cursor: pointer;
  226. transition: border-color 0.15s, background 0.15s, color 0.15s;
  227. }
  228. .icon-btn:hover {
  229. color: #b0b0b0;
  230. border-color: #2a2a2a;
  231. background: rgba(255,255,255,0.03);
  232. }
  233. .icon-btn:active {
  234. transform: translateY(1px);
  235. }
  236. .icon-btn svg {
  237. width: 16px;
  238. height: 16px;
  239. display: block;
  240. }
  241. /* Visual Demo Area */
  242. .demo-visual {
  243. padding: 30px;
  244. background: #1a1a1a;
  245. border-top: 1px solid var(--border-color);
  246. min-height: 150px;
  247. /* Flex alignment defaults, can be overridden by specific page styles */
  248. display: flex;
  249. flex-direction: column;
  250. justify-content: center;
  251. }
  252. .action-bar {
  253. padding: 15px 30px;
  254. display: flex;
  255. justify-content: flex-end;
  256. align-items: center;
  257. gap: 10px;
  258. border-top: 1px solid var(--border-color);
  259. }
  260. .play-btn {
  261. background: transparent;
  262. border: 1px solid #444;
  263. color: #fff;
  264. padding: 6px 14px;
  265. border-radius: 100px;
  266. font-size: 12px;
  267. font-weight: 600;
  268. cursor: pointer;
  269. transition: all 0.2s;
  270. }
  271. .play-btn:hover {
  272. border-color: var(--orange);
  273. color: var(--orange);
  274. }
  275. /* Secondary action button (pause/resume) */
  276. .play-btn.secondary {
  277. border-color: #2f2f2f;
  278. color: #c8c8c8;
  279. background: rgba(255, 255, 255, 0.02);
  280. }
  281. .play-btn.secondary:hover {
  282. border-color: #5a5a5a;
  283. color: #e6e6e6;
  284. }
  285. /* Small per-demo note block (feature description) */
  286. .feature-desc {
  287. padding: 14px 20px;
  288. border-top: 1px solid var(--border-color);
  289. background: rgba(255, 255, 255, 0.01);
  290. color: #9a9a9a;
  291. font-size: 12px;
  292. line-height: 1.6;
  293. }
  294. .feature-desc strong {
  295. color: #ddd;
  296. font-weight: 700;
  297. }
  298. /* Toast */
  299. .toast {
  300. position: fixed;
  301. right: 16px;
  302. bottom: 16px;
  303. background: rgba(20,20,20,0.95);
  304. border: 1px solid #2a2a2a;
  305. color: #ddd;
  306. padding: 10px 12px;
  307. border-radius: 10px;
  308. font-size: 12px;
  309. box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  310. opacity: 0;
  311. transform: translateY(10px);
  312. transition: opacity 0.18s, transform 0.18s;
  313. pointer-events: none;
  314. }
  315. .toast.show {
  316. opacity: 1;
  317. transform: translateY(0);
  318. }
  319. /* Previous / Next nav */
  320. .doc-nav {
  321. margin-top: 28px;
  322. padding-top: 18px;
  323. border-top: 1px solid var(--border-color);
  324. display: flex;
  325. align-items: center;
  326. justify-content: space-between;
  327. color: #aaa;
  328. font-size: 12px;
  329. }
  330. .doc-nav a {
  331. color: #aaa;
  332. text-decoration: none;
  333. padding: 10px 12px;
  334. border-radius: 10px;
  335. border: 1px solid transparent;
  336. min-width: 180px;
  337. display: inline-flex;
  338. align-items: center;
  339. justify-content: space-between;
  340. gap: 14px;
  341. background: rgba(255,255,255,0.02);
  342. }
  343. .doc-nav a:hover {
  344. border-color: #2a2a2a;
  345. background: rgba(255,255,255,0.03);
  346. color: #ddd;
  347. }
  348. .doc-nav .nav-label {
  349. color: #777;
  350. font-weight: 700;
  351. text-transform: uppercase;
  352. letter-spacing: 0.8px;
  353. font-size: 10px;
  354. }
  355. .doc-nav .nav-title {
  356. color: #cfcfcf;
  357. font-weight: 600;
  358. font-size: 12px;
  359. }
  360. .doc-nav .nav-center {
  361. color: #7a7a7a;
  362. font-weight: 600;
  363. letter-spacing: 0.4px;
  364. }